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

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

public abstract class TerminalSymbol<P extends Processor>
extends AbstractSymbol<P>

Abstract super class of all terminal symbols. Concrete classes have to implement Symbol.matches(Token).


Constructor Summary
TerminalSymbol()
           
 
Method Summary
protected  void doProcess(TokenIterator iterator, P processor)
          Processes the current token of the specified iterator by invoking process(Token, Processor) and go to the next token.
protected  void process(Token token, P processor)
          Processes the specified token by the specified processor.
 
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
 
Methods inherited from interface net.sf.parcinj.Symbol
matches
 

Constructor Detail

TerminalSymbol

public TerminalSymbol()
Method Detail

doProcess

protected final void doProcess(TokenIterator iterator,
                               P processor)
                        throws ParsingException
Processes the current token of the specified iterator by invoking process(Token, Processor) and go to the next token.

Specified by:
doProcess in class AbstractSymbol<P extends Processor>
processor - Processor who does the actual processing.
Throws:
ParsingException - if a parsing error occurs.

process

protected void process(Token token,
                       P processor)
Processes the specified token by the specified processor. Default implementation of this method does nothing. This hook method can be overridden by subclasses.