polyglot.visit
Class TypedTranslator
java.lang.Object
polyglot.visit.PrettyPrinter
polyglot.visit.Translator
polyglot.visit.TypedTranslator
- All Implemented Interfaces:
- java.lang.Cloneable, Copy
- Direct Known Subclasses:
- CppTranslator, HeaderTranslator
public class TypedTranslator
- extends Translator
Methods inherited from class polyglot.visit.Translator |
copy, exports, job, macroEscape, nodeFactory, targetFactory, toString, translate, translateSource, typeSystem, writeHeader |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
context
protected Context context
TypedTranslator
public TypedTranslator(Job job,
TypeSystem ts,
NodeFactory nf,
TargetFactory tf)
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