org.extendj.ast
node type IfStmt

General Info

Production
IfStmt : Stmt ::= Condition:Expr Then:Stmt [Else:Stmt];
Type Hierarchy:
java.lang.Object
  extended by beaver.Symbol
      extended by org.extendj.ast.ASTNode<ASTNode>
          extended by org.extendj.ast.Stmt
              extended by org.extendj.ast.IfStmt
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 203

Member Filters

API level:

Aspect:

Constructors

public IfStmt(Expr cond,
              Stmt thenBranch)
 
Source
Declared in /home/jesper/git/extendj/java4/frontend/NodeConstructors.jrag at line 77
Aspect
NodeConstructors
public IfStmt(Expr cond,
              Stmt thenBranch,
              Stmt elseBranch)
 
Source
Declared in /home/jesper/git/extendj/java4/frontend/NodeConstructors.jrag at line 81
Aspect
NodeConstructors
public IfStmt()
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 1
public IfStmt(Expr p0,
              Stmt p1,
              Opt<Stmt> p2)
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 14

Attributes

@ASTNodeAnnotation.Attribute
syn boolean isDAafter(org.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 isDUafter(org.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
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 1536
Aspect
CreateBCode
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1537
Aspect
CreateBCode
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1538
Aspect
CreateBCode
@ASTNodeAnnotation.Attribute
syn boolean modifiedInScope(org.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

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/PrettyPrintUtil.jrag at line 164
Aspect
PrettyPrintUtil
public void typeCheck()
Overrides:typeCheck in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/TypeCheck.jrag at line 371
Aspect
TypeCheck
public void createBCode(org.extendj.ast.CodeGeneration gen)
Overrides:createBCode in class Stmt
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1539
Aspect
CreateBCode
public void init$Children()
Initializes the child array to the correct size. Initializes List and Opt nta children.
Overrides:init$Children in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 10
protected int numChildren()
Overrides:numChildren in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 22
public boolean mayHaveRewrite()
Overrides:mayHaveRewrite in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 28
public void flushAttrCache()
Overrides:flushAttrCache in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 34
public void flushCollectionCache()
Overrides:flushCollectionCache in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 46
public void flushRewriteCache()
Overrides:flushRewriteCache in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 52
public IfStmt clone()
             throws java.lang.CloneNotSupportedException
Overrides:clone in class Stmt
Throws:
java.lang.CloneNotSupportedException
Source
Declared in /home/jesper/git/extendj/ASTNode at line 58
public IfStmt copy()
Overrides:copy in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 65
@Deprecated
public IfStmt 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 Stmt
Returns:
dangling copy of the subtree at this node
Source
Declared in /home/jesper/git/extendj/ASTNode at line 84
public IfStmt 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 Stmt
Returns:
dangling copy of the subtree at this node
Source
Declared in /home/jesper/git/extendj/ASTNode at line 94
public IfStmt 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 Stmt
Returns:
dangling copy of the subtree at this node
Source
Declared in /home/jesper/git/extendj/ASTNode at line 114
protected boolean is$Equal(ASTNode node)
Overrides:is$Equal in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 121
public void setCondition(Expr node)
Replaces the Condition child.
Parameters:
node - The new node to replace the Condition child.
Retrieves the Condition child.
Returns:
The current node used as the Condition child.
Retrieves the Condition child.

This method does not invoke AST transformations.

Returns:
The current node used as the Condition child.
public void setThen(Stmt node)
Replaces the Then child.
Parameters:
node - The new node to replace the Then child.
Retrieves the Then child.
Returns:
The current node used as the Then child.
Retrieves the Then child.

This method does not invoke AST transformations.

Returns:
The current node used as the Then child.
public void setElseOpt(Opt<Stmt> opt)
Replaces the optional node for the Else child. This is the Opt node containing the child Else, not the actual child!
Parameters:
opt - The new node to be used as the optional node for the Else child.
public void setElse(Stmt node)
Replaces the (optional) Else child.
Parameters:
node - The new node to be used as the Else child.
public boolean hasElse()
Check whether the optional Else child exists.
Returns:
true if the optional Else child exists, false if it does not.
public Stmt getElse()
Retrieves the (optional) Else child.
Returns:
The Else child, if it exists. Returns null otherwise.
Retrieves the optional node for the Else child. This is the Opt node containing the child Else, not the actual child!
Returns:
The optional node for child the Else child.
Retrieves the optional node for child Else. This is the Opt node containing the child Else, not the actual child!

This method does not invoke AST transformations.

Returns:
The optional node for child Else.
public boolean Define_isDAbefore(ASTNode caller,
                                 ASTNode child,
                                 org.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.extendj.ast.Variable v)
public boolean Define_isDUbefore(ASTNode caller,
                                 ASTNode child,
                                 org.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.extendj.ast.Variable v)
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 boolean Define_inhModifiedInScope(ASTNode caller,
                                         ASTNode child,
                                         org.extendj.ast.Variable var)
Overrides:Define_inhModifiedInScope in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java8/frontend/EffectivelyFinal.jrag at line 30
protected boolean canDefine_inhModifiedInScope(ASTNode caller,
                                               ASTNode child,
                                               org.extendj.ast.Variable var)
Overrides:rewriteTo in class Stmt

Fields

protected java.util.Map isDAafter_Variable_values
protected java.util.Map isDUafter_Variable_values
protected boolean canCompleteNormally_value
protected boolean else_branch_label_computed
protected boolean then_branch_label_computed
protected boolean end_label_computed
protected int end_label_value

Inherited Members

Attributes inherited from org.extendj.ast.Stmt

Attributes inherited from org.extendj.ast.ASTNode

Methods inherited from class org.extendj.ast.Stmt

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

Fields inherited from org.extendj.ast.ASTNode

Fields inherited from beaver.Symbol

end
id
start
value