com.sri.oaa2.icl
Class IclAST

java.lang.Object
  |
  +--com.sri.oaa2.icl.IclAST
All Implemented Interfaces:
antlr_oaa.collections.AST
Direct Known Subclasses:
IclASTFloat

public abstract class IclAST
extends java.lang.Object
implements antlr_oaa.collections.AST


Field Summary
protected  IclAST astParent
           
protected  int astSibNum
           
protected  java.lang.String astText
           
protected  int astType
           
protected  java.util.ArrayList children
           
protected  IclAST oldestSib
           
protected  java.util.ArrayList siblings
           
protected  IclTerm term
           
 
Constructor Summary
IclAST()
           
 
Method Summary
 void addChild(antlr_oaa.collections.AST child)
          Add child to this node.
 boolean equals(antlr_oaa.collections.AST t)
          Is node t equal to this in terms of token type and text?
 boolean equalsList(antlr_oaa.collections.AST t)
          Is t an exact structural and equals() match of this tree.
 boolean equalsListPartial(antlr_oaa.collections.AST sub)
          Checks if 'sub' a subtree of this list.
 boolean equalsTree(antlr_oaa.collections.AST t)
          Checks if tree rooted at 'this' equal to 't'.
 boolean equalsTreePartial(antlr_oaa.collections.AST sub)
          Checks if 't' a subtree of the tree rooted at 'this'.
 antlr_oaa.collections.ASTEnumeration findAll(antlr_oaa.collections.AST tree)
          Deprecated. unimplemented
 antlr_oaa.collections.ASTEnumeration findAllPartial(antlr_oaa.collections.AST subtree)
          Deprecated. unimplemented
 antlr_oaa.collections.AST getFirstChild()
          Get the first child of this node; null if no children .
 IclTerm getIclTerm()
           
 antlr_oaa.collections.AST getNextSibling()
          Get the next sibling in line after this one.
protected  IclAST getOldestSib()
          Get oldest sibling for AST, or null if unknown
protected  IclAST getParent()
          Get parent for AST or null if unknown
protected  java.util.ArrayList getSiblings()
          Get the list of siblings.
protected  int getSibNum()
          Get the sibling number.
 java.lang.String getText()
          Get the token text for this node.
 int getType()
           
 void initialize(antlr_oaa.collections.AST t)
          Initialize from another AST.
 void initialize(int t, java.lang.String txt)
          Initialize from an integer type and text.
 void initialize(antlr_oaa.Token t)
          Initialize from a token.
 void setFirstChild(antlr_oaa.collections.AST child)
          Set the first child of a node.
 void setNextSibling(antlr_oaa.collections.AST n)
          Set the next sibling after this one.
protected  void setOldestSib(IclAST t)
          Set the oldest sibling
protected  void setParent(IclAST t)
          Set parent for AST
protected  void setSiblings(java.util.ArrayList l)
          For the oldest sibling, this is used to keep track of the other siblings.
protected  void setSibNum(int s)
          Set sibling number.
 void setText(java.lang.String text)
          Set the token text for this node.
 void setType(int t)
           
 java.lang.String toString()
           
 java.lang.String toStringList()
          Print out a child-sibling tree in LISP notation.
 java.lang.String toStringTree()
          Print out the tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

term

protected IclTerm term

children

protected java.util.ArrayList children

siblings

protected java.util.ArrayList siblings

astSibNum

protected int astSibNum

astParent

protected IclAST astParent

oldestSib

protected IclAST oldestSib

astText

protected java.lang.String astText

astType

protected int astType
Constructor Detail

IclAST

public IclAST()
Method Detail

getIclTerm

public IclTerm getIclTerm()

getType

public int getType()
Specified by:
getType in interface antlr_oaa.collections.AST

setType

public void setType(int t)
Specified by:
setType in interface antlr_oaa.collections.AST

setFirstChild

public final void setFirstChild(antlr_oaa.collections.AST child)
Set the first child of a node.

Specified by:
setFirstChild in interface antlr_oaa.collections.AST

setNextSibling

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

Specified by:
setNextSibling in interface antlr_oaa.collections.AST

addChild

public final void addChild(antlr_oaa.collections.AST child)
Add child to this node.

Specified by:
addChild in interface antlr_oaa.collections.AST

setParent

protected final void setParent(IclAST t)
Set parent for AST


getParent

protected final IclAST getParent()
Get parent for AST or null if unknown


getOldestSib

protected final IclAST getOldestSib()
Get oldest sibling for AST, or null if unknown


setOldestSib

protected final void setOldestSib(IclAST t)
Set the oldest sibling


setSiblings

protected final void setSiblings(java.util.ArrayList l)
For the oldest sibling, this is used to keep track of the other siblings.


getSiblings

protected final java.util.ArrayList getSiblings()
Get the list of siblings. This is valid only for the oldest sibling.


setSibNum

protected final void setSibNum(int s)
Set sibling number. Oldest child is 0, next oldest is 1, and so on.


getSibNum

protected final int getSibNum()
Get the sibling number.


equals

public boolean equals(antlr_oaa.collections.AST t)
Is node t equal to this in terms of token type and text?

Specified by:
equals in interface antlr_oaa.collections.AST

equalsList

public boolean equalsList(antlr_oaa.collections.AST t)
Is t an exact structural and equals() match of this tree. The 'this' reference is considered the start of a sibling list.

Specified by:
equalsList in interface antlr_oaa.collections.AST

equalsListPartial

public boolean equalsListPartial(antlr_oaa.collections.AST sub)
Checks if 'sub' a subtree of this list. The siblings of the root are NOT ignored.

Specified by:
equalsListPartial in interface antlr_oaa.collections.AST

equalsTree

public boolean equalsTree(antlr_oaa.collections.AST t)
Checks if tree rooted at 'this' equal to 't'. The siblings of 'this' are ignored.

Specified by:
equalsTree in interface antlr_oaa.collections.AST

equalsTreePartial

public boolean equalsTreePartial(antlr_oaa.collections.AST sub)
Checks if 't' a subtree of the tree rooted at 'this'. The siblings of 'this' are ignored.

Specified by:
equalsTreePartial in interface antlr_oaa.collections.AST

findAll

public antlr_oaa.collections.ASTEnumeration findAll(antlr_oaa.collections.AST tree)
Deprecated. unimplemented

Specified by:
findAll in interface antlr_oaa.collections.AST

findAllPartial

public antlr_oaa.collections.ASTEnumeration findAllPartial(antlr_oaa.collections.AST subtree)
Deprecated. unimplemented

Specified by:
findAllPartial in interface antlr_oaa.collections.AST

getFirstChild

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

Specified by:
getFirstChild in interface antlr_oaa.collections.AST

getNextSibling

public final antlr_oaa.collections.AST getNextSibling()
Get the next sibling in line after this one.

Specified by:
getNextSibling in interface antlr_oaa.collections.AST

getText

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

Specified by:
getText in interface antlr_oaa.collections.AST

initialize

public final void initialize(int t,
                             java.lang.String txt)
Initialize from an integer type and text.

Specified by:
initialize in interface antlr_oaa.collections.AST

initialize

public final void initialize(antlr_oaa.collections.AST t)
Initialize from another AST.

Specified by:
initialize in interface antlr_oaa.collections.AST

initialize

public final void initialize(antlr_oaa.Token t)
Initialize from a token.

Specified by:
initialize in interface antlr_oaa.collections.AST

setText

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

Specified by:
setText in interface antlr_oaa.collections.AST

toString

public java.lang.String toString()
Specified by:
toString in interface antlr_oaa.collections.AST
Overrides:
toString in class java.lang.Object

toStringList

public final java.lang.String toStringList()
Print out a child-sibling tree in LISP notation.

Specified by:
toStringList in interface antlr_oaa.collections.AST

toStringTree

public final java.lang.String toStringTree()
Print out the tree.

Specified by:
toStringTree in interface antlr_oaa.collections.AST