Package eu.royalsloth.depbuilder.dsl
Class DslLexer.Tokenizer
- java.lang.Object
-
- eu.royalsloth.depbuilder.dsl.DslLexer.Tokenizer
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
advance()
void
back()
int
getCharacterNumberInLine(Token token)
char
getCurrentChar()
int
getLine()
int
getLine(Token token)
Get the line in which the token appears.Token
getNextToken()
static Token
parseDigitToken(DslLexer.Tokenizer tokenizer, Token token)
static Token
parseIdentifier(DslLexer.Tokenizer tokenizer, Token token)
char
peekNextChar()
Token
peekNextToken()
String
substring(int start, int end)
List<Token>
toTokens()
-
-
-
Field Detail
-
position
public int position
-
line
public int line
-
input
public final String input
-
-
Constructor Detail
-
Tokenizer
public Tokenizer(String input)
-
-
Method Detail
-
peekNextToken
public Token peekNextToken()
-
getNextToken
public Token getNextToken()
-
getCurrentChar
public char getCurrentChar()
-
advance
public void advance()
-
back
public void back()
-
substring
public String substring(int start, int end)
-
peekNextChar
public char peekNextChar()
-
getLine
public int getLine()
- Returns:
- get current tokenizer line on which we are parsing the tokens
-
getLine
public int getLine(Token token)
Get the line in which the token appears. This should be only used for reporting error messages, as this method is quite slow (iterating over the entire text).
-
getCharacterNumberInLine
public int getCharacterNumberInLine(Token token)
-
parseDigitToken
public static Token parseDigitToken(DslLexer.Tokenizer tokenizer, Token token)
-
parseIdentifier
public static Token parseIdentifier(DslLexer.Tokenizer tokenizer, Token token)
-
-