Class NormalProduction
java.lang.Object
org.javacc.parser.Expansion
org.javacc.parser.NormalProduction
- Direct Known Subclasses:
BNFProduction, CodeProduction
Describes JavaCC productions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe access modifier of this production.private booleanThis boolean flag is true if this production can expand to empty.private final Stringprivate ExpansionThe RHS of this production.private Tokenprivate TokenThe first and last tokens from the input stream that represent this production.private NormalProduction[]A list of all non-terminals that this one can expand to without having to consume any tokens.(package private) intprivate StringThe name of the non-terminal of this production.The tokens that make up the parameters of this production.The NonTerminal nodes which refer to this production.The tokens that make up the return type of this production.Each entry in this list is a list of tokens that represents an exception in the throws list of this production.private intThe following variable is used to maintain state information for the left-recursion determination algorithm: It is initialized to 0, and set to -1 if this node has been visited in a pre-order walk, and then it is set to 1 if the pre-order walk of the whole graph from this node has been traversed.Fields inherited from class Expansion
inMinimumSize, myGeneration, ordinal, parent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringBufferdumpPrefix(int indent) (package private) NormalProduction[]getLhs()protected String(package private) int(package private) booleanvoidsetAccessMod(String accessMod) (package private) booleansetEmptyPossible(boolean emptyPossible) voidsetExpansion(Expansion expansion) setFirstToken(Token firstToken) voidsetLastToken(Token lastToken) (package private) voidsetLeftExpansions(NormalProduction[] leftExpansions) voidvoidsetThrowsList(List<List<Token>> throws_list) (package private) voidsetWalkStatus(int walkStatus)
-
Field Details
-
parents
-
accessMod
The access modifier of this production. -
lhs
The name of the non-terminal of this production. -
return_type_tokens
-
parameter_list_tokens
-
throws_list
-
expansion
The RHS of this production. Not used for JavaCodeProduction. -
emptyPossible
private boolean emptyPossibleThis boolean flag is true if this production can expand to empty. -
leftExpansions
A list of all non-terminals that this one can expand to without having to consume any tokens. Also an index that shows how many pointers exist. -
leIndex
int leIndex -
walkStatus
private int walkStatusThe following variable is used to maintain state information for the left-recursion determination algorithm: It is initialized to 0, and set to -1 if this node has been visited in a pre-order walk, and then it is set to 1 if the pre-order walk of the whole graph from this node has been traversed. i.e., -1 indicates partially processed, and 1 indicates fully processed. -
lastToken
The first and last tokens from the input stream that represent this production. -
firstToken
-
eol
-
-
Constructor Details
-
NormalProduction
public NormalProduction()
-
-
Method Details
-
dumpPrefix
- Overrides:
dumpPrefixin classExpansion
-
getSimpleName
-
dump
-
getParents
-
setAccessMod
- Parameters:
accessMod- the accessMod to set
-
getAccessMod
- Returns:
- the accessMod
-
setLhs
- Parameters:
lhs- the lhs to set
-
getLhs
- Returns:
- the lhs
-
getReturnTypeTokens
-
getParameterListTokens
-
setThrowsList
-
getThrowsList
-
setExpansion
- Parameters:
expansion- the expansion to set
-
getExpansion
- Returns:
- the expansion
-
setEmptyPossible
boolean setEmptyPossible(boolean emptyPossible) - Parameters:
emptyPossible- the emptyPossible to set
-
isEmptyPossible
boolean isEmptyPossible()- Returns:
- the emptyPossible
-
setLeftExpansions
- Parameters:
leftExpansions- the leftExpansions to set
-
getLeftExpansions
NormalProduction[] getLeftExpansions()- Returns:
- the leftExpansions
-
setWalkStatus
void setWalkStatus(int walkStatus) - Parameters:
walkStatus- the walkStatus to set
-
getWalkStatus
int getWalkStatus()- Returns:
- the walkStatus
-
setFirstToken
-
getFirstToken
- Returns:
- the firstToken
-
setLastToken
- Parameters:
lastToken- the lastToken to set
-
getLastToken
- Returns:
- the lastToken
-