polyglot.ext.ibex.ast
Class RhsNode_c
java.lang.Object
polyglot.ext.jl.ast.Node_c
polyglot.ext.jl.ast.Term_c
polyglot.ext.ibex.ast.RhsNode_c
- All Implemented Interfaces:
- java.lang.Cloneable, Copy, JL, Node, NodeOps, RhsNode, Term
- Direct Known Subclasses:
- RhsCaseNode_c, RhsMergeNode_c
- public abstract class RhsNode_c
- extends Term_c
- implements RhsNode
Tag interface for elements of a rule RHS.
Methods inherited from class polyglot.ext.jl.ast.Node_c |
addDecls, addMembers, addMembersEnter, addMembersOverride, buildTypesEnter, buildTypesOverride, childExpectedType, copy, del, del, disambiguateOverride, dump, enterScope, exceptionCheck, exceptionCheckEnter, exceptionCheckOverride, ext, ext, ext, ext, init, node, position, position, prettyPrint, print, printBlock, printSubStmt, throwTypes, toString, translate, typeCheck, typeCheckEnter, typeCheckOverride, visit, visitChild, visitEdge, visitList |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface polyglot.ast.Node |
childExpectedType, del, del, dump, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList |
Methods inherited from interface polyglot.ast.JL |
init, node |
Methods inherited from interface polyglot.ast.NodeOps |
addDecls, addMembers, addMembersEnter, buildTypesEnter, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter |
Methods inherited from interface polyglot.util.Copy |
copy |
RhsNode_c
public RhsNode_c(Position pos,
Block action)
action
public Block action()
- Specified by:
action
in interface RhsNode
action
public RhsNode action(Block action)
- Specified by:
action
in interface RhsNode
rhs
public Rhs rhs()
- Specified by:
rhs
in interface RhsNode
rhs
public RhsNode rhs(Rhs rhs)
visitChildren
public abstract Node visitChildren(NodeVisitor v)
- Description copied from interface:
NodeOps
- Visit the children of the node.
- Specified by:
visitChildren
in interface NodeOps
- Overrides:
visitChildren
in class Node_c
buildTypes
public Node buildTypes(TypeBuilder tb)
throws SemanticException
- Description copied from interface:
NodeOps
- Collects classes, methods, and fields from the AST rooted at this node
and constructs type objects for these. These type objects may be
ambiguous. Inserts classes into the
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.
- Specified by:
buildTypes
in interface NodeOps
- Overrides:
buildTypes
in class Node_c
- Throws:
SemanticException
makeRhs
protected abstract Node makeRhs(IbexTypeSystem ts)
disambiguateEnter
public NodeVisitor disambiguateEnter(AmbiguityRemover ar)
throws SemanticException
- Build type objects for the method.
- Specified by:
disambiguateEnter
in interface NodeOps
- Overrides:
disambiguateEnter
in class Node_c
- Throws:
SemanticException
disambiguate
public Node disambiguate(AmbiguityRemover ar)
throws SemanticException
- Description copied from interface:
NodeOps
- Remove any remaining ambiguities from the AST.
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.
- Specified by:
disambiguate
in interface NodeOps
- Overrides:
disambiguate
in class Node_c
- Throws:
SemanticException
enterScope
public Context enterScope(Context c)
- Description copied from interface:
NodeOps
- 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.
This should not update the old context
imperatively. Use
addDecls
when leaving the node
for that.
- Specified by:
enterScope
in interface NodeOps
- Overrides:
enterScope
in class Node_c
- Parameters:
c
- the current Context
- Returns:
- the
Context
to be used for visiting this node.
entry
public Term entry()
- Return the first (sub)term performed when evaluating this
term.
- Specified by:
entry
in interface Term
- Specified by:
entry
in class Term_c
acceptCFG
public java.util.List acceptCFG(CFGBuilder v,
java.util.List succs)
- Visit this term in evaluation order.
- Specified by:
acceptCFG
in interface Term
- Specified by:
acceptCFG
in class Term_c
rewrite
public Node rewrite(Rewriter rw)