|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object polyglot.ext.jl.ast.Ext_c polyglot.ext.jl.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.ext.jl.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 |
addMembers(AddMemberVisitor am)
Adds disambiguated methods and fields to the types. |
NodeVisitor |
addMembersEnter(AddMemberVisitor am)
Adds disambiguated methods and fields to the types. |
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 |
disambiguate(AmbiguityRemover ar)
Remove any remaining ambiguities from the AST. |
NodeVisitor |
disambiguateEnter(AmbiguityRemover ar)
Remove any remaining ambiguities from the AST. |
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. |
Context |
enterScope(Node child,
Context c)
Push a new scope for visiting the child node child . |
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. |
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 |
visitChildren(NodeVisitor v)
Visit the children of the node. |
Methods inherited from class polyglot.ext.jl.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 NodeOps
v
- The visitor that will traverse/rewrite the AST.
this
.public Context enterScope(Context c)
addDecls
when leaving the node
for that.
enterScope
in interface NodeOps
c
- the current Context
Context
to be used for visiting this node.public Context enterScope(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.
enterScope
in interface NodeOps
child
- the child node about to be entered.c
- the current Context
Context
to be used for visiting node
child
public void addDecls(Context c)
addDecls
in interface NodeOps
c
- 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 NodeOps
tb
- 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 NodeOps
tb
- The visitor which adds new type objects to the
TypeSystem
.
SemanticException
public NodeVisitor disambiguateEnter(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.
disambiguateEnter
in interface NodeOps
ar
- 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 NodeOps
ar
- The visitor which disambiguates.
SemanticException
public NodeVisitor addMembersEnter(AddMemberVisitor am) 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.
addMembersEnter
in interface NodeOps
am
- The visitor which builds types.
SemanticException
public Node addMembers(AddMemberVisitor am) 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.
addMembers
in interface NodeOps
am
- The visitor which builds types.
SemanticException
public NodeVisitor typeCheckEnter(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.
typeCheckEnter
in interface NodeOps
tc
- 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 NodeOps
tc
- The type 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 NodeOps
ec
- 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 NodeOps
ec
- The visitor.
SemanticException
public java.util.List throwTypes(TypeSystem ts)
throwTypes
in interface NodeOps
public void prettyPrint(CodeWriter w, PrettyPrinter pp)
prettyPrint
in interface NodeOps
w
- 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 NodeOps
w
- The code writer to which to write.tr
- The translation pass. This is not a visitor.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |