|
||||||||||
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.Alternative<P>
public class Alternative<P extends Processor>
Compound symbol which contains several Symbol
s. The symbol which
matches will be processed.
Field Summary | |
---|---|
protected java.util.List<Symbol<P>> |
_symbols
|
Constructor Summary | |
---|---|
Alternative()
Creates an instance without any symbol. |
|
Alternative(Symbol<P> symbol)
Creates an instance with one symbol. |
Method Summary | |
---|---|
void |
addSymbol(Symbol<P> symbol)
Adds the specified symbol. |
void |
doProcess(TokenIterator iterator,
P processor)
Processes the current token of the specified iterator by the first matching symbol. |
MatchingResult |
matches(Token token)
Returns MatchingResult.OK if at least one symbol matches the
specified token. |
AbstractSymbol<P> |
or(Symbol<P> symbol)
Appends the specified symbol. |
Methods inherited from class net.sf.parcinj.AbstractSymbol |
---|
followedBy, oneOrMoreTimes, optional, process, zeroOrMoreTimes, zeroOrMoreTimesSeparatedBy |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.List<Symbol<P extends Processor>> _symbols
Constructor Detail |
---|
public Alternative()
public Alternative(Symbol<P> symbol)
Method Detail |
---|
public AbstractSymbol<P> or(Symbol<P> symbol)
or
in interface Symbol<P extends Processor>
or
in class AbstractSymbol<P extends Processor>
public MatchingResult matches(Token token)
MatchingResult.OK
if at least one symbol matches the
specified token. If no symbol matches the list of failure reasons are
returned.
token
- Token to be checked. Will be null
if beyond last
token.public void doProcess(TokenIterator iterator, P processor)
doProcess
in class AbstractSymbol<P extends Processor>
processor
- Processor
who does the actual processing.public void addSymbol(Symbol<P> symbol)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |