Package org.javacc.parser
Class NormalProduction
- java.lang.Object
-
- org.javacc.parser.Expansion
-
- org.javacc.parser.NormalProduction
-
- Direct Known Subclasses:
BNFProduction,CodeProduction
public class NormalProduction extends Expansion
Describes JavaCC productions.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringaccessModThe access modifier of this production.private booleanemptyPossibleThis boolean flag is true if this production can expand to empty.private java.lang.Stringeolprivate ExpansionexpansionThe RHS of this production.private TokenfirstTokenprivate TokenlastTokenThe first and last tokens from the input stream that represent this production.private NormalProduction[]leftExpansionsA list of all non-terminals that this one can expand to without having to consume any tokens.(package private) intleIndexprivate java.lang.StringlhsThe name of the non-terminal of this production.private java.util.List<Token>parameter_list_tokensThe tokens that make up the parameters of this production.private java.util.List<Expansion>parentsThe NonTerminal nodes which refer to this production.private java.util.List<Token>return_type_tokensThe tokens that make up the return type of this production.private java.util.List<java.util.List<Token>>throws_listEach entry in this list is a list of tokens that represents an exception in the throws list of this production.private intwalkStatusThe 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 org.javacc.parser.Expansion
inMinimumSize, myGeneration, ordinal, parent
-
-
Constructor Summary
Constructors Constructor Description NormalProduction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringBufferdump(int indent, java.util.Set<Expansion> alreadyDumped)protected java.lang.StringBufferdumpPrefix(int indent)java.lang.StringgetAccessMod()ExpansiongetExpansion()TokengetFirstToken()TokengetLastToken()(package private) NormalProduction[]getLeftExpansions()java.lang.StringgetLhs()java.util.List<Token>getParameterListTokens()(package private) java.util.List<Expansion>getParents()java.util.List<Token>getReturnTypeTokens()protected java.lang.StringgetSimpleName()java.util.List<java.util.List<Token>>getThrowsList()(package private) intgetWalkStatus()(package private) booleanisEmptyPossible()voidsetAccessMod(java.lang.String accessMod)(package private) booleansetEmptyPossible(boolean emptyPossible)voidsetExpansion(Expansion expansion)TokensetFirstToken(Token firstToken)voidsetLastToken(Token lastToken)(package private) voidsetLeftExpansions(NormalProduction[] leftExpansions)voidsetLhs(java.lang.String lhs)voidsetThrowsList(java.util.List<java.util.List<Token>> throws_list)(package private) voidsetWalkStatus(int walkStatus)
-
-
-
Field Detail
-
parents
private final java.util.List<Expansion> parents
The NonTerminal nodes which refer to this production.
-
accessMod
private java.lang.String accessMod
The access modifier of this production.
-
lhs
private java.lang.String lhs
The name of the non-terminal of this production.
-
return_type_tokens
private final java.util.List<Token> return_type_tokens
The tokens that make up the return type of this production.
-
parameter_list_tokens
private final java.util.List<Token> parameter_list_tokens
The tokens that make up the parameters of this production.
-
throws_list
private java.util.List<java.util.List<Token>> throws_list
Each entry in this list is a list of tokens that represents an exception in the throws list of this production. This list does not include ParseException which is always thrown.
-
expansion
private Expansion expansion
The RHS of this production. Not used for JavaCodeProduction.
-
emptyPossible
private boolean emptyPossible
This boolean flag is true if this production can expand to empty.
-
leftExpansions
private NormalProduction[] 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 walkStatus
The 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
private Token lastToken
The first and last tokens from the input stream that represent this production.
-
firstToken
private Token firstToken
-
eol
private final java.lang.String eol
-
-
Method Detail
-
dumpPrefix
protected java.lang.StringBuffer dumpPrefix(int indent)
- Overrides:
dumpPrefixin classExpansion
-
getSimpleName
protected java.lang.String getSimpleName()
-
dump
public java.lang.StringBuffer dump(int indent, java.util.Set<Expansion> alreadyDumped)
-
getParents
java.util.List<Expansion> getParents()
- Returns:
- the parents
-
setAccessMod
public void setAccessMod(java.lang.String accessMod)
- Parameters:
accessMod- the accessMod to set
-
getAccessMod
public java.lang.String getAccessMod()
- Returns:
- the accessMod
-
setLhs
public void setLhs(java.lang.String lhs)
- Parameters:
lhs- the lhs to set
-
getLhs
public java.lang.String getLhs()
- Returns:
- the lhs
-
getReturnTypeTokens
public java.util.List<Token> getReturnTypeTokens()
- Returns:
- the return_type_tokens
-
getParameterListTokens
public java.util.List<Token> getParameterListTokens()
- Returns:
- the parameter_list_tokens
-
setThrowsList
public void setThrowsList(java.util.List<java.util.List<Token>> throws_list)
- Parameters:
throws_list- the throws_list to set
-
getThrowsList
public java.util.List<java.util.List<Token>> getThrowsList()
- Returns:
- the throws_list
-
setExpansion
public void setExpansion(Expansion expansion)
- Parameters:
expansion- the expansion to set
-
getExpansion
public Expansion getExpansion()
- Returns:
- the expansion
-
setEmptyPossible
boolean setEmptyPossible(boolean emptyPossible)
- Parameters:
emptyPossible- the emptyPossible to set
-
isEmptyPossible
boolean isEmptyPossible()
- Returns:
- the emptyPossible
-
setLeftExpansions
void setLeftExpansions(NormalProduction[] leftExpansions)
- 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
public Token setFirstToken(Token firstToken)
- Parameters:
firstToken- the firstToken to set
-
getFirstToken
public Token getFirstToken()
- Returns:
- the firstToken
-
setLastToken
public void setLastToken(Token lastToken)
- Parameters:
lastToken- the lastToken to set
-
getLastToken
public Token getLastToken()
- Returns:
- the lastToken
-
-