org.teatrove.tea.parsetree
Class Block

java.lang.Object
  extended by org.teatrove.tea.parsetree.Node
      extended by org.teatrove.tea.parsetree.Statement
          extended by org.teatrove.tea.parsetree.StatementList
              extended by 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

Constructor Summary
Block(SourceInfo info)
           
Block(SourceInfo info, Statement[] statements)
           
Block(Statement stmt)
           
 
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)
           
 
Methods inherited from class org.teatrove.tea.parsetree.StatementList
getStatements, isReturn, setStatements
 
Methods inherited from class org.teatrove.tea.parsetree.Statement
isBreak
 
Methods inherited from class org.teatrove.tea.parsetree.Node
getSourceInfo, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Block

public Block(SourceInfo info,
             Statement[] statements)

Block

public Block(SourceInfo info)

Block

public Block(Statement stmt)
Method Detail

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.