antlr

Class RuleBlock


public class RuleBlock
extends AlternativeBlock

A list of alternatives and info contained in the rule definition.

Field Summary

protected String
argAction
protected Lookahead[]
cache
protected boolean
defaultErrorHandler
protected RuleEndElement
endNode
(package private) Hashtable
exceptionSpecs
protected String
ignoreRule
(package private) Vector
labeledElements
protected boolean[]
lock
protected String
returnAction
protected String
ruleName
protected boolean
testLiterals
protected String
throwsSpec

Fields inherited from class antlr.AlternativeBlock

ID, alternatives, alti, altj, analysisAlt, doAutoGen, generateAmbigWarnings, greedy, greedySet, hasASynPred, hasAnAction, initAction, label, nblks, not, warnWhenFollowAmbig

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

RuleBlock(Grammar g, String r)
Construct a named rule.
RuleBlock(Grammar g, String r, int line, boolean doAutoGen_)
Construct a named rule with line number information

Method Summary

void
addExceptionSpec(ExceptionSpec ex)
ExceptionSpec
findExceptionSpec(String label)
ExceptionSpec
findExceptionSpec(Token label)
void
generate()
boolean
getDefaultErrorHandler()
RuleEndElement
getEndElement()
String
getIgnoreRule()
String
getRuleName()
boolean
getTestLiterals()
boolean
isLexerAutoGenRule()
Lookahead
look(int k)
void
prepareForAnalysis()
void
setDefaultErrorHandler(boolean value)
void
setEndElement(RuleEndElement re)
void
setOption(Token key, Token value)
String
toString()

Methods inherited from class antlr.AlternativeBlock

addAlternative, generate, getAlternativeAt, getAlternatives, getAutoGen, getInitAction, getLabel, look, prepareForAnalysis, removeTrackingOfRuleRefs, setAlternatives, setAutoGen, setInitAction, setLabel, setOption, toString

Methods inherited from class antlr.AlternativeElement

getAutoGenType, getLabel, setAutoGenType, setLabel

Methods inherited from class antlr.GrammarElement

generate, getColumn, getLine, look, toString

Field Details

argAction

protected String argAction

cache

protected Lookahead[] cache

defaultErrorHandler

protected boolean defaultErrorHandler

endNode

protected RuleEndElement endNode

exceptionSpecs

(package private)  Hashtable exceptionSpecs

ignoreRule

protected String ignoreRule

labeledElements

(package private)  Vector labeledElements

lock

protected boolean[] lock

returnAction

protected String returnAction

ruleName

protected String ruleName

testLiterals

protected boolean testLiterals

throwsSpec

protected String throwsSpec

Constructor Details

RuleBlock

public RuleBlock(Grammar g,
                 String r)
Construct a named rule.

RuleBlock

public RuleBlock(Grammar g,
                 String r,
                 int line,
                 boolean doAutoGen_)
Construct a named rule with line number information

Method Details

addExceptionSpec

public void addExceptionSpec(ExceptionSpec ex)

findExceptionSpec

public ExceptionSpec findExceptionSpec(String label)

findExceptionSpec

public ExceptionSpec findExceptionSpec(Token label)

generate

public void generate()
Overrides:
generate in interface AlternativeBlock

getDefaultErrorHandler

public boolean getDefaultErrorHandler()

getEndElement

public RuleEndElement getEndElement()

getIgnoreRule

public String getIgnoreRule()

getRuleName

public String getRuleName()

getTestLiterals

public boolean getTestLiterals()

isLexerAutoGenRule

public boolean isLexerAutoGenRule()

look

public Lookahead look(int k)
Overrides:
look in interface AlternativeBlock

prepareForAnalysis

public void prepareForAnalysis()
Overrides:
prepareForAnalysis in interface AlternativeBlock

setDefaultErrorHandler

public void setDefaultErrorHandler(boolean value)

setEndElement

public void setEndElement(RuleEndElement re)

setOption

public void setOption(Token key,
                      Token value)
Overrides:
setOption in interface AlternativeBlock

toString

public String toString()
Overrides:
toString in interface AlternativeBlock