coins.ast
Class ASTList

java.lang.Object
  extended bycoins.ast.ASTree
      extended bycoins.ast.ASTList
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ArrayInitializer, CompoundStmnt, DeclaratorList

public class ASTList
extends ASTree

A linked list. The right subtree must be an ASTList object or null.

See Also:
Serialized Form

Constructor Summary
ASTList(ASTree _head)
           
ASTList(ASTree _head, ASTList _tail)
           
 
Method Summary
 void accept(Visitor v)
          Is a method for the visitor pattern.
static ASTList append(ASTList a, ASTree b)
          Appends an object to a list.
static ASTList concat(ASTList a, ASTList b)
          Concatenates two lists.
 ASTree getLeft()
           
 ASTree getRight()
           
protected  java.lang.String getTag()
          Returns the type of this node.
 ASTree head()
          Returns the car part of the list.
protected  void rightToString(java.lang.StringBuffer sbuf, ASTree _right)
           
 void setHead(ASTree _head)
           
 void setLeft(ASTree _left)
           
 void setRight(ASTree _right)
           
 void setTail(ASTList _tail)
           
 boolean subst(ASTree newObj, ASTree oldObj)
           
 ASTList tail()
          Returns the cdr part of the list.
 
Methods inherited from class coins.ast.ASTree
putSeparator, toString, toString1
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ASTList

public ASTList(ASTree _head,
               ASTList _tail)

ASTList

public ASTList(ASTree _head)
Method Detail

getLeft

public ASTree getLeft()
Specified by:
getLeft in class ASTree

getRight

public ASTree getRight()
Specified by:
getRight in class ASTree

setLeft

public void setLeft(ASTree _left)
Specified by:
setLeft in class ASTree

setRight

public void setRight(ASTree _right)
Specified by:
setRight in class ASTree

head

public ASTree head()
Returns the car part of the list.


setHead

public void setHead(ASTree _head)

tail

public ASTList tail()
Returns the cdr part of the list.


setTail

public void setTail(ASTList _tail)

accept

public void accept(Visitor v)
Description copied from class: ASTree
Is a method for the visitor pattern. It calls atXXX() on the given visitor, where XXX is the class name of the node object.

Specified by:
accept in class ASTree

getTag

protected java.lang.String getTag()
Description copied from class: ASTree
Returns the type of this node. This method is used by toString().

Overrides:
getTag in class ASTree

rightToString

protected void rightToString(java.lang.StringBuffer sbuf,
                             ASTree _right)
Overrides:
rightToString in class ASTree

subst

public boolean subst(ASTree newObj,
                     ASTree oldObj)

append

public static ASTList append(ASTList a,
                             ASTree b)
Appends an object to a list.


concat

public static ASTList concat(ASTList a,
                             ASTList b)
Concatenates two lists.