antlr

Class ParseTree

Implemented Interfaces:
AST, Serializable
Known Direct Subclasses:
ParseTreeRule, ParseTreeToken

public abstract class ParseTree
extends BaseAST

Field Summary

Fields inherited from class antlr.BaseAST

down, right

Method Summary

protected int
getLeftmostDerivation(StringBuffer buf, int step)
Get derivation and return how many you did (less than requested for subtree roots.
String
getLeftmostDerivation(int maxSteps)
String
getLeftmostDerivationStep(int step)
Walk parse tree and return requested number of derivation steps.
void
initialize(Token token)
void
initialize(AST ast)
void
initialize(int i, String s)

Methods inherited from class antlr.BaseAST

addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getColumn, getFirstChild, getLine, getNextSibling, getNumberOfChildren, getText, getTokenNames, getType, initialize, initialize, initialize, removeChildren, setFirstChild, setNextSibling, setText, setType, setVerboseStringConversion, toString, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen

Method Details

getLeftmostDerivation

protected int getLeftmostDerivation(StringBuffer buf,
                                    int step)
Get derivation and return how many you did (less than requested for subtree roots.


getLeftmostDerivation

public String getLeftmostDerivation(int maxSteps)


getLeftmostDerivationStep

public String getLeftmostDerivationStep(int step)
Walk parse tree and return requested number of derivation steps. If steps <= 0, return node text. If steps == 1, return derivation string at step.


initialize

public void initialize(Token token)
Specified by:
initialize in interface AST
Overrides:
initialize in interface BaseAST


initialize

public void initialize(AST ast)
Specified by:
initialize in interface AST
Overrides:
initialize in interface BaseAST


initialize

public void initialize(int i,
                       String s)
Specified by:
initialize in interface AST
Overrides:
initialize in interface BaseAST