org.extendj.ast
node type ForStmt

General Info

Production
ForStmt : BranchTargetStmt ::= InitStmt:Stmt* [Condition:Expr] UpdateStmt:Stmt* 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.BranchTargetStmt
                  extended by org.extendj.ast.ForStmt
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 206

Member Filters

API level:

Aspect:

Constructors

public ForStmt()
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 1
public ForStmt(List<Stmt> p0,
               Opt<Expr> p1,
               List<Stmt> p2,
               Stmt p3)
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 16

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.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 isDAafterInitialization(org.extendj.ast.Variable v)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 703
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
@ASTNodeAnnotation.Attribute
syn boolean isDUafterInit(org.extendj.ast.Variable v)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 1288
Aspect
DU
@ASTNodeAnnotation.Attribute
syn boolean isDUafterUpdate(org.extendj.ast.Variable v)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 1302
Aspect
DU
@ASTNodeAnnotation.Attribute
syn org.extendj.ast.SimpleSet localLookup(java.lang.String name)
Source
Declared in /home/jesper/git/extendj/java4/frontend/LookupVariable.jrag at line 151
Aspect
VariableScope
Source
Declared in /home/jesper/git/extendj/java4/frontend/LookupVariable.jrag at line 195
Aspect
VariableScope
Overrides:continueLabel in class Stmt
Source
Declared in /home/jesper/git/extendj/java4/frontend/NameCheck.jrag at line 478
Aspect
NameCheck
Overrides:canCompleteNormally in class Stmt
Source
Declared in /home/jesper/git/extendj/java4/frontend/UnreachableStatements.jrag at line 53
Aspect
UnreachableStatements
@ASTNodeAnnotation.Attribute
syn int variableScopeEndLabel(org.extendj.ast.CodeGeneration gen)
Source
Declared in /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag at line 70
Aspect
CodeGeneration
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1594
Aspect
CreateBCode
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1595
Aspect
CreateBCode
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1596
Aspect
CreateBCode
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1597
Aspect
CreateBCode
Overrides:break_label in class Stmt
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1621
Aspect
CreateBCode
Overrides:continue_label in class Stmt
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1645
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
@ASTNodeAnnotation.Attribute
inh org.extendj.ast.SimpleSet lookupVariable(java.lang.String name)
Overrides:lookupVariable in class Stmt
Source
Declared in /home/jesper/git/extendj/java4/frontend/LookupVariable.jrag at line 39
Aspect
VariableScope

Methods

public void prettyPrint(org.jastadd.util.PrettyPrinter out)
Manually implemented because it is too complex for a template.
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 91
Aspect
PrettyPrintUtil
public void typeCheck()
Overrides:typeCheck in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/TypeCheck.jrag at line 392
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 1599
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 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 25
public boolean mayHaveRewrite()
Overrides:mayHaveRewrite in class BranchTargetStmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 31
public void flushAttrCache()
Overrides:flushAttrCache in class BranchTargetStmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 37
public void flushCollectionCache()
Overrides:flushCollectionCache in class BranchTargetStmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 55
public void flushRewriteCache()
Overrides:flushRewriteCache in class BranchTargetStmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 61
public ForStmt clone()
              throws java.lang.CloneNotSupportedException
Overrides:clone in class BranchTargetStmt
Throws:
java.lang.CloneNotSupportedException
Source
Declared in /home/jesper/git/extendj/ASTNode at line 67
public ForStmt copy()
Overrides:copy in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 74
@Deprecated
public ForStmt 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 93
public ForStmt 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 103
public ForStmt 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 123
protected boolean is$Equal(ASTNode node)
Overrides:is$Equal in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 130
public void setInitStmtList(List<Stmt> list)
Replaces the InitStmt list.
Parameters:
list - The new list node to be used as the InitStmt list.
public int getNumInitStmt()
Retrieves the number of children in the InitStmt list.
Returns:
Number of children in the InitStmt list.
Retrieves the number of children in the InitStmt list. Calling this method will not trigger rewrites.
Returns:
Number of children in the InitStmt list.
public Stmt getInitStmt(int i)
Retrieves the element at index i in the InitStmt list.
Parameters:
i - Index of the element to return.
Returns:
The element at position i in the InitStmt list.
public boolean hasInitStmt()
Check whether the InitStmt list has any children.
Returns:
true if it has at least one child, false otherwise.
public void addInitStmt(Stmt node)
Append an element to the InitStmt list.
Parameters:
node - The element to append to the InitStmt list.
public void addInitStmtNoTransform(Stmt node)
public void setInitStmt(Stmt node,
                        int i)
Replaces the InitStmt list element at index i with the new node node.
Parameters:
node - The new node to replace the old list element.
i - The list index of the node to be replaced.
Retrieves the InitStmt list.
Returns:
The node representing the InitStmt list.
Retrieves the InitStmt list.

This method does not invoke AST transformations.

Returns:
The node representing the InitStmt list.
Retrieves the InitStmt list.
Returns:
The node representing the InitStmt list.
Retrieves the InitStmt list.

This method does not invoke AST transformations.

Returns:
The node representing the InitStmt list.
public void setConditionOpt(Opt<Expr> opt)
Replaces the optional node for the Condition child. This is the Opt node containing the child Condition, not the actual child!
Parameters:
opt - The new node to be used as the optional node for the Condition child.
public void setCondition(Expr node)
Replaces the (optional) Condition child.
Parameters:
node - The new node to be used as the Condition child.
public boolean hasCondition()
Check whether the optional Condition child exists.
Returns:
true if the optional Condition child exists, false if it does not.
Retrieves the (optional) Condition child.
Returns:
The Condition child, if it exists. Returns null otherwise.
Retrieves the optional node for the Condition child. This is the Opt node containing the child Condition, not the actual child!
Returns:
The optional node for child the Condition child.
Retrieves the optional node for child Condition. This is the Opt node containing the child Condition, not the actual child!

This method does not invoke AST transformations.

Returns:
The optional node for child Condition.
public void setUpdateStmtList(List<Stmt> list)
Replaces the UpdateStmt list.
Parameters:
list - The new list node to be used as the UpdateStmt list.
public int getNumUpdateStmt()
Retrieves the number of children in the UpdateStmt list.
Returns:
Number of children in the UpdateStmt list.
Retrieves the number of children in the UpdateStmt list. Calling this method will not trigger rewrites.
Returns:
Number of children in the UpdateStmt list.
public Stmt getUpdateStmt(int i)
Retrieves the element at index i in the UpdateStmt list.
Parameters:
i - Index of the element to return.
Returns:
The element at position i in the UpdateStmt list.
public boolean hasUpdateStmt()
Check whether the UpdateStmt list has any children.
Returns:
true if it has at least one child, false otherwise.
public void addUpdateStmt(Stmt node)
Append an element to the UpdateStmt list.
Parameters:
node - The element to append to the UpdateStmt list.
public void addUpdateStmtNoTransform(Stmt node)
public void setUpdateStmt(Stmt node,
                          int i)
Replaces the UpdateStmt list element at index i with the new node node.
Parameters:
node - The new node to replace the old list element.
i - The list index of the node to be replaced.
Retrieves the UpdateStmt list.
Returns:
The node representing the UpdateStmt list.
Retrieves the UpdateStmt list.

This method does not invoke AST transformations.

Returns:
The node representing the UpdateStmt list.
Retrieves the UpdateStmt list.
Returns:
The node representing the UpdateStmt list.
Retrieves the UpdateStmt list.

This method does not invoke AST transformations.

Returns:
The node representing the UpdateStmt list.
public void setStmt(Stmt node)
Replaces the Stmt child.
Parameters:
node - The new node to replace the Stmt child.
Retrieves the Stmt child.
Returns:
The current node used as the Stmt child.
Retrieves the Stmt child.

This method does not invoke AST transformations.

Returns:
The current node used as the Stmt child.
@ASTNodeAnnotation.Attribute
public boolean isDUbeforeCondition(org.extendj.ast.Variable v)
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.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 org.extendj.ast.SimpleSet Define_lookupVariable(ASTNode caller,
                                                       ASTNode child,
                                                       java.lang.String name)
Overrides:Define_lookupVariable in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java8/frontend/LookupVariable.jrag at line 30
protected boolean canDefine_lookupVariable(ASTNode caller,
                                           ASTNode child,
                                           java.lang.String name)
public org.extendj.ast.VariableScope Define_outerScope(ASTNode caller,
                                                       ASTNode child)
Overrides:Define_outerScope in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java8/frontend/NameCheck.jrag at line 30
protected boolean canDefine_outerScope(ASTNode caller,
                                       ASTNode child)
public boolean Define_insideLoop(ASTNode caller,
                                 ASTNode child)
Overrides:Define_insideLoop in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/NameCheck.jrag at line 441
protected boolean canDefine_insideLoop(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_variableScopeEndLabel(ASTNode caller,
                                        ASTNode child,
                                        org.extendj.ast.CodeGeneration gen)
Overrides:Define_variableScopeEndLabel in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag at line 67
protected boolean canDefine_variableScopeEndLabel(ASTNode caller,
                                                  ASTNode child,
                                                  org.extendj.ast.CodeGeneration gen)
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)
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 BranchTargetStmt
public org.extendj.ast.SimpleSet lookupVariable(java.lang.String name)

Fields

protected java.util.Map isDAafter_Variable_values
protected java.util.Map isDUafter_Variable_values
protected java.util.Map isDUbeforeCondition_Variable_values
protected java.util.Map localLookup_String_values
protected boolean canCompleteNormally_value
protected boolean cond_label_computed
protected int cond_label_value
protected boolean begin_label_computed
protected int begin_label_value
protected boolean update_label_computed
protected int update_label_value
protected boolean end_label_computed
protected int end_label_value
protected java.util.Map lookupVariable_String_values

Inherited Members

Attributes inherited from org.extendj.ast.BranchTargetStmt

Attributes inherited from org.extendj.ast.Stmt

Attributes inherited from org.extendj.ast.ASTNode

Methods inherited from class org.extendj.ast.BranchTargetStmt

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.BranchTargetStmt

Fields inherited from org.extendj.ast.Stmt

Fields inherited from org.extendj.ast.ASTNode

Fields inherited from beaver.Symbol

end
id
start
value