Package org.antlr.runtime.tree
Class TreeRewriter
- java.lang.Object
-
- org.antlr.runtime.BaseRecognizer
-
- org.antlr.runtime.tree.TreeParser
-
- org.antlr.runtime.tree.TreeRewriter
-
public class TreeRewriter extends TreeParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TreeRewriter.fptr
-
Field Summary
Fields Modifier and Type Field Description protected TreeAdaptor
originalAdaptor
protected TokenStream
originalTokenStream
protected boolean
showTransformations
-
Fields inherited from class org.antlr.runtime.tree.TreeParser
DOWN, input, UP
-
Fields inherited from class org.antlr.runtime.BaseRecognizer
DEFAULT_TOKEN_CHANNEL, HIDDEN, INITIAL_FOLLOW_STACK_SIZE, MEMO_RULE_FAILED, MEMO_RULE_UNKNOWN, NEXT_TOKEN_RULE_NAME, state
-
-
Constructor Summary
Constructors Constructor Description TreeRewriter(TreeNodeStream input)
TreeRewriter(TreeNodeStream input, RecognizerSharedState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
applyOnce(Object t, TreeRewriter.fptr whichRule)
Object
applyRepeatedly(Object t, TreeRewriter.fptr whichRule)
Object
bottomup()
Object
downup(Object t)
Object
downup(Object t, boolean showTransformations)
void
reportTransformation(Object oldTree, Object newTree)
Override this if you need transformation tracing to go somewhere other than stdout or if you're not using Tree-derived trees.Object
topdown()
-
Methods inherited from class org.antlr.runtime.tree.TreeParser
getAncestor, getCurrentInputSymbol, getErrorHeader, getErrorMessage, getMissingSymbol, getSourceName, getTreeNodeStream, inContext, inContext, matchAny, recoverFromMismatchedToken, reset, setTreeNodeStream, traceIn, traceOut
-
Methods inherited from class org.antlr.runtime.BaseRecognizer
alreadyParsedRule, beginResync, combineFollows, computeContextSensitiveRuleFOLLOW, computeErrorRecoverySet, consumeUntil, consumeUntil, displayRecognitionError, emitErrorMessage, endResync, failed, getBacktrackingLevel, getGrammarFileName, getNumberOfSyntaxErrors, getRuleInvocationStack, getRuleInvocationStack, getRuleMemoization, getRuleMemoizationCacheSize, getTokenErrorDisplay, getTokenNames, match, memoize, mismatchIsMissingToken, mismatchIsUnwantedToken, pushFollow, recover, recoverFromMismatchedSet, reportError, setBacktrackingLevel, toStrings, traceIn, traceOut
-
-
-
-
Field Detail
-
showTransformations
protected boolean showTransformations
-
originalTokenStream
protected TokenStream originalTokenStream
-
originalAdaptor
protected TreeAdaptor originalAdaptor
-
-
Constructor Detail
-
TreeRewriter
public TreeRewriter(TreeNodeStream input)
-
TreeRewriter
public TreeRewriter(TreeNodeStream input, RecognizerSharedState state)
-
-
Method Detail
-
applyOnce
public Object applyOnce(Object t, TreeRewriter.fptr whichRule)
-
applyRepeatedly
public Object applyRepeatedly(Object t, TreeRewriter.fptr whichRule)
-
reportTransformation
public void reportTransformation(Object oldTree, Object newTree)
Override this if you need transformation tracing to go somewhere other than stdout or if you're not using Tree-derived trees.
-
topdown
public Object topdown() throws RecognitionException
- Throws:
RecognitionException
-
bottomup
public Object bottomup() throws RecognitionException
- Throws:
RecognitionException
-
-