org.teatrove.tea.parsetree
Class Block
java.lang.Object
org.teatrove.tea.parsetree.Node
org.teatrove.tea.parsetree.Statement
org.teatrove.tea.parsetree.StatementList
org.teatrove.tea.parsetree.Block
- All Implemented Interfaces:
- Serializable, Cloneable
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.
- Author:
- Brian S O'Neill
- See Also:
- Serialized Form
|
Method Summary |
Object |
accept(NodeVisitor visitor)
Every subclass of Node must override this method with the following:
return visitor.visit(this). |
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)
|
Block
public Block(SourceInfo info,
Statement[] statements)
Block
public Block(SourceInfo info)
Block
public Block(Statement stmt)
accept
public 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
- Parameters:
visitor - A visitor of this Node
- Returns:
- Node The Node returned by the visitor
- See Also:
NodeVisitor
clone
public 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)
Copyright © 1997-2012 TeaTrove.org. All Rights Reserved.