org.antlr.runtime.tree
Class TreeRewriter

java.lang.Object
  extended by org.antlr.runtime.BaseRecognizer
      extended by org.antlr.runtime.tree.TreeParser
          extended by org.antlr.runtime.tree.TreeRewriter

public class TreeRewriter
extends TreeParser


Nested Class Summary
static interface TreeRewriter.fptr
           
 
Field Summary
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
TreeRewriter(TreeNodeStream input)
           
TreeRewriter(TreeNodeStream input, RecognizerSharedState state)
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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)

downup

public Object downup(Object t)

downup

public Object downup(Object t,
                     boolean showTransformations)

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


Copyright © 2011. All Rights Reserved.