Package org.codehaus.mojo.natives.parser
Class WhitespaceOrCaseInsensitiveLetterState
- java.lang.Object
-
- org.codehaus.mojo.natives.parser.AbstractParserState
-
- org.codehaus.mojo.natives.parser.WhitespaceOrCaseInsensitiveLetterState
-
public final class WhitespaceOrCaseInsensitiveLetterState extends AbstractParserState
This parser state checks consumed characters against a specific character (case insensitive) or whitespace.
-
-
Field Summary
Fields Modifier and Type Field Description private char
lowerLetter
Character to match (lower case).private AbstractParserState
nextState
Next state if the character is found.private char
upperLetter
Character to match (upper case).
-
Constructor Summary
Constructors Constructor Description WhitespaceOrCaseInsensitiveLetterState(AbstractParser parser, char matchLetter, AbstractParserState nextStateArg)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractParserState
consume(char ch)
Consumes a character and returns the next state for the parser.-
Methods inherited from class org.codehaus.mojo.natives.parser.AbstractParserState
getParser
-
-
-
-
Field Detail
-
nextState
private final AbstractParserState nextState
Next state if the character is found.
-
lowerLetter
private final char lowerLetter
Character to match (lower case).
-
upperLetter
private final char upperLetter
Character to match (upper case).
-
-
Constructor Detail
-
WhitespaceOrCaseInsensitiveLetterState
public WhitespaceOrCaseInsensitiveLetterState(AbstractParser parser, char matchLetter, AbstractParserState nextStateArg)
Constructor.- Parameters:
parser
- parsermatchLetter
- letter to matchnextStateArg
- next state if a match on the letter
-
-
Method Detail
-
consume
public AbstractParserState consume(char ch)
Consumes a character and returns the next state for the parser.- Specified by:
consume
in classAbstractParserState
- Parameters:
ch
- next character- Returns:
- the configured nextState if ch is the expected character or the configure noMatchState otherwise.
-
-