public final class LetterState extends AbstractParserState
Modifier and Type | Field and Description |
---|---|
private AbstractParserState |
nextState
Next state if a match is found.
|
private AbstractParserState |
noMatchState
Next state if not match is found.
|
private char |
thisLetter
Character to match.
|
Constructor and Description |
---|
LetterState(AbstractParser parser,
char matchLetter,
AbstractParserState nextStateArg,
AbstractParserState noMatchStateArg)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
AbstractParserState |
consume(char ch)
Consumes a character and returns the next state for the parser.
|
getParser
private final AbstractParserState nextState
private final AbstractParserState noMatchState
private final char thisLetter
public LetterState(AbstractParser parser, char matchLetter, AbstractParserState nextStateArg, AbstractParserState noMatchStateArg)
parser
- parsermatchLetter
- letter to matchnextStateArg
- next state if a match on the letternoMatchStateArg
- state if no match on letterpublic AbstractParserState consume(char ch)
consume
in class AbstractParserState
ch
- next character