jltools.ext.jl.ast
Class Try_c

java.lang.Object
  |
  +--jltools.ext.jl.ast.Node_c
        |
        +--jltools.ext.jl.ast.Stmt_c
              |
              +--jltools.ext.jl.ast.Try_c
All Implemented Interfaces:
java.lang.Cloneable, Copy, Node, java.io.Serializable, Stmt, Try

public class Try_c
extends Stmt_c
implements Try

An immutable representation of a try block, one or more catch blocks, and an optional finally block.

See Also:
Serialized Form

Inner classes inherited from class jltools.ext.jl.ast.Node_c
Node_c.StringCodeWriter
 
Field Summary
protected  java.util.List catchBlocks
           
protected  <>Block finallyBlock
           
protected  <>Block tryBlock
           
 
Fields inherited from class jltools.ext.jl.ast.Node_c
ext, position
 
Constructor Summary
Try_c(Ext ext, Position pos, <>Block tryBlock, java.util.List catchBlocks, <>Block finallyBlock)
           
 
Method Summary
 java.util.List catchBlocks()
          Get the catch blocks of the statement.
 Try catchBlocks(java.util.List catchBlocks)
          Set the catch blocks of the statement.
 Node exceptionCheckOverride_(ExceptionChecker ec)
          Performs exceptionChecking.
 <>Block finallyBlock()
          Get the finally block of the statement.
 Try finallyBlock(<>Block finallyBlock)
          Set the finally block of the statement.
protected  Try_c reconstruct(<>Block tryBlock, java.util.List catchBlocks, <>Block finallyBlock)
          Reconstruct the statement.
 java.lang.String toString()
           
 void translate_(CodeWriter w, Translator tr)
          Translate the AST using the given code writer.
 <>Block tryBlock()
          Get the try block of the statement.
 Try tryBlock(<>Block tryBlock)
          Set the try block of the statement.
 Node visitChildren(NodeVisitor v)
          Visit the children of the statement.
 
Methods inherited from class jltools.ext.jl.ast.Node_c
buildTypes_, buildTypes, buildTypesOverride_, buildTypesOverride, copy, disambiguate_, disambiguate, disambiguateOverride_, disambiguateOverride, disambiguateTypes_, disambiguateTypes, disambiguateTypesOverride_, disambiguateTypesOverride, dump, enterScope, exceptionCheck_, exceptionCheck, exceptionCheckOverride, ext, ext, foldConstants_, foldConstants, foldConstantsOverride_, foldConstantsOverride, leaveScope, position, position, reconstructTypes_, reconstructTypes, translate, translateBlock, translateSubstmt, typeCheck_, typeCheck, typeCheckOverride_, typeCheckOverride, visit, visitList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jltools.ast.Try
finallyBlock, tryBlock
 
Methods inherited from interface jltools.ast.Node
buildTypes_, buildTypesOverride_, copy, disambiguate_, disambiguateOverride_, disambiguateTypes_, disambiguateTypesOverride_, dump, enterScope, exceptionCheck_, ext, ext, foldConstants_, foldConstantsOverride_, leaveScope, position, position, reconstructTypes_, typeCheck_, typeCheckOverride_, visit
 

Field Detail

tryBlock

protected <>Block tryBlock

catchBlocks

protected java.util.List catchBlocks

finallyBlock

protected <>Block finallyBlock
Constructor Detail

Try_c

public Try_c(Ext ext,
             Position pos,
             <>Block tryBlock,
             java.util.List catchBlocks,
             <>Block finallyBlock)
Method Detail

tryBlock

public <>Block tryBlock()
Get the try block of the statement.
Specified by:
tryBlock in interface Try

tryBlock

public Try tryBlock(<>Block tryBlock)
Set the try block of the statement.

catchBlocks

public java.util.List catchBlocks()
Get the catch blocks of the statement.
Specified by:
catchBlocks in interface Try

catchBlocks

public Try catchBlocks(java.util.List catchBlocks)
Set the catch blocks of the statement.
Specified by:
catchBlocks in interface Try

finallyBlock

public <>Block finallyBlock()
Get the finally block of the statement.
Specified by:
finallyBlock in interface Try

finallyBlock

public Try finallyBlock(<>Block finallyBlock)
Set the finally block of the statement.

reconstruct

protected Try_c reconstruct(<>Block tryBlock,
                            java.util.List catchBlocks,
                            <>Block finallyBlock)
Reconstruct the statement.

visitChildren

public Node visitChildren(NodeVisitor v)
Visit the children of the statement.
Specified by:
visitChildren in interface Node
Overrides:
visitChildren in class Node_c

exceptionCheckOverride_

public Node exceptionCheckOverride_(ExceptionChecker ec)
                             throws SemanticException
Performs exceptionChecking. This is a special method that is called via the exceptionChecker's override method (i.e, doesn't follow the standard model for visitation.
Specified by:
exceptionCheckOverride_ in interface Node
Overrides:
exceptionCheckOverride_ in class Node_c
Parameters:
ec - The ExceptionChecker that was run against the child node. It contains the exceptions that can be thrown by the try block.

toString

public java.lang.String toString()
Overrides:
toString in class Node_c

translate_

public void translate_(CodeWriter w,
                       Translator tr)
Description copied from interface: Node
Translate the AST using the given code writer.
Specified by:
translate_ in interface Node
Overrides:
translate_ in class Node_c
Following copied from interface: jltools.ast.Node
Parameters:
w - The code writer to which to write.
tr - The translation pass. This is not a visitor.