|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antlr.DefineGrammarSymbols | +--antlr.MakeGrammar
Untamed:
Field Summary | |
protected Stack |
blocks
|
(package private) ExceptionSpec |
currentExceptionSpec
|
protected boolean |
grammarError
|
protected RuleRefElement |
lastRuleRef
|
protected int |
nested
|
protected RuleBlock |
ruleBlock
|
protected RuleEndElement |
ruleEnd
|
Fields inherited from class antlr.DefineGrammarSymbols |
analyzer, args, DEFAULT_TOKENMANAGER_NAME, grammar, grammars, headerActions, language, numLexers, numParsers, numTreeParsers, thePreambleAction, tokenManagers, tool |
Constructor Summary | |
MakeGrammar(Tool tool_,
String[] args_,
LLkAnalyzer analyzer_)
Enabled: |
Method Summary | |
void |
abortGrammar()
Enabled: Abort the processing of a grammar (due to syntax errors) |
protected void |
addElementToCurrentAlt(AlternativeElement e)
|
void |
beginAlt(boolean doAutoGen_)
Enabled: |
void |
beginChildList()
Enabled: |
void |
beginExceptionGroup()
Enabled: Add an exception group to a rule (currently a no-op) |
void |
beginExceptionSpec(Token label)
Enabled: Add an exception spec to an exception group or rule block |
void |
beginSubRule(Token label,
int line,
boolean not)
Enabled: |
void |
beginTree(int line)
Enabled: |
BlockContext |
context()
Enabled: |
static RuleBlock |
createNextTokenRule(Grammar g,
Vector lexRules,
String rname)
Enabled: Used to build nextToken() for the lexer. |
private AlternativeBlock |
createOptionalRuleRef(String rule,
int line)
Return block as if they had typed: "( rule )?" |
void |
defineRuleName(Token r,
String access,
boolean ruleAutoGen,
String docComment)
Enabled: |
void |
endAlt()
Enabled: |
void |
endChildList()
Enabled: |
void |
endExceptionGroup()
Enabled: |
void |
endExceptionSpec()
Enabled: |
void |
endGrammar()
Enabled: Called at the end of processing a grammar |
void |
endRule(String rule)
Enabled: |
void |
endSubRule()
Enabled: |
void |
endTree()
Enabled: |
void |
hasError()
Enabled: Remember that a major error occured in the grammar |
private void |
labelElement(AlternativeElement el,
Token label)
|
void |
noAutoGenSubRule()
Enabled: |
void |
oneOrMoreSubRule()
Enabled: |
void |
optionalSubRule()
Enabled: |
void |
refAction(Token action)
Enabled: |
void |
refArgAction(Token action)
Enabled: |
void |
refCharLiteral(Token lit,
Token label,
boolean inverted,
int autoGenType,
boolean lastInRule)
Enabled: |
void |
refCharRange(Token t1,
Token t2,
Token label,
int autoGenType,
boolean lastInRule)
Enabled: |
void |
refElementOption(Token option,
Token value)
Enabled: |
void |
refExceptionHandler(Token exTypeAndName,
Token action)
Enabled: Add an exception handler to an exception spec |
void |
refInitAction(Token action)
Enabled: |
void |
refMemberAction(Token act)
Enabled: |
void |
refPreambleAction(Token act)
Enabled: |
void |
refReturnAction(Token returnAction)
Enabled: |
void |
refRule(Token idAssign,
Token r,
Token label,
Token args,
int autoGenType)
Enabled: |
void |
refSemPred(Token pred)
Enabled: |
void |
refStringLiteral(Token lit,
Token label,
int autoGenType,
boolean lastInRule)
Enabled: |
void |
refToken(Token idAssign,
Token t,
Token label,
Token args,
boolean inverted,
int autoGenType,
boolean lastInRule)
Enabled: |
void |
refTokenRange(Token t1,
Token t2,
Token label,
int autoGenType,
boolean lastInRule)
Enabled: |
void |
refTokensSpecElementOption(Token tok,
Token option,
Token value)
Enabled: |
void |
refTreeSpecifier(Token treeSpec)
Enabled: |
void |
refWildcard(Token t,
Token label,
int autoGenType)
Enabled: |
void |
reset()
Enabled: Get ready to process a new grammar |
void |
setArgOfRuleRef(Token argAction)
Enabled: |
static void |
setBlock(AlternativeBlock b,
AlternativeBlock src)
Enabled: |
void |
setRuleOption(Token key,
Token value)
Enabled: |
void |
setSubruleOption(Token key,
Token value)
Enabled: |
void |
setUserExceptions(String thr)
Enabled: |
void |
synPred()
Enabled: |
void |
zeroOrMoreSubRule()
Enabled: |
Methods inherited from class antlr.DefineGrammarSymbols |
_refStringLiteral, _refToken, defineToken, endOptions, getHeaderAction, noASTSubRule, refHeaderAction, setCharVocabulary, setFileOption, setGrammarOption, startLexer, startParser, startTreeWalker |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Stack blocks
protected RuleRefElement lastRuleRef
protected RuleEndElement ruleEnd
protected RuleBlock ruleBlock
protected int nested
protected boolean grammarError
ExceptionSpec currentExceptionSpec
Constructor Detail |
public MakeGrammar(Tool tool_, String[] args_, LLkAnalyzer analyzer_)
Method Detail |
public void abortGrammar()
abortGrammar
in interface ANTLRGrammarParseBehavior
abortGrammar
in class DefineGrammarSymbols
protected void addElementToCurrentAlt(AlternativeElement e)
public void beginAlt(boolean doAutoGen_)
beginAlt
in interface ANTLRGrammarParseBehavior
beginAlt
in class DefineGrammarSymbols
public void beginChildList()
beginChildList
in interface ANTLRGrammarParseBehavior
beginChildList
in class DefineGrammarSymbols
public void beginExceptionGroup()
beginExceptionGroup
in interface ANTLRGrammarParseBehavior
beginExceptionGroup
in class DefineGrammarSymbols
public void beginExceptionSpec(Token label)
beginExceptionSpec
in interface ANTLRGrammarParseBehavior
beginExceptionSpec
in class DefineGrammarSymbols
public void beginSubRule(Token label, int line, boolean not)
beginSubRule
in interface ANTLRGrammarParseBehavior
beginSubRule
in class DefineGrammarSymbols
public void beginTree(int line) throws SemanticException
beginTree
in interface ANTLRGrammarParseBehavior
beginTree
in class DefineGrammarSymbols
SemanticException
public BlockContext context()
public static RuleBlock createNextTokenRule(Grammar g, Vector lexRules, String rname)
g
- The Grammar that is being processedlexRules
- A vector of lexer rules that will be used to create an alternate block.rname
- The name of the resulting rule.private AlternativeBlock createOptionalRuleRef(String rule, int line)
public void defineRuleName(Token r, String access, boolean ruleAutoGen, String docComment) throws SemanticException
defineRuleName
in interface ANTLRGrammarParseBehavior
defineRuleName
in class DefineGrammarSymbols
SemanticException
public void endAlt()
endAlt
in interface ANTLRGrammarParseBehavior
endAlt
in class DefineGrammarSymbols
public void endChildList()
endChildList
in interface ANTLRGrammarParseBehavior
endChildList
in class DefineGrammarSymbols
public void endExceptionGroup()
endExceptionGroup
in interface ANTLRGrammarParseBehavior
endExceptionGroup
in class DefineGrammarSymbols
public void endExceptionSpec()
endExceptionSpec
in interface ANTLRGrammarParseBehavior
endExceptionSpec
in class DefineGrammarSymbols
public void endGrammar()
endGrammar
in interface ANTLRGrammarParseBehavior
endGrammar
in class DefineGrammarSymbols
public void endRule(String rule)
endRule
in interface ANTLRGrammarParseBehavior
endRule
in class DefineGrammarSymbols
public void endSubRule()
endSubRule
in interface ANTLRGrammarParseBehavior
endSubRule
in class DefineGrammarSymbols
public void endTree()
endTree
in interface ANTLRGrammarParseBehavior
endTree
in class DefineGrammarSymbols
public void hasError()
hasError
in interface ANTLRGrammarParseBehavior
hasError
in class DefineGrammarSymbols
private void labelElement(AlternativeElement el, Token label)
public void noAutoGenSubRule()
public void oneOrMoreSubRule()
oneOrMoreSubRule
in interface ANTLRGrammarParseBehavior
oneOrMoreSubRule
in class DefineGrammarSymbols
public void optionalSubRule()
optionalSubRule
in interface ANTLRGrammarParseBehavior
optionalSubRule
in class DefineGrammarSymbols
public void refAction(Token action)
refAction
in interface ANTLRGrammarParseBehavior
refAction
in class DefineGrammarSymbols
public void setUserExceptions(String thr)
setUserExceptions
in interface ANTLRGrammarParseBehavior
setUserExceptions
in class DefineGrammarSymbols
public void refArgAction(Token action)
refArgAction
in interface ANTLRGrammarParseBehavior
refArgAction
in class DefineGrammarSymbols
public void refCharLiteral(Token lit, Token label, boolean inverted, int autoGenType, boolean lastInRule)
refCharLiteral
in interface ANTLRGrammarParseBehavior
refCharLiteral
in class DefineGrammarSymbols
public void refCharRange(Token t1, Token t2, Token label, int autoGenType, boolean lastInRule)
refCharRange
in interface ANTLRGrammarParseBehavior
refCharRange
in class DefineGrammarSymbols
public void refTokensSpecElementOption(Token tok, Token option, Token value)
refTokensSpecElementOption
in interface ANTLRGrammarParseBehavior
refTokensSpecElementOption
in class DefineGrammarSymbols
public void refElementOption(Token option, Token value)
refElementOption
in interface ANTLRGrammarParseBehavior
refElementOption
in class DefineGrammarSymbols
public void refExceptionHandler(Token exTypeAndName, Token action)
refExceptionHandler
in interface ANTLRGrammarParseBehavior
refExceptionHandler
in class DefineGrammarSymbols
public void refInitAction(Token action)
refInitAction
in interface ANTLRGrammarParseBehavior
refInitAction
in class DefineGrammarSymbols
public void refMemberAction(Token act)
refMemberAction
in interface ANTLRGrammarParseBehavior
refMemberAction
in class DefineGrammarSymbols
public void refPreambleAction(Token act)
refPreambleAction
in interface ANTLRGrammarParseBehavior
refPreambleAction
in class DefineGrammarSymbols
public void refReturnAction(Token returnAction)
refReturnAction
in interface ANTLRGrammarParseBehavior
refReturnAction
in class DefineGrammarSymbols
public void refRule(Token idAssign, Token r, Token label, Token args, int autoGenType)
refRule
in interface ANTLRGrammarParseBehavior
refRule
in class DefineGrammarSymbols
public void refSemPred(Token pred)
refSemPred
in interface ANTLRGrammarParseBehavior
refSemPred
in class DefineGrammarSymbols
public void refStringLiteral(Token lit, Token label, int autoGenType, boolean lastInRule)
refStringLiteral
in interface ANTLRGrammarParseBehavior
refStringLiteral
in class DefineGrammarSymbols
public void refToken(Token idAssign, Token t, Token label, Token args, boolean inverted, int autoGenType, boolean lastInRule)
refToken
in interface ANTLRGrammarParseBehavior
refToken
in class DefineGrammarSymbols
public void refTokenRange(Token t1, Token t2, Token label, int autoGenType, boolean lastInRule)
refTokenRange
in interface ANTLRGrammarParseBehavior
refTokenRange
in class DefineGrammarSymbols
public void refTreeSpecifier(Token treeSpec)
refTreeSpecifier
in interface ANTLRGrammarParseBehavior
refTreeSpecifier
in class DefineGrammarSymbols
public void refWildcard(Token t, Token label, int autoGenType)
refWildcard
in interface ANTLRGrammarParseBehavior
refWildcard
in class DefineGrammarSymbols
public void reset()
reset
in class DefineGrammarSymbols
public void setArgOfRuleRef(Token argAction)
setArgOfRuleRef
in interface ANTLRGrammarParseBehavior
setArgOfRuleRef
in class DefineGrammarSymbols
public static void setBlock(AlternativeBlock b, AlternativeBlock src)
public void setRuleOption(Token key, Token value)
setRuleOption
in interface ANTLRGrammarParseBehavior
setRuleOption
in class DefineGrammarSymbols
public void setSubruleOption(Token key, Token value)
setSubruleOption
in interface ANTLRGrammarParseBehavior
setSubruleOption
in class DefineGrammarSymbols
public void synPred()
synPred
in interface ANTLRGrammarParseBehavior
synPred
in class DefineGrammarSymbols
public void zeroOrMoreSubRule()
zeroOrMoreSubRule
in interface ANTLRGrammarParseBehavior
zeroOrMoreSubRule
in class DefineGrammarSymbols
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |