public class ExtensionRewriter extends ContextVisitor
for an example.
Modifier and Type | Field and Description |
---|---|
protected ExtensionInfo |
from_ext
The ExtensionInfo of the source language
|
protected QQ |
qq
A quasi-quoter for generating AST node in the target language
|
protected ExtensionInfo |
to_ext
The ExtensionInfo of the target language
|
context, outer, prune, rethrowMissingDependencies
error, job, nf, ts
bypass, bypassParent
Constructor and Description |
---|
ExtensionRewriter(Job job,
ExtensionInfo from_ext,
ExtensionInfo to_ext) |
Modifier and Type | Method and Description |
---|---|
protected void |
addDecls(Node old,
Node n)
Imperatively update the context with declarations to be added after
visiting the node.
|
protected TypeNode |
canonical(NodeFactory nf,
Type t,
Position pos) |
NodeVisitor |
enterCall(Node n) |
ErrorQueue |
errorQueue()
Returns the
ErrorQueue for the current Job. |
void |
finish(Node ast) |
ExtensionInfo |
from_ext() |
NodeFactory |
from_nf() |
TypeSystem |
from_ts() |
Lang |
lang() |
Node |
leaveCall(Node old,
Node n,
NodeVisitor v) |
QQ |
qq() |
ExtensionInfo |
to_ext() |
NodeFactory |
to_nf() |
TypeSystem |
to_ts() |
TypeNode |
typeToJava(Type t,
Position pos) |
addDecls, begin, context, context, enter, enter, enterScope, leave, rethrowMissingDependencies, superEnter
catchErrors, enterCall, enterError, hasErrors, job, leaveCall, leaveCall, nodeFactory, typeSystem
bypass, bypass, bypassChildren, override, visitChildren
copy, finish, leave, override, toString, visitEdge, visitEdgeNoOverride
protected final ExtensionInfo from_ext
protected final ExtensionInfo to_ext
protected QQ qq
public ExtensionRewriter(Job job, ExtensionInfo from_ext, ExtensionInfo to_ext)
public Lang lang()
lang
in class NodeVisitor
public NodeVisitor enterCall(Node n) throws SemanticException
enterCall
in class ErrorHandlingVisitor
SemanticException
public Node leaveCall(Node old, Node n, NodeVisitor v) throws SemanticException
leaveCall
in class ErrorHandlingVisitor
SemanticException
protected void addDecls(Node old, Node n)
ContextVisitor
addDecls
in class ContextVisitor
public void finish(Node ast)
finish
in class NodeVisitor
public ExtensionInfo from_ext()
public TypeSystem from_ts()
public NodeFactory from_nf()
public ExtensionInfo to_ext()
public TypeSystem to_ts()
public NodeFactory to_nf()
public ErrorQueue errorQueue()
ErrorHandlingVisitor
ErrorQueue
for the current Job.errorQueue
in class ErrorHandlingVisitor
ErrorQueue
public TypeNode typeToJava(Type t, Position pos) throws SemanticException
SemanticException
protected TypeNode canonical(NodeFactory nf, Type t, Position pos)
public QQ qq()