org.jastadd.extendj.ast
node type SwitchStmt

General Info

Production
SwitchStmt : BranchTargetStmt ::= Expr Block;
Type Hierarchy:
java.lang.Object
  extended by beaver.Symbol
      extended by org.jastadd.extendj.ast.ASTNode<ASTNode>
          extended by org.jastadd.extendj.ast.Stmt
              extended by org.jastadd.extendj.ast.BranchTargetStmt
                  extended by org.jastadd.extendj.ast.SwitchStmt
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable<ASTNode>, org.jastadd.util.PrettyPrintable

Description

Source
Declared in /home/jesper/git/extendj/java4/grammar/Java.ast at line 198

Member Filters

API level:

Aspect:

Constructors

public SwitchStmt()
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 1
public SwitchStmt(Expr p0,
                  Block p1)
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 13

Attributes

Overrides:potentialTargetOf in class BranchTargetStmt
Returns:
true if this statement is a potential branch target of the given branch statement.
Source
Declared in /home/jesper/git/extendj/java4/frontend/BranchTarget.jrag at line 217
Aspect
BranchTarget
@ASTNodeAnnotation.Attribute
syn boolean isDAafter(org.jastadd.extendj.ast.Variable v)
Overrides:isDAafter in class Stmt
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 257
Aspect
DA
@ASTNodeAnnotation.Attribute
syn boolean assignedAfterLastStmt(org.jastadd.extendj.ast.Variable v)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 615
Aspect
DA
@ASTNodeAnnotation.Attribute
syn boolean isDUafter(org.jastadd.extendj.ast.Variable v)
Overrides:isDUafter in class Stmt
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 781
Aspect
DU
@ASTNodeAnnotation.Attribute
syn boolean unassignedAfterLastStmt(org.jastadd.extendj.ast.Variable v)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 1176
Aspect
DU
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 1179
Aspect
DU
Source
Declared in /home/jesper/git/extendj/java4/frontend/UnreachableStatements.jrag at line 98
Aspect
UnreachableStatements
Source
Declared in /home/jesper/git/extendj/java4/frontend/UnreachableStatements.jrag at line 100
Aspect
UnreachableStatements
Source
Declared in /home/jesper/git/extendj/java4/frontend/UnreachableStatements.jrag at line 109
Aspect
UnreachableStatements
Source
Declared in /home/jesper/git/extendj/java4/frontend/UnreachableStatements.jrag at line 113
Aspect
UnreachableStatements
Overrides:canCompleteNormally in class Stmt
Source
Declared in /home/jesper/git/extendj/java4/frontend/UnreachableStatements.jrag at line 53
Aspect
UnreachableStatements
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1397
Aspect
CreateBCode
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1406
Aspect
CreateBCode
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1494
Aspect
CreateBCode
Overrides:break_label in class Stmt
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1621
Aspect
CreateBCode
@ASTNodeAnnotation.Attribute
syn boolean modifiedInScope(org.jastadd.extendj.ast.Variable var)
Specified by:modifiedInScope in class Stmt
Source
Declared in /home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag at line 84
Aspect
PreciseRethrow
Source
Declared in /home/jesper/git/extendj/java7/backend/StringsInSwitch.jrag at line 42
Aspect
StringsInSwitch
Local index for the first switch variable.
Source
Declared in /home/jesper/git/extendj/java7/backend/StringsInSwitch.jrag at line 56
Aspect
StringsInSwitch
Local index for the second switch variable.
Source
Declared in /home/jesper/git/extendj/java7/backend/StringsInSwitch.jrag at line 61
Aspect
StringsInSwitch
@ASTNodeAnnotation.Attribute
syn int labelOffset(org.jastadd.extendj.ast.CodeGeneration gen,
                                            int lbl1,
                                            int lbl2)
Utility method to compute offsets between labels.
Source
Declared in /home/jesper/git/extendj/java7/backend/StringsInSwitch.jrag at line 116
Aspect
StringsInSwitch
Source
Declared in /home/jesper/git/extendj/java4/frontend/LookupType.jrag at line 86
Aspect
SpecialClasses
Source
Declared in /home/jesper/git/extendj/java4/frontend/LookupType.jrag at line 88
Aspect
SpecialClasses
Source
Declared in /home/jesper/git/extendj/java7/backend/StringsInSwitch.jrag at line 45
Aspect
StringsInSwitch

Methods

public void prettyPrint(org.jastadd.util.PrettyPrinter out)
Specified by:prettyPrint in interface org.jastadd.util.PrettyPrintableOverrides:prettyPrint in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/PrettyPrint.jadd at line 238
Aspect
Java4PrettyPrint
public void transformation()
Overrides:transformation in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java5/backend/EnumsCodegen.jrag at line 38
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
Source
Declared in /home/jesper/git/extendj/ASTNode at line 10
protected int numChildren()
Overrides:numChildren in class BranchTargetStmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 20
public boolean mayHaveRewrite()
Overrides:mayHaveRewrite in class BranchTargetStmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 26
public void flushAttrCache()
Overrides:flushAttrCache in class BranchTargetStmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 32
public void flushCollectionCache()
Overrides:flushCollectionCache in class BranchTargetStmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 45
public void flushRewriteCache()
Overrides:flushRewriteCache in class BranchTargetStmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 51
public SwitchStmt clone()
                 throws java.lang.CloneNotSupportedException
Overrides:clone in class BranchTargetStmt
Throws:
java.lang.CloneNotSupportedException
Source
Declared in /home/jesper/git/extendj/ASTNode at line 57
public SwitchStmt copy()
Overrides:copy in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 64
@Deprecated
public SwitchStmt fullCopy()
Deprecated. Please use treeCopy or treeCopyNoTransform instead

Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.

Specified by:fullCopy in class BranchTargetStmt
Returns:
dangling copy of the subtree at this node
Source
Declared in /home/jesper/git/extendj/ASTNode at line 83
public SwitchStmt treeCopyNoTransform()
Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.
Specified by:treeCopyNoTransform in class BranchTargetStmt
Returns:
dangling copy of the subtree at this node
Source
Declared in /home/jesper/git/extendj/ASTNode at line 93
public SwitchStmt treeCopy()
Create a deep copy of the AST subtree at this node. The subtree of this node is traversed to trigger rewrites before copy. The copy is dangling, i.e. has no parent.
Specified by:treeCopy in class BranchTargetStmt
Returns:
dangling copy of the subtree at this node
Source
Declared in /home/jesper/git/extendj/ASTNode at line 113
protected boolean is$Equal(ASTNode node)
Overrides:is$Equal in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 120
public void setExpr(Expr node)
Replaces the Expr child.
Parameters:
node - The new node to replace the Expr child.
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.
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.
public void refined_AutoBoxingCodegen_SwitchStmt_createBCode(org.jastadd.extendj.ast.CodeGeneration gen)
Source
Declared in /home/jesper/git/extendj/java5/backend/AutoBoxingCodegen.jrag at line 174
Aspect
AutoBoxingCodegen
Source
Declared in /home/jesper/git/extendj/java5/frontend/Enums.jrag at line 566
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 /home/jesper/git/extendj/java7/frontend/StringsInSwitch.jrag at line 47
Aspect
StringsInSwitch
public void createBCode(org.jastadd.extendj.ast.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 /home/jesper/git/extendj/java7/backend/StringsInSwitch.jrag at line 126
Aspect
StringsInSwitch
public Stmt Define_branchTarget(ASTNode caller,
                                ASTNode child,
                                Stmt branch)
Overrides:Define_branchTarget in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/BranchTarget.jrag at line 227
protected boolean canDefine_branchTarget(ASTNode caller,
                                         ASTNode child,
                                         Stmt branch)
public boolean Define_isDAbefore(ASTNode caller,
                                 ASTNode child,
                                 org.jastadd.extendj.ast.Variable v)
Overrides:Define_isDAbefore in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 255
protected boolean canDefine_isDAbefore(ASTNode caller,
                                       ASTNode child,
                                       org.jastadd.extendj.ast.Variable v)
public boolean Define_isDUbefore(ASTNode caller,
                                 ASTNode child,
                                 org.jastadd.extendj.ast.Variable v)
Overrides:Define_isDUbefore in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 779
protected boolean canDefine_isDUbefore(ASTNode caller,
                                       ASTNode child,
                                       org.jastadd.extendj.ast.Variable v)
public boolean Define_insideSwitch(ASTNode caller,
                                   ASTNode child)
Overrides:Define_insideSwitch in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/NameCheck.jrag at line 449
protected boolean canDefine_insideSwitch(ASTNode caller,
                                         ASTNode child)
public Case Define_bind(ASTNode caller,
                        ASTNode child,
                        Case c)
Overrides:Define_bind in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/NameCheck.jrag at line 496
protected boolean canDefine_bind(ASTNode caller,
                                 ASTNode child,
                                 Case c)
public TypeDecl Define_switchType(ASTNode caller,
                                  ASTNode child)
Overrides:Define_switchType in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/TypeCheck.jrag at line 420
protected boolean canDefine_switchType(ASTNode caller,
                                       ASTNode child)
public boolean Define_reachable(ASTNode caller,
                                ASTNode child)
Overrides:Define_reachable in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/UnreachableStatements.jrag at line 52
protected boolean canDefine_reachable(ASTNode caller,
                                      ASTNode child)
public boolean Define_reportUnreachable(ASTNode caller,
                                        ASTNode child)
Overrides:Define_reportUnreachable in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag at line 283
protected boolean canDefine_reportUnreachable(ASTNode caller,
                                              ASTNode child)
public int Define_localNum(ASTNode caller,
                           ASTNode child)
Overrides:Define_localNum in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java7/backend/MultiCatch.jrag at line 64
protected boolean canDefine_localNum(ASTNode caller,
                                     ASTNode child)
Overrides:rewriteTo in class BranchTargetStmt

Fields

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 org.jastadd.extendj.ast.BranchTargetStmt

Attributes inherited from org.jastadd.extendj.ast.Stmt

Attributes inherited from org.jastadd.extendj.ast.ASTNode

Methods inherited from class org.jastadd.extendj.ast.BranchTargetStmt

Methods inherited from class org.jastadd.extendj.ast.Stmt

Methods inherited from class org.jastadd.extendj.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 org.jastadd.extendj.ast.BranchTargetStmt

Fields inherited from org.jastadd.extendj.ast.Stmt

Fields inherited from org.jastadd.extendj.ast.ASTNode

Fields inherited from beaver.Symbol

end
id
start
value