public class ExpressionList extends List
LinkedList
. The code that uses it looks
a little cleaner when casts are all taken care of automatically.Modifier and Type | Class and Description |
---|---|
class |
ExpressionList.ExpressionListIterator
Used to iterate though the children of a list of AST nodes.
|
List.NodeListIterator
byteOffset, line, nodeID, symbolTable
Constructor and Description |
---|
ExpressionList()
Default constructor.
|
ExpressionList(Expression e)
Initializing constructor.
|
ExpressionList(Expression e,
ExpressionList l)
Initializing constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Expression e)
Adds another
Expression to the end of the list. |
void |
addAll(ExpressionList e)
Adds all the
Expression s in another ExpressionList to the end of
this ExpressionList . |
Object |
clone()
Creates a new object with the same primitive data, and recursively creates new member data
objects as well.
|
boolean |
containsQuantifiedVariable()
Determines if there are any quantified variables in this expression.
|
HashSet |
getVariableTypes()
Returns a set of
Argument s storing the name and type of each variable that is a
subexpression of this expression. |
ASTNodeIterator |
iterator()
Returns an iterator used to successively access the children of this node.
|
ExpressionList.ExpressionListIterator |
listIterator()
Returns an iterator used specifically to access the elements of this list.
|
void |
runPass(Pass pass)
Ensures that the correct
run() method is called for this type of node. |
Expression[] |
toArray()
Transforms the list into an array of expressions.
|
equals, getSeparator, hashCode, size, sort, sort, write, writeBuffer
public ExpressionList()
public ExpressionList(Expression e)
null
.e
- A single Expression
with which to initialize this list.public ExpressionList(Expression e, ExpressionList l)
null
,
however this is required of the second argument.e
- A single Expression
with which to initialize this list.l
- A list of Expression
s which will also be added to the list.public void add(Expression e)
Expression
to the end of the list.e
- A reference to the Expression
to be added.public void addAll(ExpressionList e)
Expression
s in another ExpressionList
to the end of
this ExpressionList
.e
- The list to be added.public HashSet getVariableTypes()
Argument
s storing the name and type of each variable that is a
subexpression of this expression. This method cannot be run before
SemanticAnalysis
runs.public boolean containsQuantifiedVariable()
SemanticAnalysis
runs.public Expression[] toArray()
public ExpressionList.ExpressionListIterator listIterator()
public ASTNodeIterator iterator()
public Object clone()
Copyright © 2016. All rights reserved.