Package antlr
Class AlternativeBlock
- java.lang.Object
-
- antlr.GrammarElement
-
- antlr.AlternativeElement
-
- antlr.AlternativeBlock
-
- Direct Known Subclasses:
BlockWithImpliedExitPath,RuleBlock,SynPredBlock,TreeElement
class AlternativeBlock extends AlternativeElement
A list of alternatives
-
-
Field Summary
Fields Modifier and Type Field Description protected Vectoralternativesprotected intaltiprotected intaltjprotected intanalysisAltprotected booleandoAutoGenprotected booleangenerateAmbigWarnings(package private) booleangreedy(package private) booleangreedySetprotected booleanhasAnActionprotected booleanhasASynPredprotected intIDprotected java.lang.StringinitActionprotected java.lang.Stringlabelprotected static intnblks(package private) booleannotprotected booleanwarnWhenFollowAmbig-
Fields inherited from class antlr.AlternativeElement
autoGenType, enclosingRuleName, next
-
Fields inherited from class antlr.GrammarElement
AUTO_GEN_BANG, AUTO_GEN_CARET, AUTO_GEN_NONE, column, grammar, line
-
-
Constructor Summary
Constructors Constructor Description AlternativeBlock(Grammar g)AlternativeBlock(Grammar g, Token start, boolean not)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAlternative(Alternative alt)voidgenerate()AlternativegetAlternativeAt(int i)VectorgetAlternatives()booleangetAutoGen()java.lang.StringgetInitAction()java.lang.StringgetLabel()Lookaheadlook(int k)voidprepareForAnalysis()voidremoveTrackingOfRuleRefs(Grammar g)Walk the syntactic predicate and, for a rule ref R, remove the ref from the list of FOLLOW references for R (stored in the symbol table.voidsetAlternatives(Vector v)voidsetAutoGen(boolean doAutoGen_)voidsetInitAction(java.lang.String initAction_)voidsetLabel(java.lang.String label_)voidsetOption(Token key, Token value)java.lang.StringtoString()-
Methods inherited from class antlr.AlternativeElement
getAutoGenType, setAutoGenType
-
Methods inherited from class antlr.GrammarElement
getColumn, getLine
-
-
-
-
Field Detail
-
initAction
protected java.lang.String initAction
-
alternatives
protected Vector alternatives
-
label
protected java.lang.String label
-
alti
protected int alti
-
altj
protected int altj
-
analysisAlt
protected int analysisAlt
-
hasAnAction
protected boolean hasAnAction
-
hasASynPred
protected boolean hasASynPred
-
ID
protected int ID
-
nblks
protected static int nblks
-
not
boolean not
-
greedy
boolean greedy
-
greedySet
boolean greedySet
-
doAutoGen
protected boolean doAutoGen
-
warnWhenFollowAmbig
protected boolean warnWhenFollowAmbig
-
generateAmbigWarnings
protected boolean generateAmbigWarnings
-
-
Method Detail
-
addAlternative
public void addAlternative(Alternative alt)
-
generate
public void generate()
- Overrides:
generatein classGrammarElement
-
getAlternativeAt
public Alternative getAlternativeAt(int i)
-
getAlternatives
public Vector getAlternatives()
-
getAutoGen
public boolean getAutoGen()
-
getInitAction
public java.lang.String getInitAction()
-
getLabel
public java.lang.String getLabel()
- Overrides:
getLabelin classAlternativeElement
-
look
public Lookahead look(int k)
- Overrides:
lookin classGrammarElement
-
prepareForAnalysis
public void prepareForAnalysis()
-
removeTrackingOfRuleRefs
public void removeTrackingOfRuleRefs(Grammar g)
Walk the syntactic predicate and, for a rule ref R, remove the ref from the list of FOLLOW references for R (stored in the symbol table.
-
setAlternatives
public void setAlternatives(Vector v)
-
setAutoGen
public void setAutoGen(boolean doAutoGen_)
-
setInitAction
public void setInitAction(java.lang.String initAction_)
-
setLabel
public void setLabel(java.lang.String label_)
- Overrides:
setLabelin classAlternativeElement
-
toString
public java.lang.String toString()
- Specified by:
toStringin classGrammarElement
-
-