|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antlr.DefineGrammarSymbols
Untamed: DefineGrammarSymbols is a behavior for the ANTLRParser that adds all the token and rule symbols to the grammar symbol table. Token types are assigned to token symbols in this class also. The token type for a token is done in the order seen (lexically).
Field Summary | |
(package private) LLkAnalyzer |
analyzer
|
(package private) String[] |
args
|
(package private) static String |
DEFAULT_TOKENMANAGER_NAME
|
protected Grammar |
grammar
|
protected Hashtable |
grammars
|
protected Hashtable |
headerActions
|
(package private) String |
language
|
protected int |
numLexers
|
protected int |
numParsers
|
protected int |
numTreeParsers
|
(package private) Token |
thePreambleAction
|
protected Hashtable |
tokenManagers
|
protected Tool |
tool
|
Constructor Summary | |
DefineGrammarSymbols(Tool tool_,
String[] args_,
LLkAnalyzer analyzer_)
Enabled: |
Method Summary | |
void |
_refStringLiteral(Token lit,
Token label,
int autoGenType,
boolean lastInRule)
Enabled: |
void |
_refToken(Token assignId,
Token t,
Token label,
Token args,
boolean inverted,
int autoGenType,
boolean lastInRule)
Enabled: Reference a token |
void |
abortGrammar()
Enabled: Abort the processing of a grammar due to syntax errors |
void |
beginAlt(boolean doAST_)
Enabled: |
void |
beginChildList()
Enabled: |
void |
beginExceptionGroup()
Enabled: |
void |
beginExceptionSpec(Token label)
Enabled: |
void |
beginSubRule(Token label,
int line,
boolean not)
Enabled: |
void |
beginTree(int line)
Enabled: |
void |
defineRuleName(Token r,
String access,
boolean ruleAutoGen,
String docComment)
Enabled: Define a lexer or parser rule |
void |
defineToken(Token tokname,
Token tokliteral)
Enabled: Define a token from tokens {...}. |
void |
endAlt()
Enabled: |
void |
endChildList()
Enabled: |
void |
endExceptionGroup()
Enabled: |
void |
endExceptionSpec()
Enabled: |
void |
endGrammar()
Enabled: |
void |
endOptions()
Enabled: Called after the optional options section, to compensate for options that may not have been set. |
void |
endRule(String r)
Enabled: |
void |
endSubRule()
Enabled: |
void |
endTree()
Enabled: |
String |
getHeaderAction(String name)
Enabled: |
void |
hasError()
Enabled: |
void |
noASTSubRule()
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: |
void |
refHeaderAction(Token name,
Token act)
Enabled: |
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 assignId,
Token t,
Token label,
Token args,
boolean inverted,
int autoGenType,
boolean lastInRule)
Enabled: Reference a token |
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: |
void |
setCharVocabulary(BitSet b)
Enabled: Set the character vocabulary for a lexer |
void |
setFileOption(Token key,
Token value,
String filename)
Enabled: setFileOption: Associate an option value with a key. |
void |
setGrammarOption(Token key,
Token value)
Enabled: setGrammarOption: Associate an option value with a key. |
void |
setRuleOption(Token key,
Token value)
Enabled: |
void |
setSubruleOption(Token key,
Token value)
Enabled: |
void |
setUserExceptions(String thr)
Enabled: |
void |
startLexer(String file,
Token name,
String superClass,
String doc)
Enabled: Start a new lexer |
void |
startParser(String file,
Token name,
String superClass,
String doc)
Enabled: Start a new parser |
void |
startTreeWalker(String file,
Token name,
String superClass,
String doc)
Enabled: Start a new tree-walker |
void |
synPred()
Enabled: |
void |
zeroOrMoreSubRule()
Enabled: |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Hashtable grammars
protected Hashtable tokenManagers
protected Grammar grammar
protected Tool tool
LLkAnalyzer analyzer
String[] args
static final String DEFAULT_TOKENMANAGER_NAME
protected Hashtable headerActions
Token thePreambleAction
String language
protected int numLexers
protected int numParsers
protected int numTreeParsers
Constructor Detail |
public DefineGrammarSymbols(Tool tool_, String[] args_, LLkAnalyzer analyzer_)
Method Detail |
public void _refStringLiteral(Token lit, Token label, int autoGenType, boolean lastInRule)
public void _refToken(Token assignId, Token t, Token label, Token args, boolean inverted, int autoGenType, boolean lastInRule)
public void abortGrammar()
abortGrammar
in interface ANTLRGrammarParseBehavior
public void beginAlt(boolean doAST_)
beginAlt
in interface ANTLRGrammarParseBehavior
public void beginChildList()
beginChildList
in interface ANTLRGrammarParseBehavior
public void beginExceptionGroup()
beginExceptionGroup
in interface ANTLRGrammarParseBehavior
public void beginExceptionSpec(Token label)
beginExceptionSpec
in interface ANTLRGrammarParseBehavior
public void beginSubRule(Token label, int line, boolean not)
beginSubRule
in interface ANTLRGrammarParseBehavior
public void beginTree(int line) throws SemanticException
beginTree
in interface ANTLRGrammarParseBehavior
SemanticException
public void defineRuleName(Token r, String access, boolean ruleAutoGen, String docComment) throws SemanticException
defineRuleName
in interface ANTLRGrammarParseBehavior
SemanticException
public void defineToken(Token tokname, Token tokliteral)
defineToken
in interface ANTLRGrammarParseBehavior
public void endAlt()
endAlt
in interface ANTLRGrammarParseBehavior
public void endChildList()
endChildList
in interface ANTLRGrammarParseBehavior
public void endExceptionGroup()
endExceptionGroup
in interface ANTLRGrammarParseBehavior
public void endExceptionSpec()
endExceptionSpec
in interface ANTLRGrammarParseBehavior
public void endGrammar()
endGrammar
in interface ANTLRGrammarParseBehavior
public void endOptions()
endOptions
in interface ANTLRGrammarParseBehavior
public void endRule(String r)
endRule
in interface ANTLRGrammarParseBehavior
public void endSubRule()
endSubRule
in interface ANTLRGrammarParseBehavior
public void endTree()
endTree
in interface ANTLRGrammarParseBehavior
public void hasError()
hasError
in interface ANTLRGrammarParseBehavior
public void noASTSubRule()
noASTSubRule
in interface ANTLRGrammarParseBehavior
public void oneOrMoreSubRule()
oneOrMoreSubRule
in interface ANTLRGrammarParseBehavior
public void optionalSubRule()
optionalSubRule
in interface ANTLRGrammarParseBehavior
public void setUserExceptions(String thr)
setUserExceptions
in interface ANTLRGrammarParseBehavior
public void refAction(Token action)
refAction
in interface ANTLRGrammarParseBehavior
public void refArgAction(Token action)
refArgAction
in interface ANTLRGrammarParseBehavior
public void refCharLiteral(Token lit, Token label, boolean inverted, int autoGenType, boolean lastInRule)
refCharLiteral
in interface ANTLRGrammarParseBehavior
public void refCharRange(Token t1, Token t2, Token label, int autoGenType, boolean lastInRule)
refCharRange
in interface ANTLRGrammarParseBehavior
public void refElementOption(Token option, Token value)
refElementOption
in interface ANTLRGrammarParseBehavior
public void refTokensSpecElementOption(Token tok, Token option, Token value)
refTokensSpecElementOption
in interface ANTLRGrammarParseBehavior
public void refExceptionHandler(Token exTypeAndName, Token action)
refExceptionHandler
in interface ANTLRGrammarParseBehavior
public void refHeaderAction(Token name, Token act)
refHeaderAction
in interface ANTLRGrammarParseBehavior
public String getHeaderAction(String name)
public void refInitAction(Token action)
refInitAction
in interface ANTLRGrammarParseBehavior
public void refMemberAction(Token act)
refMemberAction
in interface ANTLRGrammarParseBehavior
public void refPreambleAction(Token act)
refPreambleAction
in interface ANTLRGrammarParseBehavior
public void refReturnAction(Token returnAction)
refReturnAction
in interface ANTLRGrammarParseBehavior
public void refRule(Token idAssign, Token r, Token label, Token args, int autoGenType)
refRule
in interface ANTLRGrammarParseBehavior
public void refSemPred(Token pred)
refSemPred
in interface ANTLRGrammarParseBehavior
public void refStringLiteral(Token lit, Token label, int autoGenType, boolean lastInRule)
refStringLiteral
in interface ANTLRGrammarParseBehavior
public void refToken(Token assignId, Token t, Token label, Token args, boolean inverted, int autoGenType, boolean lastInRule)
refToken
in interface ANTLRGrammarParseBehavior
public void refTokenRange(Token t1, Token t2, Token label, int autoGenType, boolean lastInRule)
refTokenRange
in interface ANTLRGrammarParseBehavior
public void refTreeSpecifier(Token treeSpec)
refTreeSpecifier
in interface ANTLRGrammarParseBehavior
public void refWildcard(Token t, Token label, int autoGenType)
refWildcard
in interface ANTLRGrammarParseBehavior
public void reset()
public void setArgOfRuleRef(Token argaction)
setArgOfRuleRef
in interface ANTLRGrammarParseBehavior
public void setCharVocabulary(BitSet b)
setCharVocabulary
in interface ANTLRGrammarParseBehavior
public void setFileOption(Token key, Token value, String filename)
setFileOption
in interface ANTLRGrammarParseBehavior
key
- The token containing the option namevalue
- The token containing the option value.public void setGrammarOption(Token key, Token value)
setGrammarOption
in interface ANTLRGrammarParseBehavior
key
- The token containing the option namevalue
- The token containing the option value.public void setRuleOption(Token key, Token value)
setRuleOption
in interface ANTLRGrammarParseBehavior
public void setSubruleOption(Token key, Token value)
setSubruleOption
in interface ANTLRGrammarParseBehavior
public void startLexer(String file, Token name, String superClass, String doc)
startLexer
in interface ANTLRGrammarParseBehavior
public void startParser(String file, Token name, String superClass, String doc)
startParser
in interface ANTLRGrammarParseBehavior
public void startTreeWalker(String file, Token name, String superClass, String doc)
startTreeWalker
in interface ANTLRGrammarParseBehavior
public void synPred()
synPred
in interface ANTLRGrammarParseBehavior
public void zeroOrMoreSubRule()
zeroOrMoreSubRule
in interface ANTLRGrammarParseBehavior
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |