public class ForStatement extends Statement
Modifier and Type | Field and Description |
---|---|
Statement |
body
(¬ø) The body of the loop.
|
Expression |
condition
(ø) The expression representing the loop's terminating condition.
|
VariableDeclaration |
initializer
(ø) The variable declaration in the loop header (if any).
|
ExpressionList |
initializers
(ø) The initializing expression(s) in the loop header (if any).
|
ExpressionList |
updaters
(ø) The updating expression(s) in the loop header.
|
byteOffset, line, nodeID, symbolTable
Constructor and Description |
---|
ForStatement(ExpressionList i,
Expression c,
ExpressionList u,
Statement b,
int line,
int byteOffset)
Full constructor.
|
ForStatement(VariableDeclaration v,
Expression c,
ExpressionList u,
Statement b,
int line,
int byteOffset)
Full constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a new object with the same primitive data, and recursively creates new member data
objects as well.
|
boolean |
equals(Object o)
Distinguishes this
ASTNode from other objects according to its contents recursively. |
int |
hashCode()
Returns a hash code for this
ASTNode . |
ASTNodeIterator |
iterator()
Returns an iterator used to successively access the children of this node.
|
void |
runPass(Pass pass)
Ensures that the correct
run() method is called for this type of node. |
void |
write(StringBuffer buffer)
Writes a string representation of this
ASTNode to the specified buffer. |
public ExpressionList initializers
public VariableDeclaration initializer
public Expression condition
public ExpressionList updaters
public Statement body
public ForStatement(ExpressionList i, Expression c, ExpressionList u, Statement b, int line, int byteOffset)
i
- The initializers list.c
- The terminating condition.u
- The updaters list.b
- The body of the loop.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 ForStatement(VariableDeclaration v, Expression c, ExpressionList u, Statement b, int line, int byteOffset)
v
- The initializer variable declaration.c
- The terminating condition.u
- The updaters list.b
- The body of the loop.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 ASTNodeIterator iterator()
public Object clone()
public int hashCode()
ASTNode
.public boolean equals(Object o)
ASTNode
from other objects according to its contents recursively.public void runPass(Pass pass)
run()
method is called for this type of node.public void write(StringBuffer buffer)
ASTNode
to the specified buffer. The
representation written is parsable by the LBJava compiler, but not very readable.Copyright © 2016. All rights reserved.