org.extendj.ast
node type TryStmt

General Info

Production
TryStmt : Stmt ::= Block CatchClause* [Finally:Block] ExceptionHandler:Block;
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.TryStmt
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable<ASTNode>, org.jastadd.util.PrettyPrintable
Direct Known Subclasses:
TryWithResources

Description

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

Member Filters

API level:

Aspect:

Constructors

public TryStmt()
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 1
public TryStmt(Block p0,
               List<CatchClause> p1,
               Opt<Block> p2)
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 15

Attributes

@ASTNodeAnnotation.Attribute
syn java.util.Collection<Stmt> branches()
All branches that reach this node.
Source
Declared in /home/jesper/git/extendj/java4/frontend/BranchTarget.jrag at line 159
Aspect
BranchTarget
All branches that escape this node
Source
Declared in /home/jesper/git/extendj/java4/frontend/BranchTarget.jrag at line 171
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 isDUafterFinally(org.extendj.ast.Variable v)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 1050
Aspect
DU
@ASTNodeAnnotation.Attribute
syn boolean isDAafterFinally(org.extendj.ast.Variable v)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 1053
Aspect
DU
@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
Returns:
true if this TyStmt has a non-empty finally block
Source
Declared in /home/jesper/git/extendj/java4/frontend/ExceptionHandling.jrag at line 36
Aspect
ExceptionHandling
The block of the try statement can throw an exception of a type assignable to the given type.
Source
Declared in /home/jesper/git/extendj/java4/frontend/ExceptionHandling.jrag at line 268
Aspect
ExceptionHandling
Copy of the finally block for catch-all exception handling.
Source
Declared in /home/jesper/git/extendj/java4/frontend/NTAFinally.jrag at line 68
Aspect
NTAFinally
Overrides:canCompleteNormally in class Stmt
Source
Declared in /home/jesper/git/extendj/java4/frontend/UnreachableStatements.jrag at line 53
Aspect
UnreachableStatements
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
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1711
Aspect
CreateBCode
@ASTNodeAnnotation.Attribute
syn org.extendj.ast.FinallyHost outerFinallyHost()
Outer finally host with a finally block that can complete normally
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1762
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
Source
Declared in /home/jesper/git/extendj/java4/backend/NTAFinally.jrag at line 32
Aspect
NTAFinally
Source
Declared in /home/jesper/git/extendj/java4/frontend/ExceptionHandling.jrag at line 82
Aspect
ExceptionHandling
Source
Declared in /home/jesper/git/extendj/java4/frontend/UnreachableStatements.jrag at line 200
Aspect
UnreachableStatements
Source
Declared in /home/jesper/git/extendj/java4/frontend/UnreachableStatements.jrag at line 201
Aspect
UnreachableStatements
Source
Declared in /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag at line 479
Aspect
CodeGeneration

Methods

public void collectBranches(java.util.Collection<Stmt> c)
Overrides:collectBranches in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/BranchTarget.jrag at line 112
Aspect
BranchTarget
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 1042
Aspect
DU
protected boolean reachedException(TypeDecl type)
Overrides:reachedException in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/ExceptionHandling.jrag at line 280
Aspect
ExceptionHandling
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 440
Aspect
Java4PrettyPrint
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 1714
Aspect
CreateBCode
public void emitExceptionHandler(org.extendj.ast.CodeGeneration gen,
                                 int start_lbl,
                                 int end_lbl,
                                 int handler_lbl,
                                 boolean needsHandler)
Generate catch-all (finally)
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 1775
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 23
public boolean mayHaveRewrite()
Overrides:mayHaveRewrite in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 29
public void flushAttrCache()
Overrides:flushAttrCache in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 35
public void flushCollectionCache()
Overrides:flushCollectionCache in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 55
public void flushRewriteCache()
Overrides:flushRewriteCache in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 61
public TryStmt clone()
              throws java.lang.CloneNotSupportedException
Overrides:clone in class Stmt
Throws:
java.lang.CloneNotSupportedException
Source
Declared in /home/jesper/git/extendj/ASTNode at line 67
public TryStmt copy()
Overrides:copy in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 74
@Deprecated
public TryStmt 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 93
public TryStmt 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 103
public TryStmt 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 128
protected boolean is$Equal(ASTNode node)
Overrides:is$Equal in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 135
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 setCatchClauseList(List<CatchClause> list)
Replaces the CatchClause list.
Parameters:
list - The new list node to be used as the CatchClause list.
public int getNumCatchClause()
Retrieves the number of children in the CatchClause list.
Returns:
Number of children in the CatchClause list.
Retrieves the number of children in the CatchClause list. Calling this method will not trigger rewrites.
Returns:
Number of children in the CatchClause list.
Retrieves the element at index i in the CatchClause list.
Parameters:
i - Index of the element to return.
Returns:
The element at position i in the CatchClause list.
public boolean hasCatchClause()
Check whether the CatchClause list has any children.
Returns:
true if it has at least one child, false otherwise.
public void addCatchClause(CatchClause node)
Append an element to the CatchClause list.
Parameters:
node - The element to append to the CatchClause list.
public void setCatchClause(CatchClause node,
                           int i)
Replaces the CatchClause 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 CatchClause list.
Returns:
The node representing the CatchClause list.
Retrieves the CatchClause list.

This method does not invoke AST transformations.

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

This method does not invoke AST transformations.

Returns:
The node representing the CatchClause list.
public void setFinallyOpt(Opt<Block> opt)
Replaces the optional node for the Finally child. This is the Opt node containing the child Finally, not the actual child!
Parameters:
opt - The new node to be used as the optional node for the Finally child.
public void setFinally(Block node)
Replaces the (optional) Finally child.
Parameters:
node - The new node to be used as the Finally child.
public boolean hasFinally()
Check whether the optional Finally child exists.
Returns:
true if the optional Finally child exists, false if it does not.
public Block getFinally()
Retrieves the (optional) Finally child.
Returns:
The Finally child, if it exists. Returns null otherwise.
Retrieves the optional node for the Finally child. This is the Opt node containing the child Finally, not the actual child!
Returns:
The optional node for child the Finally child.
Retrieves the optional node for child Finally. This is the Opt node containing the child Finally, not the actual child!

This method does not invoke AST transformations.

Returns:
The optional node for child Finally.
Retrieves the ExceptionHandler child.

This method does not invoke AST transformations.

Returns:
The current node used as the ExceptionHandler child.
Retrieves the child position of the optional child ExceptionHandler.
Returns:
The the child position of the optional child ExceptionHandler.
@ASTNodeAnnotation.Attribute
public boolean isDUbefore(org.extendj.ast.Variable v)
public org.extendj.ast.FinallyHost Define_enclosingFinally(ASTNode caller,
                                                           ASTNode child,
                                                           Stmt branch)
Overrides:Define_enclosingFinally in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/BranchTarget.jrag at line 262
protected boolean canDefine_enclosingFinally(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 boolean Define_handlesException(ASTNode caller,
                                       ASTNode child,
                                       TypeDecl exceptionType)
Overrides:Define_handlesException in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java7/frontend/TryWithResources.jrag at line 113
protected boolean canDefine_handlesException(ASTNode caller,
                                             ASTNode child,
                                             TypeDecl exceptionType)
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_reachableCatchClause(ASTNode caller,
                                           ASTNode child,
                                           TypeDecl exceptionType)
Overrides:Define_reachableCatchClause in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/UnreachableStatements.jrag at line 185
protected boolean canDefine_reachableCatchClause(ASTNode caller,
                                                 ASTNode child,
                                                 TypeDecl exceptionType)
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)
public java.util.Collection<TypeDecl> Define_caughtExceptions(ASTNode caller,
                                                              ASTNode child)
Overrides:Define_caughtExceptions in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag at line 221
protected boolean canDefine_caughtExceptions(ASTNode caller,
                                             ASTNode child)
Overrides:rewriteTo in class Stmt
public boolean isDUafterFinally(org.extendj.ast.Variable v)
public boolean isDAafterFinally(org.extendj.ast.Variable v)
public org.extendj.ast.FinallyHost enclosingFinally(Stmt branch)

Fields

protected boolean branches_computed
protected java.util.Collection<Stmt> branches_value
protected boolean escapedBranches_computed
protected java.util.Collection<Stmt> escapedBranches_value
protected java.util.Map isDAafter_Variable_values
protected java.util.Map isDUbefore_Variable_values
protected java.util.Map isDUafter_Variable_values
protected boolean hasNonEmptyFinally_computed
protected boolean hasNonEmptyFinally_value
protected java.util.Map catchableException_TypeDecl_values
protected boolean canCompleteNormally_value
protected boolean fallthrough_label_computed
protected boolean label_end_computed
protected int label_end_value
protected java.util.Map handlesException_TypeDecl_values
protected boolean typeError_computed

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