polyglot.ast
Interface Switch

All Superinterfaces:
java.lang.Cloneable, CompoundStmt, Copy, JL, Node, NodeOps, Stmt, Term
All Known Implementing Classes:
Switch_c

public interface Switch
extends CompoundStmt

A Switch is an immutable representation of a Java switch statement. Such a statement has an expression which is evaluated to determine where to branch to, an a list of labels and block statements which are conditionally evaluated. One of the labels, rather than having a constant expression, may be lablled default.


Method Summary
 java.util.List elements()
          List of switch elements: case statements or blocks.
 Switch elements(java.util.List elements)
          Set the list of switch elements: case statements or blocks.
 Expr expr()
          The expression on which to switch.
 Switch expr(Expr expr)
          Set the expression on which to switch.
 
Methods inherited from interface polyglot.ast.Term
acceptCFG, entry, exceptions, exceptions, reachable, reachable
 
Methods inherited from interface polyglot.ast.Node
childExpectedType, del, del, dump, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList
 
Methods inherited from interface polyglot.ast.JL
init, node
 
Methods inherited from interface polyglot.ast.NodeOps
addDecls, addMembers, addMembersEnter, buildTypes, buildTypesEnter, disambiguate, disambiguateEnter, enterScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, visitChildren
 
Methods inherited from interface polyglot.util.Copy
copy
 

Method Detail

expr

Expr expr()
The expression on which to switch.


expr

Switch expr(Expr expr)
Set the expression on which to switch.


elements

java.util.List elements()
List of switch elements: case statements or blocks.

Returns:
A list of SwitchElement.

elements

Switch elements(java.util.List elements)
Set the list of switch elements: case statements or blocks.

Parameters:
elements - A list of SwitchElement.