public class MakeGrammar extends DefineGrammarSymbols
| Modifier and Type | Field and Description |
|---|---|
protected Stack |
blocks |
protected boolean |
grammarError |
protected antlr.RuleRefElement |
lastRuleRef |
protected int |
nested |
protected RuleBlock |
ruleBlock |
protected antlr.RuleEndElement |
ruleEnd |
grammar, grammars, headerActions, numLexers, numParsers, numTreeParsers, tokenManagers, tool| Constructor and Description |
|---|
MakeGrammar(Tool tool_,
String[] args_,
LLkAnalyzer analyzer_) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortGrammar()
Abort the processing of a grammar (due to syntax errors)
|
protected void |
addElementToCurrentAlt(antlr.AlternativeElement e) |
void |
beginAlt(boolean doAutoGen_) |
void |
beginChildList() |
void |
beginExceptionGroup()
Add an exception group to a rule (currently a no-op)
|
void |
beginExceptionSpec(Token label)
Add an exception spec to an exception group or rule block
|
void |
beginSubRule(Token label,
Token start,
boolean not) |
void |
beginTree(Token tok) |
antlr.BlockContext |
context() |
static RuleBlock |
createNextTokenRule(Grammar g,
Vector lexRules,
String rname)
Used to build nextToken() for the lexer.
|
void |
defineRuleName(Token r,
String access,
boolean ruleAutoGen,
String docComment)
Define a lexer or parser rule
|
void |
endAlt() |
void |
endChildList() |
void |
endExceptionGroup() |
void |
endExceptionSpec() |
void |
endGrammar()
Called at the end of processing a grammar
|
void |
endRule(String rule) |
void |
endSubRule() |
void |
endTree() |
void |
hasError()
Remember that a major error occured in the grammar
|
void |
noAutoGenSubRule() |
void |
oneOrMoreSubRule() |
void |
optionalSubRule() |
void |
refAction(Token action) |
void |
refArgAction(Token action) |
void |
refCharLiteral(Token lit,
Token label,
boolean inverted,
int autoGenType,
boolean lastInRule) |
void |
refCharRange(Token t1,
Token t2,
Token label,
int autoGenType,
boolean lastInRule) |
void |
refElementOption(Token option,
Token value) |
void |
refExceptionHandler(Token exTypeAndName,
Token action)
Add an exception handler to an exception spec
|
void |
refInitAction(Token action) |
void |
refMemberAction(Token act) |
void |
refPreambleAction(Token act) |
void |
refReturnAction(Token returnAction) |
void |
refRule(Token idAssign,
Token r,
Token label,
Token args,
int autoGenType) |
void |
refSemPred(Token pred) |
void |
refStringLiteral(Token lit,
Token label,
int autoGenType,
boolean lastInRule) |
void |
refToken(Token idAssign,
Token t,
Token label,
Token args,
boolean inverted,
int autoGenType,
boolean lastInRule)
Reference a token
|
void |
refTokenRange(Token t1,
Token t2,
Token label,
int autoGenType,
boolean lastInRule) |
void |
refTokensSpecElementOption(Token tok,
Token option,
Token value) |
void |
refTreeSpecifier(Token treeSpec) |
void |
refWildcard(Token t,
Token label,
int autoGenType) |
void |
reset()
Get ready to process a new grammar
|
void |
setArgOfRuleRef(Token argAction) |
static void |
setBlock(antlr.AlternativeBlock b,
antlr.AlternativeBlock src) |
void |
setRuleOption(Token key,
Token value) |
void |
setSubruleOption(Token key,
Token value) |
void |
setUserExceptions(String thr) |
void |
synPred() |
void |
zeroOrMoreSubRule() |
_refStringLiteral, _refToken, defineToken, endOptions, getHeaderAction, getHeaderActionLine, noASTSubRule, refHeaderAction, setCharVocabulary, setFileOption, setGrammarOption, startLexer, startParser, startTreeWalkerprotected Stack blocks
protected antlr.RuleRefElement lastRuleRef
protected antlr.RuleEndElement ruleEnd
protected RuleBlock ruleBlock
protected int nested
protected boolean grammarError
public MakeGrammar(Tool tool_, String[] args_, LLkAnalyzer analyzer_)
public void abortGrammar()
abortGrammar in interface ANTLRGrammarParseBehaviorabortGrammar in class DefineGrammarSymbolsprotected void addElementToCurrentAlt(antlr.AlternativeElement e)
public void beginAlt(boolean doAutoGen_)
beginAlt in interface ANTLRGrammarParseBehaviorbeginAlt in class DefineGrammarSymbolspublic void beginChildList()
beginChildList in interface ANTLRGrammarParseBehaviorbeginChildList in class DefineGrammarSymbolspublic void beginExceptionGroup()
beginExceptionGroup in interface ANTLRGrammarParseBehaviorbeginExceptionGroup in class DefineGrammarSymbolspublic void beginExceptionSpec(Token label)
beginExceptionSpec in interface ANTLRGrammarParseBehaviorbeginExceptionSpec in class DefineGrammarSymbolspublic void beginSubRule(Token label, Token start, boolean not)
beginSubRule in interface ANTLRGrammarParseBehaviorbeginSubRule in class DefineGrammarSymbolspublic void beginTree(Token tok) throws SemanticException
beginTree in interface ANTLRGrammarParseBehaviorbeginTree in class DefineGrammarSymbolsSemanticExceptionpublic antlr.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.public void defineRuleName(Token r, String access, boolean ruleAutoGen, String docComment) throws SemanticException
DefineGrammarSymbolsdefineRuleName in interface ANTLRGrammarParseBehaviordefineRuleName in class DefineGrammarSymbolsSemanticExceptionpublic void endAlt()
endAlt in interface ANTLRGrammarParseBehaviorendAlt in class DefineGrammarSymbolspublic void endChildList()
endChildList in interface ANTLRGrammarParseBehaviorendChildList in class DefineGrammarSymbolspublic void endExceptionGroup()
endExceptionGroup in interface ANTLRGrammarParseBehaviorendExceptionGroup in class DefineGrammarSymbolspublic void endExceptionSpec()
endExceptionSpec in interface ANTLRGrammarParseBehaviorendExceptionSpec in class DefineGrammarSymbolspublic void endGrammar()
endGrammar in interface ANTLRGrammarParseBehaviorendGrammar in class DefineGrammarSymbolspublic void endRule(String rule)
endRule in interface ANTLRGrammarParseBehaviorendRule in class DefineGrammarSymbolspublic void endSubRule()
endSubRule in interface ANTLRGrammarParseBehaviorendSubRule in class DefineGrammarSymbolspublic void endTree()
endTree in interface ANTLRGrammarParseBehaviorendTree in class DefineGrammarSymbolspublic void hasError()
hasError in interface ANTLRGrammarParseBehaviorhasError in class DefineGrammarSymbolspublic void noAutoGenSubRule()
public void oneOrMoreSubRule()
oneOrMoreSubRule in interface ANTLRGrammarParseBehavioroneOrMoreSubRule in class DefineGrammarSymbolspublic void optionalSubRule()
optionalSubRule in interface ANTLRGrammarParseBehavioroptionalSubRule in class DefineGrammarSymbolspublic void refAction(Token action)
refAction in interface ANTLRGrammarParseBehaviorrefAction in class DefineGrammarSymbolspublic void setUserExceptions(String thr)
setUserExceptions in interface ANTLRGrammarParseBehaviorsetUserExceptions in class DefineGrammarSymbolspublic void refArgAction(Token action)
refArgAction in interface ANTLRGrammarParseBehaviorrefArgAction in class DefineGrammarSymbolspublic void refCharLiteral(Token lit, Token label, boolean inverted, int autoGenType, boolean lastInRule)
refCharLiteral in interface ANTLRGrammarParseBehaviorrefCharLiteral in class DefineGrammarSymbolspublic void refCharRange(Token t1, Token t2, Token label, int autoGenType, boolean lastInRule)
refCharRange in interface ANTLRGrammarParseBehaviorrefCharRange in class DefineGrammarSymbolspublic void refTokensSpecElementOption(Token tok, Token option, Token value)
refTokensSpecElementOption in interface ANTLRGrammarParseBehaviorrefTokensSpecElementOption in class DefineGrammarSymbolspublic void refElementOption(Token option, Token value)
refElementOption in interface ANTLRGrammarParseBehaviorrefElementOption in class DefineGrammarSymbolspublic void refExceptionHandler(Token exTypeAndName, Token action)
refExceptionHandler in interface ANTLRGrammarParseBehaviorrefExceptionHandler in class DefineGrammarSymbolspublic void refInitAction(Token action)
refInitAction in interface ANTLRGrammarParseBehaviorrefInitAction in class DefineGrammarSymbolspublic void refMemberAction(Token act)
refMemberAction in interface ANTLRGrammarParseBehaviorrefMemberAction in class DefineGrammarSymbolspublic void refPreambleAction(Token act)
refPreambleAction in interface ANTLRGrammarParseBehaviorrefPreambleAction in class DefineGrammarSymbolspublic void refReturnAction(Token returnAction)
refReturnAction in interface ANTLRGrammarParseBehaviorrefReturnAction in class DefineGrammarSymbolspublic void refRule(Token idAssign, Token r, Token label, Token args, int autoGenType)
refRule in interface ANTLRGrammarParseBehaviorrefRule in class DefineGrammarSymbolspublic void refSemPred(Token pred)
refSemPred in interface ANTLRGrammarParseBehaviorrefSemPred in class DefineGrammarSymbolspublic void refStringLiteral(Token lit, Token label, int autoGenType, boolean lastInRule)
refStringLiteral in interface ANTLRGrammarParseBehaviorrefStringLiteral in class DefineGrammarSymbolspublic void refToken(Token idAssign, Token t, Token label, Token args, boolean inverted, int autoGenType, boolean lastInRule)
DefineGrammarSymbolsrefToken in interface ANTLRGrammarParseBehaviorrefToken in class DefineGrammarSymbolspublic void refTokenRange(Token t1, Token t2, Token label, int autoGenType, boolean lastInRule)
refTokenRange in interface ANTLRGrammarParseBehaviorrefTokenRange in class DefineGrammarSymbolspublic void refTreeSpecifier(Token treeSpec)
refTreeSpecifier in interface ANTLRGrammarParseBehaviorrefTreeSpecifier in class DefineGrammarSymbolspublic void refWildcard(Token t, Token label, int autoGenType)
refWildcard in interface ANTLRGrammarParseBehaviorrefWildcard in class DefineGrammarSymbolspublic void reset()
reset in class DefineGrammarSymbolspublic void setArgOfRuleRef(Token argAction)
setArgOfRuleRef in interface ANTLRGrammarParseBehaviorsetArgOfRuleRef in class DefineGrammarSymbolspublic static void setBlock(antlr.AlternativeBlock b,
antlr.AlternativeBlock src)
public void setRuleOption(Token key, Token value)
setRuleOption in interface ANTLRGrammarParseBehaviorsetRuleOption in class DefineGrammarSymbolspublic void setSubruleOption(Token key, Token value)
setSubruleOption in interface ANTLRGrammarParseBehaviorsetSubruleOption in class DefineGrammarSymbolspublic void synPred()
synPred in interface ANTLRGrammarParseBehaviorsynPred in class DefineGrammarSymbolspublic void zeroOrMoreSubRule()
zeroOrMoreSubRule in interface ANTLRGrammarParseBehaviorzeroOrMoreSubRule in class DefineGrammarSymbolsCopyright © 2017–2019 Eclipse Foundation. All rights reserved.