AST
node type SwitchStmt

General Info

Production
SwitchStmt : BranchTargetStmt ::= Expr Block;
Type Hierarchy:
java.lang.Object
  extended by beaver.Symbol
      extended by AST.ASTNode<ASTNode>
          extended by AST.Stmt
              extended by AST.BranchTargetStmt
                  extended by AST.SwitchStmt
All Implemented Interfaces:
BranchPropagation, java.lang.Cloneable, java.lang.Iterable<ASTNode>

Description

Source
Declared in Java1.4Frontend/java.ast at line 202

Member Filters

API level:

Aspect:

Constructors

public SwitchStmt()
 
public SwitchStmt(Expr p0,
                  Block p1)
 

Attributes

syn boolean targetOf(ContinueStmt stmt)
Specified by:targetOf in interface BranchPropagationSpecified by:targetOf in class BranchTargetStmt
Source
Declared in Java1.4Frontend/BranchTarget.jrag at line 72
Aspect
BranchTarget
syn boolean targetOf(BreakStmt stmt)
Specified by:targetOf in interface BranchPropagationSpecified by:targetOf in class BranchTargetStmt
Source
Declared in Java1.4Frontend/BranchTarget.jrag at line 76
Aspect
BranchTarget
syn boolean isDAafter(Variable v)
Overrides:isDAafter in class Stmt
Source
Declared in Java1.4Frontend/DefiniteAssignment.jrag at line 531
Aspect
DA
Source
Declared in Java1.4Frontend/DefiniteAssignment.jrag at line 549
Aspect
DA
syn boolean isDUafter(Variable v)
Overrides:isDUafter in class Stmt
Source
Declared in Java1.4Frontend/DefiniteAssignment.jrag at line 1000
Aspect
DU
Source
Declared in Java1.4Frontend/DefiniteAssignment.jrag at line 1015
Aspect
DU
syn boolean switchLabelEndsBlock()
Source
Declared in Java1.4Frontend/DefiniteAssignment.jrag at line 1018
Aspect
DU
Source
Declared in Java1.4Frontend/UnreachableStatements.jrag at line 60
Aspect
UnreachableStatements
syn boolean noStmts()
Source
Declared in Java1.4Frontend/UnreachableStatements.jrag at line 62
Aspect
UnreachableStatements
syn boolean noStmtsAfterLastLabel()
Source
Declared in Java1.4Frontend/UnreachableStatements.jrag at line 69
Aspect
UnreachableStatements
syn boolean noDefaultLabel()
Source
Declared in Java1.4Frontend/UnreachableStatements.jrag at line 72
Aspect
UnreachableStatements
syn boolean canCompleteNormally()
Overrides:canCompleteNormally in class Stmt
Source
Declared in Java1.4Frontend/UnreachableStatements.jrag at line 79
Aspect
UnreachableStatements
Source
Declared in Java1.4Backend/CreateBCode.jrag at line 1211
Aspect
CreateBCode
syn int end_label()
Source
Declared in Java1.4Backend/CreateBCode.jrag at line 1219
Aspect
CreateBCode
syn int numCase()
Source
Declared in Java1.4Backend/CreateBCode.jrag at line 1290
Aspect
CreateBCode
syn int break_label()
Overrides:break_label in class Stmt
Source
Declared in Java1.4Backend/CreateBCode.jrag at line 1398
Aspect
CreateBCode
syn boolean modifiedInScope(Variable var)
Specified by:modifiedInScope in class Stmt
Source
Declared in Java7Frontend/PreciseRethrow.jrag at line 55
Aspect
PreciseRethrow
syn boolean isSwitchWithString()
Source
Declared in Java7Backend/StringsInSwitch.jrag at line 21
Aspect
StringsInSwitch
syn int localNumA()
Source
Declared in Java7Backend/StringsInSwitch.jrag at line 38
Aspect
StringsInSwitch
syn int localNumB()
Local index for the second switch variable.
Source
Declared in Java7Backend/StringsInSwitch.jrag at line 44
Aspect
StringsInSwitch
syn int labelOffset(CodeGeneration gen,
                int lbl1,
                int lbl2)
Utility method to compute offsets between labels.
Source
Declared in Java7Backend/StringsInSwitch.jrag at line 100
Aspect
StringsInSwitch
Source
Declared in Java1.4Frontend/LookupType.jrag at line 61
Aspect
SpecialClasses
Source
Declared in Java1.4Frontend/LookupType.jrag at line 63
Aspect
SpecialClasses
Source
Declared in Java7Backend/StringsInSwitch.jrag at line 25
Aspect
StringsInSwitch

Methods

public void flushCache()
Overrides:flushCache in class BranchTargetStmt
public SwitchStmt clone()
                 throws java.lang.CloneNotSupportedException
Overrides:clone in class BranchTargetStmt
Throws:
java.lang.CloneNotSupportedException
public SwitchStmt copy()
Overrides:copy in class ASTNode<ASTNode>
Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.
Overrides:fullCopy in class ASTNode<ASTNode>
Returns:
dangling copy of the subtree at this node
public void toString(java.lang.StringBuffer s)
Overrides:toString in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/PrettyPrint.jadd at line 554
Aspect
PrettyPrint
public void transformation()
Overrides:transformation in class ASTNode<ASTNode>
Source
Declared in Java1.5Backend/EnumsCodegen.jrag at line 17
Aspect
EnumsCodegen
public void init$Children()
Initializes the child array to the correct size. Initializes List and Opt nta children.
Overrides:init$Children in class BranchTargetStmt
protected int numChildren()
Overrides:numChildren in class BranchTargetStmt
public boolean mayHaveRewrite()
Overrides:mayHaveRewrite in class BranchTargetStmt
public void setExpr(Expr node)
Replaces the Expr child.
Parameters:
node - The new node to replace the Expr child.
public Expr getExpr()
Retrieves the Expr child.
Returns:
The current node used as the Expr child.
Retrieves the Expr child.

This method does not invoke AST transformations.

Returns:
The current node used as the Expr child.
public void setBlock(Block node)
Replaces the Block child.
Parameters:
node - The new node to replace the Block child.
public Block getBlock()
Retrieves the Block child.
Returns:
The current node used as the Block child.
Retrieves the Block child.

This method does not invoke AST transformations.

Returns:
The current node used as the Block child.
Source
Declared in Java1.5Backend/AutoBoxingCodegen.jrag at line 125
Aspect
AutoBoxingCodegen
Source
Declared in Java1.5Frontend/Enums.jrag at line 491
Aspect
Enums
public void typeCheck()

Overrides the type checking of the switch statement's expression.

In JSR 334 a switch statement may use an expression of type String.

Overrides:typeCheck in class ASTNode<ASTNode>
Source
Declared in Java7Frontend/StringsInSwitch.jrag at line 25
Aspect
StringsInSwitch
public void createBCode(CodeGeneration gen)
Two switch statements are generated. The first switch will switch on the hash code of the switch expression. The first switch statement computes a value for a variable that selects a case in the second switch statement.
Overrides:createBCode in class Stmt
Source
Declared in Java7Backend/StringsInSwitch.jrag at line 110
Aspect
StringsInSwitch
public boolean Define_boolean_isDAbefore(ASTNode caller,
                                         ASTNode child,
                                         Variable v)
Overrides:Define_boolean_isDAbefore in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/DefiniteAssignment.jrag at line 568
public boolean Define_boolean_isDUbefore(ASTNode caller,
                                         ASTNode child,
                                         Variable v)
Overrides:Define_boolean_isDUbefore in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/DefiniteAssignment.jrag at line 1023
public boolean Define_boolean_insideSwitch(ASTNode caller,
                                           ASTNode child)
Overrides:Define_boolean_insideSwitch in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/NameCheck.jrag at line 377
public Case Define_Case_bind(ASTNode caller,
                             ASTNode child,
                             Case c)
Overrides:Define_Case_bind in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/NameCheck.jrag at line 418
Overrides:Define_TypeDecl_switchType in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/TypeCheck.jrag at line 359
public boolean Define_boolean_reachable(ASTNode caller,
                                        ASTNode child)
Overrides:Define_boolean_reachable in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/UnreachableStatements.jrag at line 82
public boolean Define_boolean_reportUnreachable(ASTNode caller,
                                                ASTNode child)
Overrides:Define_boolean_reportUnreachable in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/UnreachableStatements.jrag at line 158
public int Define_int_localNum(ASTNode caller,
                               ASTNode child)
Overrides:Define_int_localNum in class ASTNode<ASTNode>
Source
Declared in Java7Backend/StringsInSwitch.jrag at line 30
Overrides:rewriteTo in class BranchTargetStmt

Fields

protected java.util.Map targetOf_ContinueStmt_values
protected java.util.Map targetOf_BreakStmt_values
protected java.util.Map isDAafter_Variable_values
protected java.util.Map isDUafter_Variable_values
protected boolean canCompleteNormally_value
protected boolean defaultCase_computed
protected boolean end_label_computed
protected int end_label_value
protected boolean typeInt_computed
protected boolean typeLong_computed

Inherited Members

Attributes inherited from AST.BranchTargetStmt

Attributes inherited from AST.Stmt

Attributes inherited from AST.ASTNode

Methods inherited from class AST.BranchTargetStmt

Methods inherited from class AST.Stmt

Methods inherited from class AST.ASTNode

Methods inherited from class beaver.Symbol

getColumn
getEnd
getId
getLine
getStart
makePosition

Methods inherited from class java.lang.Object

equals
finalize
getClass
hashCode
notify
notifyAll
wait
wait
wait

Fields inherited from AST.BranchTargetStmt

Fields inherited from AST.Stmt

Fields inherited from AST.ASTNode

Fields inherited from beaver.Symbol

end
id
start
value