net.sf.parcinj
Class TerminalSymbolByText<P extends Processor>

java.lang.Object
  extended by net.sf.parcinj.AbstractSymbol<P>
      extended by net.sf.parcinj.TerminalSymbol<P>
          extended by net.sf.parcinj.TerminalSymbolByText<P>
All Implemented Interfaces:
Symbol<P>

public class TerminalSymbolByText<P extends Processor>
extends TerminalSymbol<P>

A terminal symbol which matches a Token by token text.


Constructor Summary
TerminalSymbolByText(java.lang.String terminalSymbol)
          Creates an instance for the specified terminal symbol text.
TerminalSymbolByText(TerminalSymbolType terminalSymbolType)
          Creates an instance for the string representation of the specified terminal symbol type.
 
Method Summary
 MatchingResult matches(Token token)
          Returns MatchingResult.OK the specified token is not null and its token text equals the terminal symbol text 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

TerminalSymbolByText

public TerminalSymbolByText(TerminalSymbolType terminalSymbolType)
Creates an instance for the string representation of the specified terminal symbol type.


TerminalSymbolByText

public TerminalSymbolByText(java.lang.String terminalSymbol)
Creates an instance for the specified terminal symbol text.

Method Detail

matches

public MatchingResult matches(Token token)
Returns MatchingResult.OK the specified token is not null and its token text equals the terminal symbol text specified in the constructor.

Parameters:
token - Token to be checked. Will be null if beyond last token.