Package org.antlr.grammar.v3
Class ANTLRParser.grammar_Adaptor
- java.lang.Object
-
- org.antlr.runtime.tree.BaseTreeAdaptor
-
- org.antlr.runtime.tree.CommonTreeAdaptor
-
- org.antlr.grammar.v3.ANTLRParser.grammar_Adaptor
-
- All Implemented Interfaces:
TreeAdaptor
- Enclosing class:
- ANTLRParser
static class ANTLRParser.grammar_Adaptor extends CommonTreeAdaptor
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ANTLRParser
_outer
-
Fields inherited from class org.antlr.runtime.tree.BaseTreeAdaptor
treeToUniqueIDMap, uniqueNodeID
-
-
Constructor Summary
Constructors Constructor Description grammar_Adaptor(ANTLRParser outer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
create(Token payload)
Create a tree node from Token object; for CommonTree type trees, then the token just becomes the payload.java.lang.Object
errorNode(TokenStream input, Token start, Token stop, RecognitionException e)
create tree node that holds the start and stop tokens associated with an error.-
Methods inherited from class org.antlr.runtime.tree.CommonTreeAdaptor
createToken, createToken, dupNode, getChild, getChildCount, getChildIndex, getParent, getText, getToken, getTokenStartIndex, getTokenStopIndex, getType, replaceChildren, setChildIndex, setParent, setTokenBoundaries
-
Methods inherited from class org.antlr.runtime.tree.BaseTreeAdaptor
addChild, becomeRoot, becomeRoot, create, create, create, deleteChild, dupTree, dupTree, getUniqueID, isNil, nil, rulePostProcessing, setChild, setText, setType
-
-
-
-
Field Detail
-
_outer
ANTLRParser _outer
-
-
Constructor Detail
-
grammar_Adaptor
public grammar_Adaptor(ANTLRParser outer)
-
-
Method Detail
-
create
public java.lang.Object create(Token payload)
Description copied from interface:TreeAdaptor
Create a tree node from Token object; for CommonTree type trees, then the token just becomes the payload. This is the most common create call. Override if you want another kind of node to be built.- Specified by:
create
in interfaceTreeAdaptor
- Overrides:
create
in classCommonTreeAdaptor
-
errorNode
public java.lang.Object errorNode(TokenStream input, Token start, Token stop, RecognitionException e)
Description copied from class:BaseTreeAdaptor
create tree node that holds the start and stop tokens associated with an error. If you specify your own kind of tree nodes, you will likely have to override this method. CommonTree returns Token.INVALID_TOKEN_TYPE if no token payload but you might have to set token type for diff node type. You don't have to subclass CommonErrorNode; you will likely need to subclass your own tree node class to avoid class cast exception.- Specified by:
errorNode
in interfaceTreeAdaptor
- Overrides:
errorNode
in classBaseTreeAdaptor
-
-