java.lang.Object
io.jenetics.ext.internal.parser.Parser<T>
- Type Parameters:
T- the token type
- Direct Known Subclasses:
TokenParser
Parser implementation for parsing a given token sequences.
- Since:
- 7.1
- Version:
- 7.1
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Parser
Create a new parser object with the giventokenizerand lookahead countk.- Parameters:
tokenizer- the token sourcethisparser usesk- the lookahead count
-
-
Method Details
-
LT
Return the lookahead token with the given index. The index starts at1. The returned token might benull.- Parameters:
index- lookahead index- Returns:
- the token at the given index
-
match
Try to match and consume the next token of the giventype. If the current token is not from the given type, aParsingExceptionis thrown.- Parameters:
token- the token type to match- Returns:
- the matched token
- Throws:
ParsingException- if the current token doesn't match the desiredtoken
-
consume
Consumes the next token.
-