public class ASTList extends ASTree
Constructor and Description |
---|
ASTList(ASTree _head) |
ASTList(ASTree _head,
ASTList _tail) |
Modifier and Type | Method and Description |
---|---|
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() |
ASTree |
head()
Returns the car part of the list.
|
int |
length()
Returns the number of the elements in this list.
|
static int |
length(ASTList list) |
static ASTList |
make(ASTree e1,
ASTree e2,
ASTree e3) |
void |
setHead(ASTree _head) |
void |
setLeft(ASTree _left) |
void |
setRight(ASTree _right) |
void |
setTail(ASTList _tail) |
ASTList |
sublist(int nth)
Returns a sub list of the list.
|
boolean |
subst(ASTree newObj,
ASTree oldObj)
Substitutes
newObj for oldObj in the
list. |
ASTList |
tail()
Returns the cdr part of the list.
|
String |
toString() |
public ASTList(ASTree _head)
public ASTree head()
public void setHead(ASTree _head)
public ASTList tail()
public void setTail(ASTList _tail)
public void accept(Visitor v) throws CompileError
ASTree
atXXX()
on the given visitor, where
XXX
is the class name of the node object.accept
in class ASTree
CompileError
public int length()
public static int length(ASTList list)
public ASTList sublist(int nth)
nth
- zero or more than zero.Copyright © 2019. All rights reserved.