Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
antlr.DefineGrammarSymbols
antlr.MakeGrammar
public class MakeGrammar
extends DefineGrammarSymbols
Field Summary | |
protected Stack | |
(package private) ExceptionSpec | |
protected boolean | |
protected RuleRefElement | |
protected int | |
protected RuleBlock | |
protected RuleEndElement |
Fields inherited from class antlr.DefineGrammarSymbols | |
DEFAULT_TOKENMANAGER_NAME , analyzer , args , grammar , grammars , headerActions , language , numLexers , numParsers , numTreeParsers , thePreambleAction , tokenManagers , tool |
Constructor Summary | |
|
Method Summary | |
void |
|
protected void | |
void |
|
void | |
void |
|
void |
|
void |
|
void | |
BlockContext |
|
static RuleBlock |
|
void |
|
void |
|
void | |
void | |
void | |
void |
|
void |
|
void | |
void |
|
void |
|
void | |
void | |
void | |
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
static void |
|
void |
|
void |
|
void |
|
void |
|
void |
public void abortGrammar()
Abort the processing of a grammar (due to syntax errors)
- Specified by:
- abortGrammar in interface ANTLRGrammarParseBehavior
- Overrides:
- abortGrammar in interface DefineGrammarSymbols
public void beginAlt(boolean doAutoGen_)
- Specified by:
- beginAlt in interface ANTLRGrammarParseBehavior
- Overrides:
- beginAlt in interface DefineGrammarSymbols
public void beginChildList()
- Specified by:
- beginChildList in interface ANTLRGrammarParseBehavior
- Overrides:
- beginChildList in interface DefineGrammarSymbols
public void beginExceptionGroup()
Add an exception group to a rule (currently a no-op)
- Specified by:
- beginExceptionGroup in interface ANTLRGrammarParseBehavior
- Overrides:
- beginExceptionGroup in interface DefineGrammarSymbols
public void beginExceptionSpec(Token label)
Add an exception spec to an exception group or rule block
- Specified by:
- beginExceptionSpec in interface ANTLRGrammarParseBehavior
- Overrides:
- beginExceptionSpec in interface DefineGrammarSymbols
public void beginSubRule(Token label, Token start, boolean not)
- Specified by:
- beginSubRule in interface ANTLRGrammarParseBehavior
- Overrides:
- beginSubRule in interface DefineGrammarSymbols
public void beginTree(Token tok) throws SemanticException
- Specified by:
- beginTree in interface ANTLRGrammarParseBehavior
- Overrides:
- beginTree in interface DefineGrammarSymbols
public static RuleBlock createNextTokenRule(Grammar g, Vector lexRules, String rname)
Used to build nextToken() for the lexer. This builds a rule which has every "public" rule in the given Vector of rules as it's alternate. Each rule ref generates a Token object.
- Parameters:
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
Define a lexer or parser rule
- Specified by:
- defineRuleName in interface ANTLRGrammarParseBehavior
- Overrides:
- defineRuleName in interface DefineGrammarSymbols
public void endAlt()
- Specified by:
- endAlt in interface ANTLRGrammarParseBehavior
- Overrides:
- endAlt in interface DefineGrammarSymbols
public void endChildList()
- Specified by:
- endChildList in interface ANTLRGrammarParseBehavior
- Overrides:
- endChildList in interface DefineGrammarSymbols
public void endExceptionGroup()
- Specified by:
- endExceptionGroup in interface ANTLRGrammarParseBehavior
- Overrides:
- endExceptionGroup in interface DefineGrammarSymbols
public void endExceptionSpec()
- Specified by:
- endExceptionSpec in interface ANTLRGrammarParseBehavior
- Overrides:
- endExceptionSpec in interface DefineGrammarSymbols
public void endGrammar()
Called at the end of processing a grammar
- Specified by:
- endGrammar in interface ANTLRGrammarParseBehavior
- Overrides:
- endGrammar in interface DefineGrammarSymbols
public void endRule(String rule)
- Specified by:
- endRule in interface ANTLRGrammarParseBehavior
- Overrides:
- endRule in interface DefineGrammarSymbols
public void endSubRule()
- Specified by:
- endSubRule in interface ANTLRGrammarParseBehavior
- Overrides:
- endSubRule in interface DefineGrammarSymbols
public void endTree()
- Specified by:
- endTree in interface ANTLRGrammarParseBehavior
- Overrides:
- endTree in interface DefineGrammarSymbols
public void hasError()
Remember that a major error occured in the grammar
- Specified by:
- hasError in interface ANTLRGrammarParseBehavior
- Overrides:
- hasError in interface DefineGrammarSymbols
public void noAutoGenSubRule()
public void oneOrMoreSubRule()
- Specified by:
- oneOrMoreSubRule in interface ANTLRGrammarParseBehavior
- Overrides:
- oneOrMoreSubRule in interface DefineGrammarSymbols
public void optionalSubRule()
- Specified by:
- optionalSubRule in interface ANTLRGrammarParseBehavior
- Overrides:
- optionalSubRule in interface DefineGrammarSymbols
public void refAction(Token action)
- Specified by:
- refAction in interface ANTLRGrammarParseBehavior
- Overrides:
- refAction in interface DefineGrammarSymbols
public void refArgAction(Token action)
- Specified by:
- refArgAction in interface ANTLRGrammarParseBehavior
- Overrides:
- refArgAction in interface DefineGrammarSymbols
public void refCharLiteral(Token lit, Token label, boolean inverted, int autoGenType, boolean lastInRule)
- Specified by:
- refCharLiteral in interface ANTLRGrammarParseBehavior
- Overrides:
- refCharLiteral in interface DefineGrammarSymbols
public void refCharRange(Token t1, Token t2, Token label, int autoGenType, boolean lastInRule)
- Specified by:
- refCharRange in interface ANTLRGrammarParseBehavior
- Overrides:
- refCharRange in interface DefineGrammarSymbols
public void refElementOption(Token option, Token value)
- Specified by:
- refElementOption in interface ANTLRGrammarParseBehavior
- Overrides:
- refElementOption in interface DefineGrammarSymbols
public void refExceptionHandler(Token exTypeAndName, Token action)
Add an exception handler to an exception spec
- Specified by:
- refExceptionHandler in interface ANTLRGrammarParseBehavior
- Overrides:
- refExceptionHandler in interface DefineGrammarSymbols
public void refInitAction(Token action)
- Specified by:
- refInitAction in interface ANTLRGrammarParseBehavior
- Overrides:
- refInitAction in interface DefineGrammarSymbols
public void refMemberAction(Token act)
- Specified by:
- refMemberAction in interface ANTLRGrammarParseBehavior
- Overrides:
- refMemberAction in interface DefineGrammarSymbols
public void refPreambleAction(Token act)
- Specified by:
- refPreambleAction in interface ANTLRGrammarParseBehavior
- Overrides:
- refPreambleAction in interface DefineGrammarSymbols
public void refReturnAction(Token returnAction)
- Specified by:
- refReturnAction in interface ANTLRGrammarParseBehavior
- Overrides:
- refReturnAction in interface DefineGrammarSymbols
public void refRule(Token idAssign, Token r, Token label, Token args, int autoGenType)
- Specified by:
- refRule in interface ANTLRGrammarParseBehavior
- Overrides:
- refRule in interface DefineGrammarSymbols
public void refSemPred(Token pred)
- Specified by:
- refSemPred in interface ANTLRGrammarParseBehavior
- Overrides:
- refSemPred in interface DefineGrammarSymbols
public void refStringLiteral(Token lit, Token label, int autoGenType, boolean lastInRule)
- Specified by:
- refStringLiteral in interface ANTLRGrammarParseBehavior
- Overrides:
- refStringLiteral in interface DefineGrammarSymbols
public void refToken(Token idAssign, Token t, Token label, Token args, boolean inverted, int autoGenType, boolean lastInRule)
Reference a token
- Specified by:
- refToken in interface ANTLRGrammarParseBehavior
- Overrides:
- refToken in interface DefineGrammarSymbols
public void refTokenRange(Token t1, Token t2, Token label, int autoGenType, boolean lastInRule)
- Specified by:
- refTokenRange in interface ANTLRGrammarParseBehavior
- Overrides:
- refTokenRange in interface DefineGrammarSymbols
public void refTokensSpecElementOption(Token tok, Token option, Token value)
- Specified by:
- refTokensSpecElementOption in interface ANTLRGrammarParseBehavior
- Overrides:
- refTokensSpecElementOption in interface DefineGrammarSymbols
public void refTreeSpecifier(Token treeSpec)
- Specified by:
- refTreeSpecifier in interface ANTLRGrammarParseBehavior
- Overrides:
- refTreeSpecifier in interface DefineGrammarSymbols
public void refWildcard(Token t, Token label, int autoGenType)
- Specified by:
- refWildcard in interface ANTLRGrammarParseBehavior
- Overrides:
- refWildcard in interface DefineGrammarSymbols
public void reset()
Get ready to process a new grammar
- Overrides:
- reset in interface DefineGrammarSymbols
public void setArgOfRuleRef(Token argAction)
- Specified by:
- setArgOfRuleRef in interface ANTLRGrammarParseBehavior
- Overrides:
- setArgOfRuleRef in interface DefineGrammarSymbols
public void setRuleOption(Token key, Token value)
- Specified by:
- setRuleOption in interface ANTLRGrammarParseBehavior
- Overrides:
- setRuleOption in interface DefineGrammarSymbols
public void setSubruleOption(Token key, Token value)
- Specified by:
- setSubruleOption in interface ANTLRGrammarParseBehavior
- Overrides:
- setSubruleOption in interface DefineGrammarSymbols
public void setUserExceptions(String thr)
- Specified by:
- setUserExceptions in interface ANTLRGrammarParseBehavior
- Overrides:
- setUserExceptions in interface DefineGrammarSymbols
public void synPred()
- Specified by:
- synPred in interface ANTLRGrammarParseBehavior
- Overrides:
- synPred in interface DefineGrammarSymbols
public void zeroOrMoreSubRule()
- Specified by:
- zeroOrMoreSubRule in interface ANTLRGrammarParseBehavior
- Overrides:
- zeroOrMoreSubRule in interface DefineGrammarSymbols