net.morimekta.providence.graphql.parser.GQLLexer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of providence-graphql Show documentation
Show all versions of providence-graphql Show documentation
Providence Core extension for GraphQL.
package net.morimekta.providence.graphql.parser;
import net.morimekta.util.lexer.Lexer;
import javax.annotation.Nullable;
import java.io.IOException;
import java.io.Reader;
public class GQLLexer extends Lexer {
/**
* Create a lexer instance using a specific tokenizer.
*
* @param reader Reader to read graphql from.
*/
public GQLLexer(Reader reader) {
super(new GQLTokenizer(reader));
}
@Nullable
@Override
public GQLToken next() throws IOException {
GQLToken next = super.next();
if (next != null) {
last = next;
}
return next;
}
public GQLToken getLastToken() {
return last;
}
private GQLToken last;
}