public class EnumConstantDecl_c extends Term_c implements EnumConstantDecl
Term.Instance
Modifier and Type | Field and Description |
---|---|
protected java.util.List<Expr> |
args |
protected ClassBody |
body |
protected ConstructorInstance |
constructorInstance |
protected EnumInstance |
enumInstance |
protected Flags |
flags |
protected Id |
name |
protected long |
ordinal |
protected ParsedClassType |
type |
exceptions, reachable
Constructor and Description |
---|
EnumConstantDecl_c(Position pos,
Flags flags,
Id name,
java.util.List<Expr> args,
ClassBody body) |
Modifier and Type | Method and Description |
---|---|
<T> java.util.List<T> |
acceptCFG(CFGBuilder<?> v,
java.util.List<T> succs)
Visit this term in evaluation order, calling v.edge() for each successor
in succs, if data flows on that edge.
|
java.util.List<Expr> |
args()
get args
|
EnumConstantDecl |
args(java.util.List<Expr> args)
set args
|
protected <N extends EnumConstantDecl_c> |
args(N n,
java.util.List<Expr> args) |
ClassBody |
body()
get body
|
EnumConstantDecl |
body(ClassBody body)
set body
|
protected <N extends EnumConstantDecl_c> |
body(N n,
ClassBody body) |
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.
|
Type |
childExpectedType(Expr child,
AscriptionVisitor av)
Get the expected type of a child expression of
this . |
ConstructorInstance |
constructorInstance() |
EnumConstantDecl |
constructorInstance(ConstructorInstance ci) |
protected <N extends EnumConstantDecl_c> |
constructorInstance(N n,
ConstructorInstance ci) |
Context |
enterChildScope(Node child,
Context c)
Push a new scope for visiting the child node
child . |
EnumInstance |
enumInstance() |
EnumConstantDecl |
enumInstance(EnumInstance ei) |
protected <N extends EnumConstantDecl_c> |
enumInstance(N n,
EnumInstance ei) |
Node |
extRewrite(ExtensionRewriter rw)
Rewrite the AST for the compilation in this language.
|
Term |
firstChild()
Return the first direct subterm performed when evaluating this term.
|
Flags |
flags() |
MemberInstance |
memberInstance() |
Id |
name()
get name
|
EnumConstantDecl |
name(Id name)
set name
|
protected <N extends EnumConstantDecl_c> |
name(N n,
Id name) |
long |
ordinal() |
EnumConstantDecl |
ordinal(long ordinal) |
protected <N extends EnumConstantDecl_c> |
ordinal(N n,
long ordinal) |
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given
CodeWriter . |
protected EnumConstantDecl_c |
reconstruct(java.util.List<Expr> args,
ClassBody body) |
java.lang.String |
toString() |
ParsedClassType |
type() |
protected <N extends EnumConstantDecl_c> |
type(N n,
ParsedClassType type) |
EnumConstantDecl |
type(ParsedClassType pct) |
Node |
typeCheck(TypeChecker tc)
Type check the AST.
|
Node |
visitChildren(NodeVisitor v)
Visit the children of the node.
|
exceptionCheck, exceptions, exceptions, exceptions, listChild, reachable, reachable, reachable
addDecls, checkConstants, copy, copy, copy, copyIfNeeded, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, dump, enterScope, error, error, error, exceptionCheckEnter, ext, ext, ext, ext, extRewriteEnter, isDisambiguated, isTypeChecked, lang, position, position, position, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, translate, typeCheckEnter, typeCheckOverride, visit, visitChild, visitEdge, visitList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
exceptions, exceptions, reachable, reachable
del, del, dump, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitEdge
addDecls, checkConstants, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterScope, exceptionCheck, exceptionCheckEnter, extRewriteEnter, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheckEnter, typeCheckOverride, visitChild, visitList
protected java.util.List<Expr> args
protected Id name
protected Flags flags
protected ClassBody body
protected EnumInstance enumInstance
protected ConstructorInstance constructorInstance
protected ParsedClassType type
protected long ordinal
public long ordinal()
ordinal
in interface EnumConstantDecl
public EnumConstantDecl ordinal(long ordinal)
ordinal
in interface EnumConstantDecl
protected <N extends EnumConstantDecl_c> N ordinal(N n, long ordinal)
public java.util.List<Expr> args()
EnumConstantDecl
args
in interface EnumConstantDecl
public EnumConstantDecl args(java.util.List<Expr> args)
EnumConstantDecl
args
in interface EnumConstantDecl
protected <N extends EnumConstantDecl_c> N args(N n, java.util.List<Expr> args)
public Id name()
EnumConstantDecl
name
in interface EnumConstantDecl
public EnumConstantDecl name(Id name)
EnumConstantDecl
name
in interface EnumConstantDecl
protected <N extends EnumConstantDecl_c> N name(N n, Id name)
public ClassBody body()
EnumConstantDecl
body
in interface EnumConstantDecl
public EnumConstantDecl body(ClassBody body)
EnumConstantDecl
body
in interface EnumConstantDecl
protected <N extends EnumConstantDecl_c> N body(N n, ClassBody body)
public ParsedClassType type()
type
in interface EnumConstantDecl
public EnumConstantDecl type(ParsedClassType pct)
type
in interface EnumConstantDecl
protected <N extends EnumConstantDecl_c> N type(N n, ParsedClassType type)
public MemberInstance memberInstance()
memberInstance
in interface ClassMember
public EnumInstance enumInstance()
enumInstance
in interface EnumConstantDecl
public EnumConstantDecl enumInstance(EnumInstance ei)
enumInstance
in interface EnumConstantDecl
protected <N extends EnumConstantDecl_c> N enumInstance(N n, EnumInstance ei)
public ConstructorInstance constructorInstance()
constructorInstance
in interface EnumConstantDecl
public EnumConstantDecl constructorInstance(ConstructorInstance ci)
constructorInstance
in interface EnumConstantDecl
protected <N extends EnumConstantDecl_c> N constructorInstance(N n, ConstructorInstance ci)
public Flags flags()
flags
in interface EnumConstantDecl
protected EnumConstantDecl_c reconstruct(java.util.List<Expr> args, ClassBody body)
public Node visitChildren(NodeVisitor v)
NodeOps
visitChildren
in interface NodeOps
visitChildren
in class Node_c
v
- The visitor that will traverse/rewrite the AST.this
.public Context enterChildScope(Node child, Context c)
NodeOps
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 NodeOps
enterChildScope
in class Node_c
child
- the child node about to be entered.c
- the current Context
Context
to be used for visiting node
child
public NodeVisitor buildTypesEnter(TypeBuilder tb) throws SemanticException
NodeOps
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
buildTypesEnter
in class Node_c
tb
- The visitor which adds new type objects to the
TypeSystem
.SemanticException
public Node buildTypes(TypeBuilder tb) throws SemanticException
NodeOps
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
buildTypes
in class Node_c
tb
- The visitor which adds new type objects to the
TypeSystem
.SemanticException
public Node typeCheck(TypeChecker tc) throws SemanticException
NodeOps
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
typeCheck
in class Node_c
tc
- The type checking visitor.SemanticException
public Type childExpectedType(Expr child, AscriptionVisitor av)
NodeOps
this
.
The expected type is determined by the context in that the child occurs
(e.g., for x = e
, the expected type of e
is
the declared type of x
.
The expected type should impose the least constraints on the child's
type that are allowed by the parent node.childExpectedType
in interface NodeOps
childExpectedType
in class Node_c
child
- A child expression of this node.av
- An ascription visitor.child
.public Node extRewrite(ExtensionRewriter rw) throws SemanticException
NodeOps
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.extRewrite
in interface NodeOps
extRewrite
in class Term_c
rw
- The visitor.SemanticException
public void prettyPrint(CodeWriter w, PrettyPrinter tr)
Node_c
CodeWriter
.prettyPrint
in interface NodeOps
prettyPrint
in class Node_c
w
- The code writer to which to write.tr
- The pretty printer. This is not a visitor.public <T> java.util.List<T> acceptCFG(CFGBuilder<?> v, java.util.List<T> succs)
TermOps
public Term firstChild()
TermOps
firstChild
in interface TermOps
firstChild
in class Term_c