polyglot.ext.jl.ast
Class Special_c

java.lang.Object
  extended by polyglot.ext.jl.ast.Node_c
      extended by polyglot.ext.jl.ast.Term_c
          extended by polyglot.ext.jl.ast.Expr_c
              extended by polyglot.ext.jl.ast.Special_c
All Implemented Interfaces:
java.lang.Cloneable, Expr, JL, Node, NodeOps, Prefix, Receiver, Special, Term, Typed, Copy

public class Special_c
extends Expr_c
implements Special

A Special is an immutable representation of a reference to this or superFoo.this.


Nested Class Summary
 
Nested classes/interfaces inherited from interface polyglot.ast.Special
Special.Kind
 
Field Summary
protected  Special.Kind kind
           
protected  TypeNode qualifier
           
 
Fields inherited from class polyglot.ext.jl.ast.Expr_c
type
 
Fields inherited from class polyglot.ext.jl.ast.Term_c
exceptions, reachable
 
Fields inherited from class polyglot.ext.jl.ast.Node_c
del, ext, position
 
Fields inherited from interface polyglot.ast.Special
SUPER, THIS
 
Constructor Summary
Special_c(Position pos, Special.Kind kind, TypeNode qualifier)
           
 
Method Summary
 java.util.List acceptCFG(CFGBuilder v, java.util.List succs)
          Visit this term in evaluation order.
 void dump(CodeWriter w)
          Dump the AST node for debugging purposes.
 Term entry()
          Return the first (sub)term performed when evaluating this term.
 Special.Kind kind()
          Get the kind of the special expression, either this or super.
 Special kind(Special.Kind kind)
          Set the kind of the special expression, either this or super.
 Precedence precedence()
          Get the precedence of the expression.
 void prettyPrint(CodeWriter w, PrettyPrinter tr)
          Write the expression to an output file.
 TypeNode qualifier()
          Get the qualifier of the special expression.
 Special qualifier(TypeNode qualifier)
          Set the qualifier of the special expression.
protected  Special_c reconstruct(TypeNode qualifier)
          Reconstruct the expression.
 java.lang.String toString()
           
 Node typeCheck(TypeChecker tc)
          Type check the expression.
 Node visitChildren(NodeVisitor v)
          Visit the children of the expression.
 
Methods inherited from class polyglot.ext.jl.ast.Expr_c
booleanValue, buildTypes, byteValue, charValue, constantValue, doubleValue, floatValue, intValue, isConstant, longValue, printSubExpr, printSubExpr, shortValue, stringValue, type, type
 
Methods inherited from class polyglot.ext.jl.ast.Term_c
exceptionCheck, exceptions, exceptions, listEntry, reachable, reachable
 
Methods inherited from class polyglot.ext.jl.ast.Node_c
addDecls, addMembers, addMembersEnter, addMembersOverride, buildTypesEnter, buildTypesOverride, childExpectedType, copy, del, del, disambiguate, disambiguateEnter, disambiguateOverride, enterScope, enterScope, exceptionCheckEnter, exceptionCheckOverride, ext, ext, ext, ext, init, node, position, position, 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
constantValue, isConstant, printSubExpr, printSubExpr, type
 
Methods inherited from interface polyglot.ast.Node
childExpectedType, del, del, 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, addMembersEnter, buildTypes, buildTypesEnter, disambiguate, disambiguateEnter, enterScope, enterScope, exceptionCheck, exceptionCheckEnter, throwTypes, translate, typeCheckEnter
 
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

kind

protected Special.Kind kind

qualifier

protected TypeNode qualifier
Constructor Detail

Special_c

public Special_c(Position pos,
                 Special.Kind kind,
                 TypeNode qualifier)
Method Detail

precedence

public Precedence precedence()
Get the precedence of the expression.

Specified by:
precedence in interface Expr
Overrides:
precedence in class Expr_c

kind

public Special.Kind kind()
Get the kind of the special expression, either this or super.

Specified by:
kind in interface Special

kind

public Special kind(Special.Kind kind)
Set the kind of the special expression, either this or super.

Specified by:
kind in interface Special

qualifier

public TypeNode qualifier()
Get the qualifier of the special expression.

Specified by:
qualifier in interface Special

qualifier

public Special qualifier(TypeNode qualifier)
Set the qualifier of the special expression.

Specified by:
qualifier in interface Special

reconstruct

protected Special_c reconstruct(TypeNode qualifier)
Reconstruct the expression.


visitChildren

public Node visitChildren(NodeVisitor v)
Visit the children of the expression.

Specified by:
visitChildren in interface NodeOps
Overrides:
visitChildren in class Node_c
Parameters:
v - The visitor that will traverse/rewrite the AST.
Returns:
A new AST if a change was made, or this.

typeCheck

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

Specified by:
typeCheck in interface NodeOps
Overrides:
typeCheck in class Node_c
Parameters:
tc - The type checking visitor.
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

toString

public java.lang.String toString()
Overrides:
toString in class Node_c

prettyPrint

public void prettyPrint(CodeWriter w,
                        PrettyPrinter tr)
Write the expression to an output file.

Specified by:
prettyPrint in interface NodeOps
Overrides:
prettyPrint in class Node_c
Parameters:
w - The code writer to which to write.
tr - The pretty printer. This is not a visitor.

dump

public void dump(CodeWriter w)
Description copied from interface: Node
Dump the AST node for debugging purposes.

Specified by:
dump in interface Node
Overrides:
dump in class Expr_c