jltools.ext.jl.ast
Class AbstractNew_c
java.lang.Object
|
+--jltools.ext.jl.ast.Node_c
|
+--jltools.ext.jl.ast.Expr_c
|
+--jltools.ext.jl.ast.AbstractNew_c
- All Implemented Interfaces:
- java.lang.Cloneable, Copy, Expr, Node, Prefix, Receiver, java.io.Serializable, Typed
- Direct Known Subclasses:
- New_c, QualifiedNew_c
- public abstract class AbstractNew_c
- extends Expr_c
A New is an immutable representation of the
use of the new
operator to create a new instance of a class.
In addition to the type of the class being created, a
New
has a list of arguments to be passed to the
constructor of the object and an optional ClassDecl
used to
support anonymous classes. Such an expression may also be proceeded
by an primary expression which specifies the context in which the
object is being created.
- See Also:
- Serialized Form
Fields inherited from class jltools.ext.jl.ast.Expr_c |
type |
Methods inherited from class jltools.ext.jl.ast.Node_c |
buildTypes, buildTypesOverride, copy, disambiguate_, disambiguate, disambiguateOverride, disambiguateTypes_, disambiguateTypes, disambiguateTypesOverride, enterScope, exceptionCheck, exceptionCheckOverride_, exceptionCheckOverride, ext, ext, foldConstants_, foldConstants, foldConstantsOverride, leaveScope, position, position, reconstructTypes, toString, translate, translateBlock, translateSubstmt, typeCheck_, typeCheck, 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.Node |
copy, disambiguate_, disambiguateTypes_, enterScope, exceptionCheckOverride_, ext, ext, foldConstants_, leaveScope, position, position, typeCheck_, visit |
arguments
protected java.util.List arguments
body
protected ClassBody body
ci
protected ConstructorInstance ci
AbstractNew_c
public AbstractNew_c(Ext ext,
Position pos,
java.util.List arguments,
ClassBody body)
constructorInstance
public ConstructorInstance constructorInstance()
constructorInstance
public AbstractNew_c constructorInstance(ConstructorInstance ci)
arguments
public java.util.List arguments()
setArguments
protected Expr setArguments(java.util.List arguments)
body
public ClassBody body()
setBody
protected AbstractNew_c setBody(ClassBody body)
visitNonBodyChildren
protected abstract AbstractNew_c visitNonBodyChildren(NodeVisitor v)
visitChildren
public Node visitChildren(NodeVisitor v)
- Description copied from interface:
Node
- Visit the children of the node.
- Overrides:
visitChildren
in class Node_c
buildTypesOverride_
public Node buildTypesOverride_(TypeBuilder tb)
- Description copied from interface:
Node
- Collects classes, methods, and fields from the AST rooted at this node
and constructs type objects for these. These type objects may be
ambiguous.
- Overrides:
buildTypesOverride_
in class Node_c
- Following copied from interface:
jltools.ast.Node
- Parameters:
cb
- The visitor which adds new type objects to the
TypeSystem
.
disambiguateTypesOverride_
public Node disambiguateTypesOverride_(TypeAmbiguityRemover sc)
- Description copied from interface:
Node
- Constructs a context for each type declared in the AST.
A context is used to look up names when cleaning class signatures.
- Overrides:
disambiguateTypesOverride_
in class Node_c
- Following copied from interface:
jltools.ast.Node
- Parameters:
cb
- The visitor which builds contexts.
disambiguateOverride_
public Node disambiguateOverride_(AmbiguityRemover ar)
- Description copied from interface:
Node
- Remove any remaining ambiguities from the AST.
- Overrides:
disambiguateOverride_
in class Node_c
- Following copied from interface:
jltools.ast.Node
- Parameters:
ar
- The visitor which disambiguates.
foldConstantsOverride_
public Node foldConstantsOverride_(ConstantFolder cf)
- Description copied from interface:
Node
- Fold constants in the AST.
- Overrides:
foldConstantsOverride_
in class Node_c
- Following copied from interface:
jltools.ast.Node
- Parameters:
cf
- The constant folding visitor.
typeCheckOverride_
public abstract Node typeCheckOverride_(TypeChecker tc)
throws SemanticException
- Description copied from interface:
Node
- Type check the AST.
- Overrides:
typeCheckOverride_
in class Node_c
- Following copied from interface:
jltools.ast.Node
- Parameters:
tc
- The type checking visitor.
typeCheckEpilogue
protected Node typeCheckEpilogue(ClassType ct,
TypeChecker tc)
throws SemanticException
typeCheckBody
public ClassBody typeCheckBody(TypeChecker tc,
ParsedClassType ct)
throws SemanticException
exceptionCheck_
public Node exceptionCheck_(ExceptionChecker ec)
throws SemanticException
- Overrides:
exceptionCheck_
in class Node_c
translate_
public abstract void translate_(CodeWriter w,
Translator tr)
- Description copied from interface:
Node
- Translate the AST using the given code writer.
- 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.
translateEpilogue
protected void translateEpilogue(CodeWriter w,
Translator tr)