public abstract class TypeNode_c extends Term_c implements TypeNode
TypeNode
is the syntactic representation of a
Type
within the abstract syntax tree.TypeNode.Instance
Modifier and Type | Field and Description |
---|---|
protected Type |
type |
exceptions, reachable
Constructor and Description |
---|
TypeNode_c(Position pos) |
TypeNode_c(Position pos,
Ext ext) |
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.
|
Node |
buildTypes(TypeBuilder tb)
Collects classes, methods, and fields from the AST rooted at this node
and constructs type objects for these.
|
Term |
firstChild()
Return the first direct subterm performed when evaluating this term.
|
boolean |
isDisambiguated() |
java.lang.String |
name()
Short name of the type, or null if not a
Named type. |
abstract void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given
CodeWriter . |
Qualifier |
qualifier()
Get the type as a qualifier.
|
java.lang.String |
toString() |
Type |
type()
Return the type of this node, or null if no type has been
assigned yet.
|
protected <N extends TypeNode_c> |
type(N n,
Type type) |
TypeNode |
type(Type type)
Set the type object for this node.
|
exceptionCheck, exceptions, exceptions, exceptions, extRewrite, listChild, reachable, reachable, reachable
addDecls, buildTypesEnter, checkConstants, childExpectedType, copy, copy, copy, copyIfNeeded, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, dump, enterChildScope, enterScope, error, error, error, exceptionCheckEnter, ext, ext, ext, ext, extRewriteEnter, isTypeChecked, lang, position, position, position, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visit, visitChild, visitChildren, visitEdge, visitList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
del, del, dump, error, error, ext, ext, ext, ext, isTypeChecked, position, position, visit, visitEdge
addDecls, buildTypesEnter, checkConstants, childExpectedType, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, extRewrite, extRewriteEnter, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChild, visitChildren, visitList
exceptions, exceptions, reachable, reachable
protected Type type
public TypeNode_c(Position pos)
public boolean isDisambiguated()
isDisambiguated
in interface Node
isDisambiguated
in class Node_c
public Qualifier qualifier()
qualifier
in interface QualifierNode
public Type type()
Typed
public TypeNode type(Type type)
TypeNode
protected <N extends TypeNode_c> N type(N n, Type type)
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 Term firstChild()
TermOps
firstChild
in interface TermOps
firstChild
in class Term_c
public <T> java.util.List<T> acceptCFG(CFGBuilder<?> v, java.util.List<T> succs)
TermOps
public abstract 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.