antlr
public class MakeGrammar extends DefineGrammarSymbols
| Field Summary | |
|---|---|
| protected Stack | blocks |
| ExceptionSpec | currentExceptionSpec |
| protected boolean | grammarError |
| protected RuleRefElement | lastRuleRef |
| protected int | nested |
| protected RuleBlock | ruleBlock |
| protected RuleEndElement | ruleEnd |
| Constructor Summary | |
|---|---|
| MakeGrammar(Tool tool_, String[] args_, LLkAnalyzer analyzer_) | |
| Method Summary | |
|---|---|
| void | abortGrammar() Abort the processing of a grammar (due to syntax errors) |
| protected void | addElementToCurrentAlt(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) |
| 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) |
| 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) |
| 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(AlternativeBlock b, AlternativeBlock src) |
| void | setRuleOption(Token key, Token value) |
| void | setSubruleOption(Token key, Token value) |
| void | setUserExceptions(String thr) |
| void | synPred() |
| void | zeroOrMoreSubRule() |
Parameters: g The Grammar that is being processed lexRules A vector of lexer rules that will be used to create an alternate block. rname The name of the resulting rule.