public class DeclarationList 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 |
DeclarationList.DeclarationListIterator
Used to iterate though the children of a list of AST nodes.
|
List.NodeListIterator
byteOffset, line, nodeID, symbolTable
Constructor and Description |
---|
DeclarationList()
Default constructor.
|
DeclarationList(Declaration d)
Initializing constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Declaration d)
Adds another
Declaration to the end of the list. |
void |
addAll(DeclarationList d)
Adds all the
Declaration s in another DeclarationList to the end of
this DeclarationList . |
Object |
clone()
Creates a new object with the same primitive data, and recursively creates new member data
objects as well.
|
ASTNodeIterator |
iterator()
Returns an iterator used to successively access the children of this node.
|
DeclarationList.DeclarationListIterator |
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. |
Declaration[] |
toArray()
Transforms the list into an array of statements.
|
equals, getSeparator, hashCode, size, sort, sort, write, writeBuffer
public DeclarationList()
public DeclarationList(Declaration d)
null
.d
- A single Declaration
with which to initialize this list.public void add(Declaration d)
Declaration
to the end of the list.d
- A reference to the Declaration
to be added.public void addAll(DeclarationList d)
Declaration
s in another DeclarationList
to the end of
this DeclarationList
.d
- The list to be added.public Declaration[] toArray()
public DeclarationList.DeclarationListIterator listIterator()
public ASTNodeIterator iterator()
public Object clone()
Copyright © 2016. All rights reserved.