|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpolyglot.ast.Node_c
polyglot.ast.Term_c
polyglot.ast.Expr_c
polyglot.ast.Local_c
public class Local_c
A local variable expression.
Field Summary | |
---|---|
protected LocalInstance |
li
|
protected Id |
name
|
Fields inherited from class polyglot.ast.Expr_c |
---|
type |
Fields inherited from class polyglot.ast.Term_c |
---|
exceptions, reachable |
Fields inherited from class polyglot.ast.Node_c |
---|
del, error, ext, position |
Fields inherited from interface polyglot.ast.Term |
---|
ENTRY, EXIT |
Constructor Summary | |
---|---|
Local_c(Position pos,
Id name)
|
Method Summary | |
---|---|
java.util.List |
acceptCFG(CFGBuilder v,
java.util.List succs)
Visit this term in evaluation order. |
Node |
buildTypes(TypeBuilder tb)
Collects classes, methods, and fields from the AST rooted at this node and constructs type objects for these. |
java.lang.Object |
constantValue()
Returns the constant value of the expression, if any. |
boolean |
constantValueSet()
|
Node |
copy(NodeFactory nf)
Produce a copy of this node using the given NodeFactory. |
void |
dump(CodeWriter w)
Dumps the AST. |
Term |
firstChild()
Return the first direct subterm performed when evaluating this term. |
Flags |
flags()
Return the access flags of the variable. |
Id |
id()
Get the name of the local. |
Local |
id(Id name)
Set the name of the local. |
boolean |
isConstant()
Return whether the expression evaluates to a constant. |
LocalInstance |
localInstance()
Get the local instance of the local. |
Local |
localInstance(LocalInstance li)
Set the local instance of the local. |
java.lang.String |
name()
Get the name of the local. |
Local |
name(java.lang.String name)
Set the name of the local. |
Precedence |
precedence()
Get the precedence of the local. |
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Write the local to an output file. |
protected Local_c |
reconstruct(Id name)
Reconstruct the expression. |
java.lang.String |
toString()
|
Node |
typeCheck(TypeChecker tc)
Type check the local. |
VarInstance |
varInstance()
Get the local instance of the local. |
Node |
visitChildren(NodeVisitor v)
Visit the children of the constructor. |
Methods inherited from class polyglot.ast.Expr_c |
---|
booleanValue, byteValue, charValue, doubleValue, floatValue, intValue, isTypeChecked, longValue, printSubExpr, printSubExpr, shortValue, stringValue, type, type |
Methods inherited from class polyglot.ast.Term_c |
---|
exceptionCheck, exceptions, exceptions, listChild, reachable, reachable |
Methods inherited from class polyglot.ast.Node_c |
---|
addDecls, buildTypesEnter, checkConstants, childExpectedType, copy, copy, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, enterScope, error, error, exceptionCheckEnter, ext, ext, ext, ext, init, isDisambiguated, node, position, position, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, 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.Expr |
---|
printSubExpr, printSubExpr, type |
Methods inherited from interface polyglot.ast.Node |
---|
childExpectedType, del, del, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitChild, visitEdge, visitList |
Methods inherited from interface polyglot.ast.JL |
---|
init, node |
Methods inherited from interface polyglot.ast.NodeOps |
---|
addDecls, buildTypesEnter, checkConstants, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, prettyPrint, throwTypes, translate, typeCheckEnter, typeCheckOverride |
Methods inherited from interface polyglot.util.Copy |
---|
copy |
Methods inherited from interface polyglot.ast.Typed |
---|
type |
Methods inherited from interface polyglot.ast.Term |
---|
exceptions, exceptions, reachable, reachable |
Field Detail |
---|
protected Id name
protected LocalInstance li
Constructor Detail |
---|
public Local_c(Position pos, Id name)
Method Detail |
---|
public Precedence precedence()
precedence
in interface Expr
precedence
in class Expr_c
public Id id()
id
in interface Local
public Local id(Id name)
id
in interface Local
public java.lang.String name()
name
in interface Local
name
in interface NamedVariable
public Local name(java.lang.String name)
name
in interface Local
public Flags flags()
flags
in interface NamedVariable
flags
in interface Variable
public VarInstance varInstance()
varInstance
in interface NamedVariable
public LocalInstance localInstance()
localInstance
in interface Local
public Local localInstance(LocalInstance li)
localInstance
in interface Local
protected Local_c reconstruct(Id name)
public Node visitChildren(NodeVisitor v)
visitChildren
in interface NodeOps
visitChildren
in class Node_c
v
- The visitor that will traverse/rewrite the AST.
this
.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 Expr_c
tb
- The visitor which adds new type objects to the
TypeSystem
.
SemanticException
public Node typeCheck(TypeChecker tc) throws SemanticException
typeCheck
in interface NodeOps
typeCheck
in class Node_c
tc
- The type checking visitor.
SemanticException
public Term firstChild()
Term
firstChild
in interface Term
public java.util.List acceptCFG(CFGBuilder v, java.util.List succs)
Term_c
acceptCFG
in interface Term
acceptCFG
in class Term_c
public java.lang.String toString()
toString
in class Node_c
public void prettyPrint(CodeWriter w, PrettyPrinter tr)
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)
dump
in interface Node
dump
in class Expr_c
public boolean constantValueSet()
constantValueSet
in interface Expr
constantValueSet
in class Expr_c
public boolean isConstant()
Expr
isConstant
in interface Expr
isConstant
in class Expr_c
public java.lang.Object constantValue()
Expr
constantValue
in interface Expr
constantValue
in class Expr_c
public Node copy(NodeFactory nf)
NodeOps
copy
in interface NodeOps
copy
in class Node_c
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |