polyglot.visit
Class TypedTranslator

java.lang.Object
  extended by polyglot.visit.PrettyPrinter
      extended by polyglot.visit.Translator
          extended by polyglot.visit.TypedTranslator
All Implemented Interfaces:
java.lang.Cloneable, Copy
Direct Known Subclasses:
CppTranslator, HeaderTranslator

public class TypedTranslator
extends Translator


Field Summary
protected  Context context
           
 
Fields inherited from class polyglot.visit.Translator
job, nf, tf, ts
 
Fields inherited from class polyglot.visit.PrettyPrinter
appendSemicolon, printType
 
Constructor Summary
TypedTranslator(Job job, TypeSystem ts, NodeFactory nf, TargetFactory tf)
           
 
Method Summary
 Context context()
          Get the current context in which we are translating.
 Translator context(Context c)
          Create a new Translator identical to this but with new context c
 void print(Node parent, Node child, CodeWriter w)
          Print an ast node using the given code writer.
 void translateTopLevelDecl(CodeWriter w, SourceFile parent, TopLevelDecl decl)
           
 
Methods inherited from class polyglot.visit.Translator
copy, exports, job, macroEscape, nodeFactory, targetFactory, toString, translate, translateSource, typeSystem, writeHeader
 
Methods inherited from class polyglot.visit.PrettyPrinter
appendSemicolon, appendSemicolon, printAst, printType, printType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

context

protected Context context
Constructor Detail

TypedTranslator

public TypedTranslator(Job job,
                       TypeSystem ts,
                       NodeFactory nf,
                       TargetFactory tf)
Method Detail

context

public Context context()
Get the current context in which we are translating.


context

public Translator context(Context c)
Create a new Translator identical to this but with new context c


translateTopLevelDecl

public void translateTopLevelDecl(CodeWriter w,
                                  SourceFile parent,
                                  TopLevelDecl decl)
Overrides:
translateTopLevelDecl in class Translator

print

public void print(Node parent,
                  Node child,
                  CodeWriter w)
Description copied from class: Translator
Print an ast node using the given code writer. This method should not be called directly to translate a source file AST; use translate(Node) instead. This method should only be called by nodes to print their children.

Overrides:
print in class Translator