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

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

public class ZeroOrMore<P extends Processor>
extends AbstractSymbol<P>

Wraps a symbol which will be executed zero or more times.


Constructor Summary
ZeroOrMore(Symbol<P> symbol)
          Creates an instance for the specified symbol.
 
Method Summary
protected  void doProcess(TokenIterator iterator, P processor)
          Processes the specified iterator as long as the wrapped symbol matches.
 MatchingResult matches(Token token)
          Returns MatchingResult.OK.
 
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

ZeroOrMore

public ZeroOrMore(Symbol<P> symbol)
Creates an instance for the specified symbol.

Method Detail

matches

public MatchingResult matches(Token token)
Returns MatchingResult.OK.

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

doProcess

protected final void doProcess(TokenIterator iterator,
                               P processor)
                        throws ParsingException
Processes the specified iterator as long as the wrapped symbol matches.

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