|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpolyglot.ast.Ext_c
polyglot.ast.JL_c
public class JL_c
JL_c is the super class of JL node delegates objects.
It defines default implementations of the methods which implement compiler
passes, dispatching to the node to perform the actual work of the pass.
Language extensions may subclass JL_c for individual node
classes or may reimplement all compiler passes in a new class implementing
the JL interface.
| Field Summary |
|---|
| Fields inherited from class polyglot.ast.Ext_c |
|---|
ext, node |
| Constructor Summary | |
|---|---|
JL_c()
|
|
| Method Summary | |
|---|---|
void |
addDecls(Context c)
Add any declarations to the context that should be in scope when visiting later sibling nodes. |
Node |
buildTypes(TypeBuilder tb)
Collects classes, methods, and fields from the AST rooted at this node and constructs type objects for these. |
NodeVisitor |
buildTypesEnter(TypeBuilder tb)
Collects classes, methods, and fields from the AST rooted at this node and constructs type objects for these. |
Node |
checkConstants(ConstantChecker cc)
Check if the node is a compile-time constant. |
Node |
copy(ExtensionInfo extInfo)
Produce a copy of this node using the given ExtensionInfo. |
Node |
copy(NodeFactory nf)
Produce a copy of this node using the given NodeFactory. |
Node |
disambiguate(AmbiguityRemover ar)
Remove any remaining ambiguities from the AST. |
NodeVisitor |
disambiguateEnter(AmbiguityRemover ar)
Remove any remaining ambiguities from the AST. |
Node |
disambiguateOverride(Node parent,
AmbiguityRemover ar)
Remove any remaining ambiguities from the AST. |
void |
dump(java.io.OutputStream os)
Dump the AST for debugging. |
void |
dump(java.io.Writer w)
Dump the AST for debugging. |
Context |
enterChildScope(Node child,
Context c)
Push a new scope for visiting the child node child. |
Context |
enterScope(Context c)
Push a new scope upon entering this node, and add any declarations to the context that should be in scope when visiting children of this node. |
Node |
exceptionCheck(ExceptionChecker ec)
Check that exceptions are properly propagated throughout the AST. |
NodeVisitor |
exceptionCheckEnter(ExceptionChecker ec)
Check that exceptions are properly propagated throughout the AST. |
JL |
jl()
The JL object we dispatch to, by default, the node
itself, but possibly another delegate. |
void |
prettyPrint(CodeWriter w,
PrettyPrinter pp)
Pretty-print the AST using the given code writer. |
void |
prettyPrint(java.io.OutputStream os)
Pretty-print the AST for debugging. |
void |
prettyPrint(java.io.Writer w)
Pretty-print the AST for debugging. |
java.util.List |
throwTypes(TypeSystem ts)
List of Types of exceptions that might get thrown. |
void |
translate(CodeWriter w,
Translator tr)
Translate the AST using the given code writer. |
Node |
typeCheck(TypeChecker tc)
Type check the AST. |
NodeVisitor |
typeCheckEnter(TypeChecker tc)
Type check the AST. |
Node |
typeCheckOverride(Node parent,
TypeChecker tc)
Type check the AST. |
Node |
visitChildren(NodeVisitor v)
Visit the children of the node. |
| Methods inherited from class polyglot.ast.Ext_c |
|---|
copy, dump, ext, ext, init, node, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface polyglot.ast.JL |
|---|
init, node |
| Methods inherited from interface polyglot.util.Copy |
|---|
copy |
| Constructor Detail |
|---|
public JL_c()
| Method Detail |
|---|
public JL jl()
JL object we dispatch to, by default, the node
itself, but possibly another delegate.
public Node visitChildren(NodeVisitor v)
visitChildren in interface NodeOpsv - The visitor that will traverse/rewrite the AST.
this.public Context enterScope(Context c)
addDecls when leaving the node
for that.
enterScope in interface NodeOpsc - the current Context
Context to be used for visiting this node.
public Context enterChildScope(Node child,
Context c)
child.
The default behavior is to delegate the call to the child node, and let
it add appropriate declarations that should be in scope. However,
this method gives parent nodes have the ability to modify this behavior.
enterChildScope in interface NodeOpschild - the child node about to be entered.c - the current Context
Context to be used for visiting node
childpublic void addDecls(Context c)
addDecls in interface NodeOpsc - The context to which to add declarations.
public NodeVisitor buildTypesEnter(TypeBuilder tb)
throws SemanticException
TypeSystem.
This method is called by the enter() method of the
visitor. The * method should perform work that should be done
before visiting the children of the node. The method may return
this or a new copy of the node on which
visitChildren() and leave() will be
invoked.
buildTypesEnter in interface NodeOpstb - The visitor which adds new type objects to the
TypeSystem.
SemanticException
public Node buildTypes(TypeBuilder tb)
throws SemanticException
TypeSystem.
This method is called by the leave() method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this or a new copy of the node which will be
installed as a child of the node's parent.
buildTypes in interface NodeOpstb - The visitor which adds new type objects to the
TypeSystem.
SemanticException
public Node disambiguateOverride(Node parent,
AmbiguityRemover ar)
throws SemanticException
enter() method of the
visitor. The * method should perform work that should be done
before visiting the children of the node. The method may return
this or a new copy of the node on which
visitChildren() and leave() will be
invoked.
disambiguateOverride in interface NodeOpsar - The visitor which disambiguates.
SemanticException
public NodeVisitor disambiguateEnter(AmbiguityRemover ar)
throws SemanticException
NodeOpsenter() method of the
visitor. The * method should perform work that should be done
before visiting the children of the node. The method may return
this or a new copy of the node on which
visitChildren() and leave() will be
invoked.
disambiguateEnter in interface NodeOpsar - The visitor which disambiguates.
SemanticException
public Node disambiguate(AmbiguityRemover ar)
throws SemanticException
leave() method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this or a new copy of the node which will be
installed as a child of the node's parent.
disambiguate in interface NodeOpsar - The visitor which disambiguates.
SemanticException
public Node typeCheckOverride(Node parent,
TypeChecker tc)
throws SemanticException
enter() method of the
visitor. The * method should perform work that should be done
before visiting the children of the node. The method may return
this or a new copy of the node on which
visitChildren() and leave() will be
invoked.
typeCheckOverride in interface NodeOpstc - The type checking visitor.
SemanticException
public NodeVisitor typeCheckEnter(TypeChecker tc)
throws SemanticException
NodeOpsenter() method of the
visitor. The * method should perform work that should be done
before visiting the children of the node. The method may return
this or a new copy of the node on which
visitChildren() and leave() will be
invoked.
typeCheckEnter in interface NodeOpstc - The type checking visitor.
SemanticException
public Node typeCheck(TypeChecker tc)
throws SemanticException
leave() method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this or a new copy of the node which will be
installed as a child of the node's parent.
typeCheck in interface NodeOpstc - The type checking visitor.
SemanticException
public Node checkConstants(ConstantChecker cc)
throws SemanticException
NodeOpsleave() method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this or a new copy of the node which will be
installed as a child of the node's parent.
checkConstants in interface NodeOpscc - The constant checking visitor.
SemanticException
public NodeVisitor exceptionCheckEnter(ExceptionChecker ec)
throws SemanticException
enter() method of the
visitor. The * method should perform work that should be done
before visiting the children of the node. The method may return
this or a new copy of the node on which
visitChildren() and leave() will be
invoked.
exceptionCheckEnter in interface NodeOpsec - The visitor.
SemanticException
public Node exceptionCheck(ExceptionChecker ec)
throws SemanticException
leave() method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this or a new copy of the node which will be
installed as a child of the node's parent.
exceptionCheck in interface NodeOpsec - The visitor.
SemanticExceptionpublic java.util.List throwTypes(TypeSystem ts)
throwTypes in interface NodeOpspublic void dump(java.io.OutputStream os)
dump in interface NodeOpspublic void dump(java.io.Writer w)
dump in interface NodeOpspublic void prettyPrint(java.io.OutputStream os)
prettyPrint in interface NodeOpspublic void prettyPrint(java.io.Writer w)
prettyPrint in interface NodeOps
public void prettyPrint(CodeWriter w,
PrettyPrinter pp)
prettyPrint in interface NodeOpsw - The code writer to which to write.pp - The pretty printer. This is not a visitor.
public void translate(CodeWriter w,
Translator tr)
translate in interface NodeOpsw - The code writer to which to write.tr - The translation pass. This is not a visitor.public Node copy(NodeFactory nf)
NodeOps
copy in interface NodeOps
public Node copy(ExtensionInfo extInfo)
throws SemanticException
NodeOps
copy in interface NodeOpsSemanticException - If the type information cannot be copied.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||