xtc.type
Class TypePrinter

java.lang.Object
  extended by xtc.tree.Visitor
      extended by xtc.type.TypePrinter

public class TypePrinter
extends Visitor

A visitor to print types.

Version:
$Revision: 1.63 $
Author:
Robert Grimm

Field Summary
protected  boolean isInstantiated
          The flag for instantiated types.
protected  Printer printer
          The printer utility.
protected  java.util.Map<java.lang.Object,java.lang.Object> visited
          The set of visited, complex types.
 
Constructor Summary
TypePrinter(Printer printer)
          Create a new type printer.
 
Method Summary
 boolean printAnnotations(Type t)
          Print the specified type's annotations.
 void printBody(ClassOrInterfaceT t)
          Print the interfaces, fields, and methods of the specified class or interface type.
 void printSignature(FunctionOrMethodT t)
          Print the specified function or method type's signature.
 void printTagged(java.lang.String kind, Tagged tag)
          Print the specified tagged type.
 void reset()
          Reset this type printer.
 void visit(AliasT t)
          Print the specified type alias.
 void visit(AnnotatedT t)
          Print the specified annotated type.
 void visit(ArrayT t)
          Print the specified array type.
 void visit(BooleanT t)
          Print the specified boolean type.
 void visit(ClassT t)
          Print the specified class type.
 void visit(EnumeratorT t)
          Print the specified enumerator.
 void visit(EnumT t)
          Print the specified enum type.
 void visit(ErrorT t)
          Print the specified error type.
 void visit(FunctionT t)
          Print the specified function type.
 void visit(InstantiatedT t)
          Print the specified instantiated type.
 void visit(InterfaceT t)
          Print the specified interface type.
 void visit(InternalT t)
          Print the specified internal type.
 void visit(LabelT t)
          Print the specified label type.
 void visit(MethodT t)
          Print the specified method type.
 void visit(NumberT t)
          Print the specified number type.
 void visit(PackageT t)
          Print the specified package type.
 void visit(Parameter t)
          Print the specified type parameter.
 void visit(ParameterizedT t)
          Print the specified parameterized type.
 void visit(PointerT t)
          Print the specified pointer type.
 void visit(StructT t)
          Print the specified struct type.
 void visit(TupleT t)
          Print the specified tuple type.
 void visit(UnionT t)
          Print the specified union type.
 void visit(UnitT t)
          Print the specified unit type.
 void visit(VariableT t)
          Print the specified variable type.
 void visit(VariantT t)
          Print the specified variant typee.
 void visit(VoidT t)
          Print the specified void type.
 
Methods inherited from class xtc.tree.Visitor
dispatch, equals, hashCode, iterate, map, mapInPlace, unableToVisit, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

printer

protected final Printer printer
The printer utility.


visited

protected final java.util.Map<java.lang.Object,java.lang.Object> visited
The set of visited, complex types.


isInstantiated

protected boolean isInstantiated
The flag for instantiated types.

Constructor Detail

TypePrinter

public TypePrinter(Printer printer)
Create a new type printer. Note that this constructor registers the new type printer with the specified printer.

Parameters:
printer - The printer utility.
Method Detail

reset

public void reset()
Reset this type printer.


printAnnotations

public boolean printAnnotations(Type t)
Print the specified type's annotations.

Parameters:
t - The type.
Returns:
true if anything was printed.

visit

public void visit(BooleanT t)
Print the specified boolean type.


visit

public void visit(ErrorT t)
Print the specified error type.


visit

public void visit(InternalT t)
Print the specified internal type.


visit

public void visit(LabelT t)
Print the specified label type.


visit

public void visit(NumberT t)
Print the specified number type.


visit

public void visit(PackageT t)
Print the specified package type.


visit

public void visit(Parameter t)
Print the specified type parameter.


visit

public void visit(UnitT t)
Print the specified unit type.


visit

public void visit(VoidT t)
Print the specified void type.


visit

public void visit(ArrayT t)
Print the specified array type.


printBody

public void printBody(ClassOrInterfaceT t)
Print the interfaces, fields, and methods of the specified class or interface type.

Parameters:
t - The class or interface type.

visit

public void visit(ClassT t)
Print the specified class type.


visit

public void visit(InterfaceT t)
Print the specified interface type.


printSignature

public void printSignature(FunctionOrMethodT t)
Print the specified function or method type's signature.

Parameters:
t - The function or method type.

visit

public void visit(FunctionT t)
Print the specified function type.


visit

public void visit(MethodT t)
Print the specified method type.


visit

public void visit(PointerT t)
Print the specified pointer type.


printTagged

public void printTagged(java.lang.String kind,
                        Tagged tag)
Print the specified tagged type.

Parameters:
kind - The kind.
tag - The tagged type.

visit

public void visit(StructT t)
Print the specified struct type.


visit

public void visit(UnionT t)
Print the specified union type.


visit

public void visit(TupleT t)
Print the specified tuple type.


visit

public void visit(VariantT t)
Print the specified variant typee.


visit

public void visit(AliasT t)
Print the specified type alias.


visit

public void visit(AnnotatedT t)
Print the specified annotated type.


visit

public void visit(EnumeratorT t)
Print the specified enumerator.


visit

public void visit(EnumT t)
Print the specified enum type.


visit

public void visit(InstantiatedT t)
Print the specified instantiated type.


visit

public void visit(ParameterizedT t)
Print the specified parameterized type.


visit

public void visit(VariableT t)
Print the specified variable type.



Copyright © 2012. All Rights Reserved.