|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.parcinj.AbstractSymbol<P>
net.sf.parcinj.TerminalSymbol<P>
net.sf.parcinj.TerminalSymbolByType<P>
public class TerminalSymbolByType<P extends Processor>
Terminal symbol specified by a TokenType
.
Constructor Summary | |
---|---|
TerminalSymbolByType(TokenType tokenType)
Creates an instance for the specified token type. |
Method Summary | |
---|---|
protected java.lang.String |
createFailure(TokenType expectedType)
Returns failure text for the specified token type. |
MatchingResult |
matches(Token token)
Returns MatchingResult.OK if the specified token is not
null and it is of equal type as specified in the
constructor. |
Methods inherited from class net.sf.parcinj.TerminalSymbol |
---|
doProcess, process |
Methods inherited from class net.sf.parcinj.AbstractSymbol |
---|
followedBy, oneOrMoreTimes, optional, or, process, zeroOrMoreTimes, zeroOrMoreTimesSeparatedBy |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TerminalSymbolByType(TokenType tokenType)
tokenType
- Method Detail |
---|
public MatchingResult matches(Token token)
MatchingResult.OK
if the specified token is not
null
and it is of equal type as specified in the
constructor.
token
- Token to be checked. Will be null
if beyond last
token.protected java.lang.String createFailure(TokenType expectedType)
MatchingResult
returned by
matches(Token)
. Should be overridden by subclasses in order to
get more meaningful failure message than 'Not a token of type <token
type>
'.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |