antlr
Class RuleBlock
java.lang.Object
|
+--antlr.GrammarElement
|
+--antlr.AlternativeElement
|
+--antlr.AlternativeBlock
|
+--antlr.RuleBlock
- public class RuleBlock
- extends AlternativeBlock
A list of alternatives and info contained in
the rule definition.
Constructor Summary |
RuleBlock(Grammar g,
java.lang.String r)
Construct a named rule. |
RuleBlock(Grammar g,
java.lang.String r,
int line,
boolean doAutoGen_)
Construct a named rule with line number information |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ruleName
protected java.lang.String ruleName
argAction
protected java.lang.String argAction
throwsSpec
protected java.lang.String throwsSpec
returnAction
protected java.lang.String returnAction
endNode
protected RuleEndElement endNode
testLiterals
protected boolean testLiterals
labeledElements
Vector labeledElements
lock
protected boolean[] lock
cache
protected Lookahead[] cache
exceptionSpecs
java.util.Hashtable exceptionSpecs
defaultErrorHandler
protected boolean defaultErrorHandler
ignoreRule
protected java.lang.String ignoreRule
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
next
AlternativeElement next
autoGenType
protected int autoGenType
enclosingRuleName
protected java.lang.String enclosingRuleName
AUTO_GEN_NONE
public static final int AUTO_GEN_NONE
- See Also:
- Constant Field Values
AUTO_GEN_CARET
public static final int AUTO_GEN_CARET
- See Also:
- Constant Field Values
AUTO_GEN_BANG
public static final int AUTO_GEN_BANG
- See Also:
- Constant Field Values
grammar
protected Grammar grammar
line
protected int line
RuleBlock
public RuleBlock(Grammar g,
java.lang.String r)
- Construct a named rule.
RuleBlock
public RuleBlock(Grammar g,
java.lang.String r,
int line,
boolean doAutoGen_)
- Construct a named rule with line number information
addExceptionSpec
public void addExceptionSpec(ExceptionSpec ex)
findExceptionSpec
public ExceptionSpec findExceptionSpec(Token label)
findExceptionSpec
public ExceptionSpec findExceptionSpec(java.lang.String label)
generate
public void generate()
- Overrides:
generate
in class AlternativeBlock
getDefaultErrorHandler
public boolean getDefaultErrorHandler()
getEndElement
public RuleEndElement getEndElement()
getIgnoreRule
public java.lang.String getIgnoreRule()
getRuleName
public java.lang.String getRuleName()
getTestLiterals
public boolean getTestLiterals()
isLexerAutoGenRule
public boolean isLexerAutoGenRule()
look
public Lookahead look(int k)
- Overrides:
look
in class AlternativeBlock
prepareForAnalysis
public void prepareForAnalysis()
- Overrides:
prepareForAnalysis
in class AlternativeBlock
setDefaultErrorHandler
public void setDefaultErrorHandler(boolean value)
setEndElement
public void setEndElement(RuleEndElement re)
setOption
public void setOption(Token key,
Token value)
- Overrides:
setOption
in class AlternativeBlock
toString
public java.lang.String toString()
- Overrides:
toString
in class AlternativeBlock
addAlternative
public void addAlternative(Alternative alt)
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:
getLabel
in class AlternativeElement
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:
setLabel
in class AlternativeElement
getAutoGenType
public int getAutoGenType()
getLine
public int getLine()