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
-
Field Summary
FieldsFields inherited from class org.antlr.runtime.tree.BaseTreeAdaptor
treeToUniqueIDMap, uniqueNodeID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a tree node from Token object; for CommonTree type trees, then the token just becomes the payload.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 Details
-
_outer
ANTLRParser _outer
-
-
Constructor Details
-
grammar_Adaptor
-
-
Method Details
-
create
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
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
-