public class Special_c extends Expr_c implements Special
Special
is an immutable representation of a
reference to this
or super
in Java. This
reference can be optionally qualified with a type such as
Foo.this
.Special.Kind
Term.Instance
Modifier and Type | Field and Description |
---|---|
protected Special.Kind |
kind |
protected TypeNode |
qualifier |
exceptions, reachable
Constructor and Description |
---|
Special_c(Position pos,
Special.Kind kind,
TypeNode qualifier) |
Special_c(Position pos,
Special.Kind kind,
TypeNode qualifier,
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 |
copy(NodeFactory nf)
Produce a copy of this node using the given NodeFactory.
|
void |
dump(CodeWriter w)
Dump the AST node for debugging purposes.
|
Term |
firstChild()
Return the first direct subterm performed when evaluating this term.
|
Special.Kind |
kind()
Get the kind of expression: SUPER or THIS.
|
protected <N extends Special_c> |
kind(N n,
Special.Kind kind) |
Special |
kind(Special.Kind kind)
Set the kind of expression: SUPER or THIS.
|
Precedence |
precedence()
Get the precedence of the expression.
|
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given
CodeWriter . |
TypeNode |
qualifier()
Get the outer class qualifier of the expression.
|
protected <N extends Special_c> |
qualifier(N n,
TypeNode qualifier) |
Special |
qualifier(TypeNode qualifier)
Set the outer class qualifier of the expression.
|
protected <N extends Special_c> |
reconstruct(N n,
TypeNode qualifier)
Reconstruct the expression.
|
java.lang.String |
toString() |
Node |
typeCheck(TypeChecker tc)
Type check the AST.
|
Node |
visitChildren(NodeVisitor v)
Visit the children of the node.
|
booleanValue, buildTypes, byteValue, charValue, constantValue, constantValue, constantValueSet, constantValueSet, doubleValue, extRewrite, floatValue, intValue, isConstant, isConstant, isTypeChecked, lastLang, longValue, printSubExpr, printSubExpr, shortValue, stringValue, type, type, type
exceptionCheck, exceptions, exceptions, exceptions, listChild, reachable, reachable, reachable
addDecls, buildTypesEnter, checkConstants, childExpectedType, copy, copy, copyIfNeeded, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, error, error, error, exceptionCheckEnter, ext, ext, ext, ext, extRewriteEnter, isDisambiguated, 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
constantValue, constantValueSet, isConstant, printSubExpr, printSubExpr, type
del, del, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitEdge
addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, extRewrite, extRewriteEnter, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheckEnter, typeCheckOverride, visitChild, visitList
exceptions, exceptions, reachable, reachable
protected Special.Kind kind
protected TypeNode qualifier
public Special_c(Position pos, Special.Kind kind, TypeNode qualifier)
public Special_c(Position pos, Special.Kind kind, TypeNode qualifier, Ext ext)
public Precedence precedence()
Expr
precedence
in interface Expr
precedence
in class Expr_c
public Special.Kind kind()
Special
public Special kind(Special.Kind kind)
Special
protected <N extends Special_c> N kind(N n, Special.Kind kind)
public TypeNode qualifier()
Special
public Special qualifier(TypeNode qualifier)
Special
protected <N extends Special_c> N reconstruct(N n, TypeNode qualifier)
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 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 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 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 void dump(CodeWriter w)
Node