public class TreeRewriter extends TreeParser
Modifier and Type | Class and Description |
---|---|
static interface |
TreeRewriter.fptr |
Modifier and Type | Field and Description |
---|---|
protected TreeAdaptor |
originalAdaptor |
protected TokenStream |
originalTokenStream |
protected boolean |
showTransformations |
DOWN, input, UP
DEFAULT_TOKEN_CHANNEL, HIDDEN, INITIAL_FOLLOW_STACK_SIZE, MEMO_RULE_FAILED, MEMO_RULE_UNKNOWN, NEXT_TOKEN_RULE_NAME, state
Constructor and Description |
---|
TreeRewriter(TreeNodeStream input) |
TreeRewriter(TreeNodeStream input,
RecognizerSharedState state) |
Modifier and Type | Method and 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() |
getAncestor, getCurrentInputSymbol, getErrorHeader, getErrorMessage, getMissingSymbol, getSourceName, getTreeNodeStream, inContext, inContext, matchAny, recoverFromMismatchedToken, reset, setTreeNodeStream, traceIn, traceOut
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
protected boolean showTransformations
protected TokenStream originalTokenStream
protected TreeAdaptor originalAdaptor
public TreeRewriter(TreeNodeStream input)
public TreeRewriter(TreeNodeStream input, RecognizerSharedState state)
public Object applyOnce(Object t, TreeRewriter.fptr whichRule)
public Object applyRepeatedly(Object t, TreeRewriter.fptr whichRule)
public void reportTransformation(Object oldTree, Object newTree)
public Object topdown() throws RecognitionException
RecognitionException
public Object bottomup() throws RecognitionException
RecognitionException
Copyright © 1992–2015 ANTLR. All rights reserved.