antlr.collections

Interface AST

public interface AST

Minimal AST node interface used by ANTLR AST generation and tree-walker.
Method Summary
voidaddChild(AST c)
Add a (rightmost) child to this node
booleanequals(AST t)
booleanequalsList(AST t)
booleanequalsListPartial(AST t)
booleanequalsTree(AST t)
booleanequalsTreePartial(AST t)
ASTEnumerationfindAll(AST tree)
ASTEnumerationfindAllPartial(AST subtree)
intgetColumn()
ASTgetFirstChild()
Get the first child of this node; null if no children
intgetLine()
ASTgetNextSibling()
Get the next sibling in line after this one
intgetNumberOfChildren()
Get number of children of this node; if leaf, returns 0
StringgetText()
Get the token text for this node
intgetType()
Get the token type for this node
voidinitialize(int t, String txt)
voidinitialize(AST t)
voidinitialize(Token t)
voidsetFirstChild(AST c)
Set the first child of a node.
voidsetNextSibling(AST n)
Set the next sibling after this one.
voidsetText(String text)
Set the token text for this node
voidsetType(int ttype)
Set the token type for this node
StringtoString()
StringtoStringList()
StringtoStringTree()

Method Detail

addChild

public void addChild(AST c)
Add a (rightmost) child to this node

equals

public boolean equals(AST t)

equalsList

public boolean equalsList(AST t)

equalsListPartial

public boolean equalsListPartial(AST t)

equalsTree

public boolean equalsTree(AST t)

equalsTreePartial

public boolean equalsTreePartial(AST t)

findAll

public ASTEnumeration findAll(AST tree)

findAllPartial

public ASTEnumeration findAllPartial(AST subtree)

getColumn

public int getColumn()

Since: 2.7.3 Need for error handling

getFirstChild

public AST getFirstChild()
Get the first child of this node; null if no children

getLine

public int getLine()

Since: 2.7.3 Need for error handling

getNextSibling

public AST getNextSibling()
Get the next sibling in line after this one

getNumberOfChildren

public int getNumberOfChildren()
Get number of children of this node; if leaf, returns 0

getText

public String getText()
Get the token text for this node

getType

public int getType()
Get the token type for this node

initialize

public void initialize(int t, String txt)

initialize

public void initialize(AST t)

initialize

public void initialize(Token t)

setFirstChild

public void setFirstChild(AST c)
Set the first child of a node.

setNextSibling

public void setNextSibling(AST n)
Set the next sibling after this one.

setText

public void setText(String text)
Set the token text for this node

setType

public void setType(int ttype)
Set the token type for this node

toString

public String toString()

toStringList

public String toStringList()

toStringTree

public String toStringTree()