polyglot.ext.ibex.ast
Class RuleDecl_c

java.lang.Object
  extended bypolyglot.ext.jl.ast.Node_c
      extended bypolyglot.ext.jl.ast.Term_c
          extended bypolyglot.ext.ibex.ast.RuleDecl_c
All Implemented Interfaces:
ClassMember, java.lang.Cloneable, Copy, IbexClassMember, JL, Node, NodeOps, RuleDecl, Term

public class RuleDecl_c
extends Term_c
implements RuleDecl

Node representing a semantic action.


Field Summary
 
Fields inherited from class polyglot.ext.jl.ast.Term_c
reachable
 
Fields inherited from class polyglot.ext.jl.ast.Node_c
del, ext, position
 
Constructor Summary
RuleDecl_c(Position pos, Flags flags, TypeNode type, java.lang.String name, java.util.List choices, boolean isStart)
           
 
Method Summary
 java.util.List acceptCFG(CFGBuilder v, java.util.List succs)
          Visit this term in evaluation order.
 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.
 java.util.List choices()
           
 RuleDecl choices(java.util.List choices)
           
 CodeInstance codeInstance()
           
 Node disambiguate(AmbiguityRemover ar)
          Remove any remaining ambiguities from the AST.
 NodeVisitor disambiguateEnter(AmbiguityRemover ar)
          Build type objects for the method.
 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.
 Term entry()
          Return the first (sub)term performed when evaluating this term.
 Flags flags()
           
 RuleDecl flags(Flags flags)
           
 boolean isStart()
           
 RuleDecl isStart(boolean isStart)
           
protected  Nonterminal makeNonterminal(ParserType ct, IbexTypeSystem ts)
           
 java.lang.String name()
           
 RuleDecl name(java.lang.String name)
           
 Nonterminal nonterminal()
           
 RuleDecl nonterminal(Nonterminal nonterminal)
           
protected  RuleDecl_c reconstruct(TypeNode type, java.util.List choices)
           
 java.util.List rewrite(Rewriter rw)
           
 TypeNode type()
           
 RuleDecl type(TypeNode type)
           
 Node typeCheck(TypeChecker tc)
          Type check the method.
 Node visitChildren(NodeVisitor v)
          Visit the children of the node.
 
Methods inherited from class polyglot.ext.jl.ast.Term_c
listEntry, reachable, reachable
 
Methods inherited from class polyglot.ext.jl.ast.Node_c
addDecls, addMembers, addMembersOverride, 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, 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, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, throwTypes, translate, typeCheckEnter
 
Methods inherited from interface polyglot.util.Copy
copy
 
Methods inherited from interface polyglot.ast.Term
reachable, reachable
 

Constructor Detail

RuleDecl_c

public RuleDecl_c(Position pos,
                  Flags flags,
                  TypeNode type,
                  java.lang.String name,
                  java.util.List choices,
                  boolean isStart)
Method Detail

flags

public Flags flags()
Specified by:
flags in interface RuleDecl

flags

public RuleDecl flags(Flags flags)
Specified by:
flags in interface RuleDecl

type

public TypeNode type()
Specified by:
type in interface RuleDecl

type

public RuleDecl type(TypeNode type)
Specified by:
type in interface RuleDecl

name

public java.lang.String name()
Specified by:
name in interface RuleDecl

name

public RuleDecl name(java.lang.String name)
Specified by:
name in interface RuleDecl

isStart

public boolean isStart()
Specified by:
isStart in interface RuleDecl

isStart

public RuleDecl isStart(boolean isStart)
Specified by:
isStart in interface RuleDecl

choices

public java.util.List choices()
Specified by:
choices in interface RuleDecl

choices

public RuleDecl choices(java.util.List choices)
Specified by:
choices in interface RuleDecl

nonterminal

public Nonterminal nonterminal()

nonterminal

public RuleDecl nonterminal(Nonterminal nonterminal)

codeInstance

public CodeInstance codeInstance()

reconstruct

protected RuleDecl_c reconstruct(TypeNode type,
                                 java.util.List choices)

visitChildren

public 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

buildTypesEnter

public NodeVisitor buildTypesEnter(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 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.

Specified by:
buildTypesEnter in interface NodeOps
Overrides:
buildTypesEnter in class Node_c
Throws:
SemanticException

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

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

addMembersEnter

public NodeVisitor addMembersEnter(AddMemberVisitor am)
Description copied from interface: NodeOps
Adds disambiguated methods and fields to the types. 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.

Specified by:
addMembersEnter in interface NodeOps
Overrides:
addMembersEnter in class Node_c

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.

typeCheck

public Node typeCheck(TypeChecker tc)
               throws SemanticException
Type check the method.

Specified by:
typeCheck in interface NodeOps
Overrides:
typeCheck in class Node_c
Throws:
SemanticException

makeNonterminal

protected Nonterminal makeNonterminal(ParserType ct,
                                      IbexTypeSystem ts)
                               throws SemanticException
Throws:
SemanticException

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 java.util.List rewrite(Rewriter rw)
                       throws SemanticException
Specified by:
rewrite in interface IbexClassMember
Throws:
SemanticException