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
 java.lang.Object applyOnce(java.lang.Object t, TreeRewriter.fptr whichRule)
           
 java.lang.Object applyRepeatedly(java.lang.Object t, TreeRewriter.fptr whichRule)
           
 java.lang.Object bottomup()
           
 java.lang.Object downup(java.lang.Object t)
           
 java.lang.Object downup(java.lang.Object t, boolean showTransformations)
           
 void reportTransformation(java.lang.Object oldTree, java.lang.Object newTree)
          Override this if you need transformation tracing to go somewhere other than stdout or if you're not using Tree-derived trees.
 java.lang.Object topdown()
           
 
Methods inherited from class org.antlr.runtime.tree.TreeParser
getCurrentInputSymbol, getErrorHeader, getErrorMessage, getMissingSymbol, getSourceName, getTreeNodeStream, 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 java.lang.Object applyOnce(java.lang.Object t,
                                  TreeRewriter.fptr whichRule)

applyRepeatedly

public java.lang.Object applyRepeatedly(java.lang.Object t,
                                        TreeRewriter.fptr whichRule)

downup

public java.lang.Object downup(java.lang.Object t)

downup

public java.lang.Object downup(java.lang.Object t,
                               boolean showTransformations)

reportTransformation

public void reportTransformation(java.lang.Object oldTree,
                                 java.lang.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 java.lang.Object topdown()
                         throws RecognitionException
Throws:
RecognitionException

bottomup

public java.lang.Object bottomup()
                          throws RecognitionException
Throws:
RecognitionException


Copyright © 2013. All Rights Reserved.