polyglot.ast
Class CanonicalTypeNode_c

java.lang.Object
  extended by polyglot.ast.Node_c
      extended by polyglot.ast.Term_c
          extended by polyglot.ast.TypeNode_c
              extended by polyglot.ast.CanonicalTypeNode_c
All Implemented Interfaces:
java.lang.Cloneable, CanonicalTypeNode, JL, Node, NodeOps, Prefix, QualifierNode, Receiver, Term, Typed, TypeNode, Copy

public class CanonicalTypeNode_c
extends TypeNode_c
implements CanonicalTypeNode

A CanonicalTypeNode is a type node for a canonical type.


Field Summary
 
Fields inherited from class polyglot.ast.TypeNode_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
CanonicalTypeNode_c(Position pos, Type type)
           
 
Method Summary
 Node copy(ExtensionInfo extInfo)
          Produce a copy of this node using the given ExtensionInfo.
 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.
 void prettyPrint(CodeWriter w, PrettyPrinter tr)
          Pretty-print the AST using the given CodeWriter.
 java.lang.String toString()
           
 void translate(CodeWriter w, Translator tr)
          Translate the type.
 Node typeCheck(TypeChecker tc)
          Type check the type node.
 
Methods inherited from class polyglot.ast.TypeNode_c
acceptCFG, buildTypes, firstChild, isDisambiguated, name, qualifier, 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, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, enterScope, error, error, exceptionCheckEnter, ext, ext, ext, ext, init, isTypeChecked, node, position, position, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, typeCheckEnter, typeCheckOverride, visit, visitChild, visitChildren, 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.TypeNode
name, 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, buildTypes, buildTypesEnter, checkConstants, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, prettyPrint, throwTypes, typeCheckEnter, typeCheckOverride, visitChildren
 
Methods inherited from interface polyglot.ast.Typed
type
 
Methods inherited from interface polyglot.ast.QualifierNode
qualifier
 
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, buildTypes, buildTypesEnter, checkConstants, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, prettyPrint, throwTypes, typeCheckEnter, typeCheckOverride, visitChildren
 
Methods inherited from interface polyglot.ast.Term
acceptCFG, exceptions, exceptions, firstChild, reachable, reachable
 

Constructor Detail

CanonicalTypeNode_c

public CanonicalTypeNode_c(Position pos,
                           Type type)
Method Detail

typeCheck

public Node typeCheck(TypeChecker tc)
               throws SemanticException
Type check the type node. Check accessibility of class types.

Specified by:
typeCheck in interface NodeOps
Overrides:
typeCheck in class Node_c
Parameters:
tc - The type checking visitor.
Throws:
SemanticException

prettyPrint

public void prettyPrint(CodeWriter w,
                        PrettyPrinter tr)
Description copied from class: Node_c
Pretty-print the AST using the given CodeWriter.

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

translate

public void translate(CodeWriter w,
                      Translator tr)
Translate the type. If the "use-fully-qualified-class-names" options is used, then the fully qualified names is written out (java.lang.Object). Otherwise, the string that originally represented the type in the source file is used.

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

toString

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

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 Node_c

copy

public Node copy(NodeFactory nf)
Description copied from interface: NodeOps
Produce a copy of this node using the given NodeFactory.

Specified by:
copy in interface NodeOps
Overrides:
copy in class Node_c

copy

public Node copy(ExtensionInfo extInfo)
          throws SemanticException
Description copied from interface: NodeOps
Produce a copy of this node using the given ExtensionInfo. This will typically be implemented by calling copy(NodeFactory nf), and then potentially copying over type information.

Specified by:
copy in interface NodeOps
Overrides:
copy in class Node_c
Throws:
SemanticException - If the type information cannot be copied.