openjava.syntax
Class IterationRule
java.lang.Object
|
+--openjava.syntax.AbstractSyntaxRule
|
+--openjava.syntax.IterationRule
- public class IterationRule
- extends AbstractSyntaxRule
The class IterationRule
represents iterative syntax
rule.
Suppose there's a syntax rule A. This class can represents
the syntax ( A )* or ( A )+
- Since:
- %SOFTWARE% 1.0
- See Also:
Object
Constructor Summary |
IterationRule(SyntaxRule elementRule)
Allocates a new rule representing iterations of a given rule
not allowing 0 iteration. |
IterationRule(SyntaxRule elementRule,
boolean allowsEmpty)
Allocates a new rule representing iterations of a given rule. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
IterationRule
public IterationRule(SyntaxRule elementRule,
boolean allowsEmpty)
- Allocates a new rule representing iterations of a given rule.
- Parameters:
elementRule
- a rule to iterateallowsEmpty
- a flag to allow 0 iteration if it is true.
IterationRule
public IterationRule(SyntaxRule elementRule)
- Allocates a new rule representing iterations of a given rule
not allowing 0 iteration.
- Parameters:
elementRule
- a rule to iterate
consume
public ParseTree consume(TokenSource token_src)
throws SyntaxException
- Consumes token source.
- Overrides:
- consume in class AbstractSyntaxRule
- Parameters:
token_src
- token source.- Returns:
- null if this fails to consume a syntax tree represented
by this object. Otherwise it returns
ObjectList
object.