|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.syntax.AbstractSyntaxRule | +--openjava.syntax.SeparatedListRule
The class SeparatedListRule
represents the syntax
rule of a list separated by an separator.
Suppose there's a syntax rule A and token t. This class can represents the syntax A ( t A )*.
Object
Constructor Summary | |
SeparatedListRule(SyntaxRule elementRule,
int separator_token)
Allocates a new rule representing a list of a give rule separeted by a given separator. |
|
SeparatedListRule(SyntaxRule elementRule,
int separator_token,
boolean allowsEmpty)
Allocates a new rule representing a list of a give rule separeted by a given separator. |
Method Summary | |
protected abstract void |
addListElement(java.lang.Object elem)
|
ParseTree |
consume(TokenSource token_src)
Consumes token source. |
protected abstract ParseTree |
getList()
|
protected abstract void |
initList()
|
Methods inherited from class openjava.syntax.AbstractSyntaxRule |
getSyntaxException, lookahead |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SeparatedListRule(SyntaxRule elementRule, int separator_token, boolean allowsEmpty)
elementRule
- a rule of each element of the listseparator_token
- the id of a token to be separatorallowEmpty
- a flag to allow 0 iteration if it is true.TokenID
public SeparatedListRule(SyntaxRule elementRule, int separator_token)
elementRule
- a rule of each element of the listseparator_token
- the id of a token to be separatorTokenID
Method Detail |
protected abstract void initList()
protected abstract void addListElement(java.lang.Object elem)
protected abstract ParseTree getList()
public final ParseTree consume(TokenSource token_src) throws SyntaxException
consume
in class AbstractSyntaxRule
token_src
- token source.ObjectList
object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |