| java.lang.Object xtc.tree.Visitor xtc.lang.JavaAstSimplifier
JavaAstSimplifier | public class JavaAstSimplifier extends Visitor (Code) | | A visitor that simplifies Java ASTs. Turns BasicCastExpression into
CastExpression, and turns ConstructorDeclaration into MethodDeclaration.
Subsumes Dimensions into the close-by Type wherever possible. The resulting
AST uses only GNode names that occur in the original grammar.
author: Martin Hirzel |
copyLoc | public static GNode copyLoc(GNode nOld, GNode nNew)(Code) | | Copy location from nOld to nNew, then return nNew.
|
visit | public Node visit(Node n)(Code) | | Catch-all visit method, replaces subtrees in-place by dispatched version.
|
visitBasicCastExpression | final public GNode visitBasicCastExpression(GNode n)(Code) | | Turn BasicCastExpression into general CastExpression.
|
visitConstructorDeclaration | final public GNode visitConstructorDeclaration(GNode n)(Code) | | Turn ConstructorDeclaration into general MethodDeclaration.
|
visitFormalParameter | final public GNode visitFormalParameter(GNode n)(Code) | | Move dimensions from parameter declaration into declared type of the parameter.
|
visitMethodDeclaration | final public GNode visitMethodDeclaration(GNode n)(Code) | | Move dimensions from method declaration into the return type.
|
visitUnaryExpression | final public GNode visitUnaryExpression(GNode n)(Code) | | Move unary minus into IntegerLiteral, to simplify checking that the literal is valid in Java.
|
|
|