com.go.tea.parsetree
Class Block
java.lang.Object
|
+--com.go.tea.parsetree.Node
|
+--com.go.tea.parsetree.Statement
|
+--com.go.tea.parsetree.StatementList
|
+--com.go.tea.parsetree.Block
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- public class Block
- extends StatementList
A Block is a StatementList that most likely appeared in the source file
delimited by braces. A Block may contain initializer statements, inserted by
a type checker, to be executed at the beginning of the boock. A Block may
also contain a finalizer, inserted by a type checker, to be executed at the
end of the Block.
- Version:
- 20 , 9/07/00
- Author:
- Brian S O'Neill
- See Also:
- Serialized Form
|
Method Summary |
java.lang.Object |
accept(NodeVisitor visitor)
Every subclass of Node must override this method with the following:
return visitor.visit(this). |
java.lang.Object |
clone()
Returns a clone of this Node and all its children. |
Statement |
getFinalizer()
Finalizer is executed at the end of the block and may be defined by a
type checker in order to correctly manage variable types. |
Statement |
getInitializer()
Initializer is executed at the beginning of the block and may be defined
by a type checker in order to correctly manage variable types. |
void |
setFinalizer(Statement finalizer)
|
void |
setInitializer(Statement initializer)
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Block
public Block(SourceInfo info,
Statement[] statements)
Block
public Block(SourceInfo info)
Block
public Block(Statement stmt)
accept
public java.lang.Object accept(NodeVisitor visitor)
- Description copied from class:
Node
- Every subclass of Node must override this method with the following:
return visitor.visit(this).
- Overrides:
accept in class StatementList
- Following copied from class:
com.go.tea.parsetree.Node
- Parameters:
visitor - A visitor of this Node- Returns:
- Node The Node returned by the visitor
- See Also:
NodeVisitor
clone
public java.lang.Object clone()
- Description copied from class:
Node
- Returns a clone of this Node and all its children. Immutable child
objects are not necessarily cloned
- Overrides:
clone in class StatementList
getInitializer
public Statement getInitializer()
- Initializer is executed at the beginning of the block and may be defined
by a type checker in order to correctly manage variable types.
getFinalizer
public Statement getFinalizer()
- Finalizer is executed at the end of the block and may be defined by a
type checker in order to correctly manage variable types.
setInitializer
public void setInitializer(Statement initializer)
setFinalizer
public void setFinalizer(Statement finalizer)