org.extendj.ast
node type BasicTWR

General Info

Production
BasicTWR : Stmt ::= Resource:ResourceDeclaration 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.BasicTWR
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable<ASTNode>, org.jastadd.util.PrettyPrintable

Description

Source
Declared in /home/jesper/git/extendj/java7/grammar/BasicTWR.ast at line 1

Member Filters

API level:

Aspect:

Constructors

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

Attributes

@ASTNodeAnnotation.Attribute
syn org.extendj.ast.SimpleSet localLookup(java.lang.String name)
Source
Declared in /home/jesper/git/extendj/java7/backend/MultiCatch.jrag at line 100
Aspect
MultiCatch
Source
Declared in /home/jesper/git/extendj/java7/backend/MultiCatch.jrag at line 107
Aspect
MultiCatch
@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/java7/backend/MultiCatch.jrag at line 111
Aspect
MultiCatch

Methods

public void createBCode(org.extendj.ast.CodeGeneration gen)
The general structure of the basic try-with-resources:

 RESOURCE
 BLOCK
 
 Primary Exception Handler
 Automatic Closing of Resource
 Suppressed Exception Handler
 re-throw primary exception
 Automatic Closing of Resource
 
Pseudocode for basic try-with-resources:

 0  .resourceBegin
 1  emit RESOURCE
 0  store resource
 0  .resourceEnd
 
 0  .blockBegin
 0  emit BLOCK
 0  .blockEnd
 0  goto outerFinally
 
 1  .resourceException
 1  throw
 
 #if BLOCK is not empty:
 
 1  .catchPrimary
 0  store primary
 
 0  .tryCloseBegin
 1  load resource
 0  ifnull innerFinally
 1  load resource
 0  invoke java.lang.AutoCloseable.close()
 0  .tryCloseEnd
 
 0  goto innerFinally
 
 1  .catchSuppressed
 0  store suppressed
 1  load primary
 2  load suppressed
 0  invoke java.lang.Throwable.addSuppressed(Throwable)
 
 0  .innerFinally
 1  load primary
 1  throw
 
 #endif BLOCK is not empty
 
 0  .outerFinally
 1  load resource
 0  ifnull tryEnd
 1  load resource
 0  invoke java.lang.AutoCloseable.close()
 
 0  .tryEnd
 
 Exception Table:
 resourceBegin .. resourceEnd : resourceException
 blockBegin .. blockEnd : catchPrimary
 tryCloseBegin .. tryCloseEnd : catchSuppressed
 
Overrides:createBCode in class Stmt
Source
Declared in /home/jesper/git/extendj/java7/backend/TryWithResources.jrag at line 157
Aspect
TryWithResources
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 20
public boolean mayHaveRewrite()
Overrides:mayHaveRewrite in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 26
public void flushAttrCache()
Overrides:flushAttrCache in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 32
public void flushCollectionCache()
Overrides:flushCollectionCache in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 41
public void flushRewriteCache()
Overrides:flushRewriteCache in class Stmt
Source
Declared in /home/jesper/git/extendj/ASTNode at line 47
public BasicTWR clone()
               throws java.lang.CloneNotSupportedException
Overrides:clone in class Stmt
Throws:
java.lang.CloneNotSupportedException
Source
Declared in /home/jesper/git/extendj/ASTNode at line 53
public BasicTWR copy()
Overrides:copy in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 60
@Deprecated
public BasicTWR 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 79
public BasicTWR 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 89
public BasicTWR 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 109
protected boolean is$Equal(ASTNode node)
Overrides:is$Equal in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 116
public void setResource(ResourceDeclaration node)
Replaces the Resource child.
Parameters:
node - The new node to replace the Resource child.
Retrieves the Resource child.
Returns:
The current node used as the Resource child.
Retrieves the Resource child.

This method does not invoke AST transformations.

Returns:
The current node used as the Resource 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 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 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 Stmt
public org.extendj.ast.SimpleSet lookupVariable(java.lang.String name)

Fields

protected java.util.Map localLookup_String_values
protected java.util.Map lookupVariable_String_values

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