public class StatementList 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 |
StatementList.StatementListIterator
Used to iterate though the children of a list of AST nodes.
|
List.NodeListIteratorbyteOffset, line, nodeID, symbolTable| Constructor and Description |
|---|
StatementList()
Default constructor.
|
StatementList(int line,
int byteOffset)
Initializing constructor.
|
StatementList(Statement s)
Initializing constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Statement s)
Adds another
Statement to the end of the list. |
void |
addAll(StatementList s)
Adds all the
Statements in another StatementList to the end of this
StatementList. |
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.
|
StatementList.StatementListIterator |
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. |
Statement[] |
toArray()
Transforms the list into an array of statements.
|
equals, getSeparator, hashCode, size, sort, sort, write, writeBufferpublic StatementList()
public StatementList(int line,
int byteOffset)
line - The line on which the source code represented by this node is found.byteOffset - The byte offset from the beginning of the source file at which the source
code represented by this node is found.public StatementList(Statement s)
null.s - A single Statement with which to initialize this list.public void add(Statement s)
Statement to the end of the list.s - A reference to the Statement to be added.public void addAll(StatementList s)
Statements in another StatementList to the end of this
StatementList.s - The list to be added.public Statement[] toArray()
public StatementList.StatementListIterator listIterator()
public ASTNodeIterator iterator()
public Object clone()
Copyright © 2016. All rights reserved.