Search in sources :

Example 1 with PrimitiveType

use of japa.parser.ast.type.PrimitiveType in project Japid by branaway.

the class JavaSyntaxTool method parseCode.

public static List<CodeNode> parseCode(String code) {
    try {
        final List<CodeNode> nodes = new LinkedList();
        CompilationUnit cu = parse(code);
        VoidVisitorAdapter visitor = new VoidVisitorAdapter() {

            int nested = 0;

            @Override
            public void visit(AnnotationDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(AnnotationMemberDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ArrayAccessExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ArrayCreationExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ArrayInitializerExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(AssertStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(AssignExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(BinaryExpr n, Object arg) {
                if (n.getOperator() == Operator.binOr) {
                    nodes.add(new CodeNode(nested++, new BinaryOrExpr(n)));
                } else {
                    nodes.add(new CodeNode(nested++, n));
                }
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(BlockComment n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(BlockStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(BooleanLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(BreakStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(CastExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(CatchClause n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(CharLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ClassExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ClassOrInterfaceDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ClassOrInterfaceType n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(CompilationUnit n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ConditionalExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ConstructorDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ContinueStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(DoStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(DoubleLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(EmptyMemberDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(EmptyStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(EmptyTypeDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(EnclosedExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(EnumConstantDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(EnumDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ExplicitConstructorInvocationStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ExpressionStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(FieldAccessExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(FieldDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ForeachStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ForStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(IfStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ImportDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(InitializerDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(InstanceOfExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(IntegerLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(IntegerLiteralMinValueExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(JavadocComment n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(LabeledStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(LineComment n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(LongLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(LongLiteralMinValueExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(MarkerAnnotationExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(MemberValuePair n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(MethodCallExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(MethodDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(NameExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(NormalAnnotationExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(NullLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ObjectCreationExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(PackageDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(Parameter n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(PrimitiveType n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(QualifiedNameExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ReferenceType n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ReturnStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(SingleMemberAnnotationExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(StringLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(SuperExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(SwitchEntryStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(SwitchStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(SynchronizedStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ThisExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ThrowStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(TryStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(TypeDeclarationStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(TypeParameter n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(UnaryExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(VariableDeclarationExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(VariableDeclarator n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(VariableDeclaratorId n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(VoidType n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(WhileStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(WildcardType n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }
        };
        cu.accept(visitor, null);
        return nodes;
    } catch (ParseException e) {
        throw new RuntimeException("invalid Java code: " + code + ". " + e);
    }
}
Also used : IntegerLiteralExpr(japa.parser.ast.expr.IntegerLiteralExpr) ObjectCreationExpr(japa.parser.ast.expr.ObjectCreationExpr) TypeParameter(japa.parser.ast.TypeParameter) ExplicitConstructorInvocationStmt(japa.parser.ast.stmt.ExplicitConstructorInvocationStmt) LineComment(japa.parser.ast.LineComment) ExpressionStmt(japa.parser.ast.stmt.ExpressionStmt) ReferenceType(japa.parser.ast.type.ReferenceType) VariableDeclarator(japa.parser.ast.body.VariableDeclarator) EnumConstantDeclaration(japa.parser.ast.body.EnumConstantDeclaration) QualifiedNameExpr(japa.parser.ast.expr.QualifiedNameExpr) BreakStmt(japa.parser.ast.stmt.BreakStmt) BooleanLiteralExpr(japa.parser.ast.expr.BooleanLiteralExpr) CastExpr(japa.parser.ast.expr.CastExpr) LongLiteralExpr(japa.parser.ast.expr.LongLiteralExpr) PrimitiveType(japa.parser.ast.type.PrimitiveType) NormalAnnotationExpr(japa.parser.ast.expr.NormalAnnotationExpr) PackageDeclaration(japa.parser.ast.PackageDeclaration) CompilationUnit(japa.parser.ast.CompilationUnit) BlockComment(japa.parser.ast.BlockComment) SwitchStmt(japa.parser.ast.stmt.SwitchStmt) BlockStmt(japa.parser.ast.stmt.BlockStmt) CharLiteralExpr(japa.parser.ast.expr.CharLiteralExpr) CatchClause(japa.parser.ast.stmt.CatchClause) ForeachStmt(japa.parser.ast.stmt.ForeachStmt) InstanceOfExpr(japa.parser.ast.expr.InstanceOfExpr) UnaryExpr(japa.parser.ast.expr.UnaryExpr) LinkedList(java.util.LinkedList) WildcardType(japa.parser.ast.type.WildcardType) EmptyMemberDeclaration(japa.parser.ast.body.EmptyMemberDeclaration) AnnotationDeclaration(japa.parser.ast.body.AnnotationDeclaration) ClassExpr(japa.parser.ast.expr.ClassExpr) AssertStmt(japa.parser.ast.stmt.AssertStmt) ReturnStmt(japa.parser.ast.stmt.ReturnStmt) ThrowStmt(japa.parser.ast.stmt.ThrowStmt) VoidVisitorAdapter(japa.parser.ast.visitor.VoidVisitorAdapter) LabeledStmt(japa.parser.ast.stmt.LabeledStmt) VoidType(japa.parser.ast.type.VoidType) ClassOrInterfaceDeclaration(japa.parser.ast.body.ClassOrInterfaceDeclaration) QualifiedNameExpr(japa.parser.ast.expr.QualifiedNameExpr) NameExpr(japa.parser.ast.expr.NameExpr) StringLiteralExpr(japa.parser.ast.expr.StringLiteralExpr) ClassOrInterfaceType(japa.parser.ast.type.ClassOrInterfaceType) SynchronizedStmt(japa.parser.ast.stmt.SynchronizedStmt) FieldDeclaration(japa.parser.ast.body.FieldDeclaration) AssignExpr(japa.parser.ast.expr.AssignExpr) SingleMemberAnnotationExpr(japa.parser.ast.expr.SingleMemberAnnotationExpr) JavadocComment(japa.parser.ast.body.JavadocComment) VariableDeclaratorId(japa.parser.ast.body.VariableDeclaratorId) MemberValuePair(japa.parser.ast.expr.MemberValuePair) ArrayInitializerExpr(japa.parser.ast.expr.ArrayInitializerExpr) WhileStmt(japa.parser.ast.stmt.WhileStmt) ConstructorDeclaration(japa.parser.ast.body.ConstructorDeclaration) EmptyTypeDeclaration(japa.parser.ast.body.EmptyTypeDeclaration) TypeDeclarationStmt(japa.parser.ast.stmt.TypeDeclarationStmt) FieldAccessExpr(japa.parser.ast.expr.FieldAccessExpr) EmptyStmt(japa.parser.ast.stmt.EmptyStmt) ArrayCreationExpr(japa.parser.ast.expr.ArrayCreationExpr) ForStmt(japa.parser.ast.stmt.ForStmt) DoStmt(japa.parser.ast.stmt.DoStmt) ThisExpr(japa.parser.ast.expr.ThisExpr) VariableDeclarationExpr(japa.parser.ast.expr.VariableDeclarationExpr) SuperExpr(japa.parser.ast.expr.SuperExpr) IntegerLiteralMinValueExpr(japa.parser.ast.expr.IntegerLiteralMinValueExpr) ArrayAccessExpr(japa.parser.ast.expr.ArrayAccessExpr) MethodDeclaration(japa.parser.ast.body.MethodDeclaration) BinaryExpr(japa.parser.ast.expr.BinaryExpr) TryStmt(japa.parser.ast.stmt.TryStmt) MarkerAnnotationExpr(japa.parser.ast.expr.MarkerAnnotationExpr) ConditionalExpr(japa.parser.ast.expr.ConditionalExpr) EnumDeclaration(japa.parser.ast.body.EnumDeclaration) ContinueStmt(japa.parser.ast.stmt.ContinueStmt) NullLiteralExpr(japa.parser.ast.expr.NullLiteralExpr) IfStmt(japa.parser.ast.stmt.IfStmt) InitializerDeclaration(japa.parser.ast.body.InitializerDeclaration) LongLiteralMinValueExpr(japa.parser.ast.expr.LongLiteralMinValueExpr) DoubleLiteralExpr(japa.parser.ast.expr.DoubleLiteralExpr) ImportDeclaration(japa.parser.ast.ImportDeclaration) SwitchEntryStmt(japa.parser.ast.stmt.SwitchEntryStmt) Parameter(japa.parser.ast.body.Parameter) TypeParameter(japa.parser.ast.TypeParameter) ParseException(japa.parser.ParseException) EnclosedExpr(japa.parser.ast.expr.EnclosedExpr) AnnotationMemberDeclaration(japa.parser.ast.body.AnnotationMemberDeclaration) MethodCallExpr(japa.parser.ast.expr.MethodCallExpr)

Example 2 with PrimitiveType

use of japa.parser.ast.type.PrimitiveType in project japid42 by branaway.

the class JavaSyntaxTool method parseCode.

public static List<CodeNode> parseCode(String code) {
    try {
        final List<CodeNode> nodes = new LinkedList();
        CompilationUnit cu = parse(code);
        VoidVisitorAdapter visitor = new VoidVisitorAdapter() {

            int nested = 0;

            @Override
            public void visit(AnnotationDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(AnnotationMemberDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ArrayAccessExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ArrayCreationExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ArrayInitializerExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(AssertStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(AssignExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(BinaryExpr n, Object arg) {
                if (n.getOperator() == Operator.binOr) {
                    nodes.add(new CodeNode(nested++, new BinaryOrExpr(n)));
                } else {
                    nodes.add(new CodeNode(nested++, n));
                }
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(BlockComment n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(BlockStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(BooleanLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(BreakStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(CastExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(CatchClause n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(CharLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ClassExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ClassOrInterfaceDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ClassOrInterfaceType n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(CompilationUnit n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ConditionalExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ConstructorDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ContinueStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(DoStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(DoubleLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(EmptyMemberDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(EmptyStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(EmptyTypeDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(EnclosedExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(EnumConstantDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(EnumDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ExplicitConstructorInvocationStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ExpressionStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(FieldAccessExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(FieldDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ForeachStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ForStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(IfStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ImportDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(InitializerDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(InstanceOfExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(IntegerLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(IntegerLiteralMinValueExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(JavadocComment n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(LabeledStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(LineComment n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(LongLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(LongLiteralMinValueExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(MarkerAnnotationExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(MemberValuePair n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(MethodCallExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(MethodDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(NameExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(NormalAnnotationExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(NullLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ObjectCreationExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(PackageDeclaration n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(Parameter n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(PrimitiveType n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(QualifiedNameExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ReferenceType n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ReturnStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(SingleMemberAnnotationExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(StringLiteralExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(SuperExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(SwitchEntryStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(SwitchStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(SynchronizedStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ThisExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(ThrowStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(TryStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(TypeDeclarationStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(TypeParameter n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(UnaryExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(VariableDeclarationExpr n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(VariableDeclarator n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(VariableDeclaratorId n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(VoidType n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(WhileStmt n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }

            @Override
            public void visit(WildcardType n, Object arg) {
                nodes.add(new CodeNode(nested++, n));
                super.visit(n, arg);
                nested--;
            }
        };
        cu.accept(visitor, null);
        return nodes;
    } catch (ParseException e) {
        throw new RuntimeException("invalid Java code: " + code + ". " + e);
    }
}
Also used : IntegerLiteralExpr(japa.parser.ast.expr.IntegerLiteralExpr) ObjectCreationExpr(japa.parser.ast.expr.ObjectCreationExpr) TypeParameter(japa.parser.ast.TypeParameter) ExplicitConstructorInvocationStmt(japa.parser.ast.stmt.ExplicitConstructorInvocationStmt) LineComment(japa.parser.ast.LineComment) ExpressionStmt(japa.parser.ast.stmt.ExpressionStmt) ReferenceType(japa.parser.ast.type.ReferenceType) VariableDeclarator(japa.parser.ast.body.VariableDeclarator) EnumConstantDeclaration(japa.parser.ast.body.EnumConstantDeclaration) QualifiedNameExpr(japa.parser.ast.expr.QualifiedNameExpr) BreakStmt(japa.parser.ast.stmt.BreakStmt) BooleanLiteralExpr(japa.parser.ast.expr.BooleanLiteralExpr) CastExpr(japa.parser.ast.expr.CastExpr) LongLiteralExpr(japa.parser.ast.expr.LongLiteralExpr) PrimitiveType(japa.parser.ast.type.PrimitiveType) NormalAnnotationExpr(japa.parser.ast.expr.NormalAnnotationExpr) PackageDeclaration(japa.parser.ast.PackageDeclaration) CompilationUnit(japa.parser.ast.CompilationUnit) BlockComment(japa.parser.ast.BlockComment) SwitchStmt(japa.parser.ast.stmt.SwitchStmt) BlockStmt(japa.parser.ast.stmt.BlockStmt) CharLiteralExpr(japa.parser.ast.expr.CharLiteralExpr) CatchClause(japa.parser.ast.stmt.CatchClause) ForeachStmt(japa.parser.ast.stmt.ForeachStmt) InstanceOfExpr(japa.parser.ast.expr.InstanceOfExpr) UnaryExpr(japa.parser.ast.expr.UnaryExpr) LinkedList(java.util.LinkedList) WildcardType(japa.parser.ast.type.WildcardType) EmptyMemberDeclaration(japa.parser.ast.body.EmptyMemberDeclaration) AnnotationDeclaration(japa.parser.ast.body.AnnotationDeclaration) ClassExpr(japa.parser.ast.expr.ClassExpr) AssertStmt(japa.parser.ast.stmt.AssertStmt) ReturnStmt(japa.parser.ast.stmt.ReturnStmt) ThrowStmt(japa.parser.ast.stmt.ThrowStmt) VoidVisitorAdapter(japa.parser.ast.visitor.VoidVisitorAdapter) LabeledStmt(japa.parser.ast.stmt.LabeledStmt) VoidType(japa.parser.ast.type.VoidType) ClassOrInterfaceDeclaration(japa.parser.ast.body.ClassOrInterfaceDeclaration) QualifiedNameExpr(japa.parser.ast.expr.QualifiedNameExpr) NameExpr(japa.parser.ast.expr.NameExpr) StringLiteralExpr(japa.parser.ast.expr.StringLiteralExpr) ClassOrInterfaceType(japa.parser.ast.type.ClassOrInterfaceType) SynchronizedStmt(japa.parser.ast.stmt.SynchronizedStmt) FieldDeclaration(japa.parser.ast.body.FieldDeclaration) AssignExpr(japa.parser.ast.expr.AssignExpr) SingleMemberAnnotationExpr(japa.parser.ast.expr.SingleMemberAnnotationExpr) JavadocComment(japa.parser.ast.body.JavadocComment) VariableDeclaratorId(japa.parser.ast.body.VariableDeclaratorId) MemberValuePair(japa.parser.ast.expr.MemberValuePair) ArrayInitializerExpr(japa.parser.ast.expr.ArrayInitializerExpr) WhileStmt(japa.parser.ast.stmt.WhileStmt) ConstructorDeclaration(japa.parser.ast.body.ConstructorDeclaration) EmptyTypeDeclaration(japa.parser.ast.body.EmptyTypeDeclaration) TypeDeclarationStmt(japa.parser.ast.stmt.TypeDeclarationStmt) FieldAccessExpr(japa.parser.ast.expr.FieldAccessExpr) EmptyStmt(japa.parser.ast.stmt.EmptyStmt) ArrayCreationExpr(japa.parser.ast.expr.ArrayCreationExpr) ForStmt(japa.parser.ast.stmt.ForStmt) DoStmt(japa.parser.ast.stmt.DoStmt) ThisExpr(japa.parser.ast.expr.ThisExpr) VariableDeclarationExpr(japa.parser.ast.expr.VariableDeclarationExpr) SuperExpr(japa.parser.ast.expr.SuperExpr) IntegerLiteralMinValueExpr(japa.parser.ast.expr.IntegerLiteralMinValueExpr) ArrayAccessExpr(japa.parser.ast.expr.ArrayAccessExpr) MethodDeclaration(japa.parser.ast.body.MethodDeclaration) BinaryExpr(japa.parser.ast.expr.BinaryExpr) TryStmt(japa.parser.ast.stmt.TryStmt) MarkerAnnotationExpr(japa.parser.ast.expr.MarkerAnnotationExpr) ConditionalExpr(japa.parser.ast.expr.ConditionalExpr) EnumDeclaration(japa.parser.ast.body.EnumDeclaration) ContinueStmt(japa.parser.ast.stmt.ContinueStmt) NullLiteralExpr(japa.parser.ast.expr.NullLiteralExpr) IfStmt(japa.parser.ast.stmt.IfStmt) InitializerDeclaration(japa.parser.ast.body.InitializerDeclaration) LongLiteralMinValueExpr(japa.parser.ast.expr.LongLiteralMinValueExpr) DoubleLiteralExpr(japa.parser.ast.expr.DoubleLiteralExpr) ImportDeclaration(japa.parser.ast.ImportDeclaration) SwitchEntryStmt(japa.parser.ast.stmt.SwitchEntryStmt) Parameter(japa.parser.ast.body.Parameter) TypeParameter(japa.parser.ast.TypeParameter) ParseException(japa.parser.ParseException) EnclosedExpr(japa.parser.ast.expr.EnclosedExpr) AnnotationMemberDeclaration(japa.parser.ast.body.AnnotationMemberDeclaration) MethodCallExpr(japa.parser.ast.expr.MethodCallExpr)

Example 3 with PrimitiveType

use of japa.parser.ast.type.PrimitiveType in project enumerable by hraberg.

the class ExpressionInterpreter method unaryOperation.

public Value unaryOperation(final AbstractInsnNode insn, final Value value) throws AnalyzerException {
    ExpressionValue expressionValue = (ExpressionValue) value;
    switch(insn.getOpcode()) {
        case INEG:
            return new ExpressionValue(PRIMITIVE_INT, new UnaryExpr(expressionValue.expression, UnaryExpr.Operator.negative));
        case IINC:
            IincInsnNode node = (IincInsnNode) insn;
            NameExpr nameExpr = new NameExpr(getLocalVariable(node.var).name);
            if (node.incr == 1)
                iinc = new UnaryExpr(nameExpr, UnaryExpr.Operator.posIncrement);
            if (node.incr == -1)
                iinc = new UnaryExpr(nameExpr, UnaryExpr.Operator.posDecrement);
            if (node.incr > 1)
                iincAssign = new AssignExpr(nameExpr, new IntegerLiteralExpr(node.incr + ""), AssignExpr.Operator.plus);
            if (node.incr < -1)
                iincAssign = new AssignExpr(nameExpr, new IntegerLiteralExpr(-node.incr + ""), AssignExpr.Operator.minus);
            return value;
        case L2I:
        case F2I:
        case D2I:
            return new ExpressionValue(PRIMITIVE_INT, new CastExpr(PRIMITIVE_INT, expressionValue.expression));
        case I2B:
            return new ExpressionValue(PRIMITIVE_BYTE, new CastExpr(PRIMITIVE_BYTE, expressionValue.expression));
        case I2C:
            return new ExpressionValue(PRIMITIVE_CHAR, new CastExpr(PRIMITIVE_CHAR, expressionValue.expression));
        case I2S:
            return new ExpressionValue(PRIMITIVE_SHORT, new CastExpr(PRIMITIVE_SHORT, expressionValue.expression));
        case FNEG:
            return new ExpressionValue(PRIMITIVE_FLOAT, new UnaryExpr(expressionValue.expression, UnaryExpr.Operator.negative));
        case I2F:
        case L2F:
        case D2F:
            return new ExpressionValue(PRIMITIVE_FLOAT, new CastExpr(PRIMITIVE_FLOAT, expressionValue.expression));
        case LNEG:
            return new ExpressionValue(PRIMITIVE_LONG, new UnaryExpr(expressionValue.expression, UnaryExpr.Operator.negative));
        case I2L:
        case F2L:
        case D2L:
            return new ExpressionValue(PRIMITIVE_LONG, new CastExpr(PRIMITIVE_LONG, expressionValue.expression));
        case DNEG:
            return new ExpressionValue(PRIMITIVE_DOUBLE, new UnaryExpr(expressionValue.expression, UnaryExpr.Operator.negative));
        case I2D:
        case L2D:
        case F2D:
            return new ExpressionValue(PRIMITIVE_DOUBLE, new CastExpr(PRIMITIVE_DOUBLE, expressionValue.expression));
        case IFEQ:
            if (conditional != null) {
                if (conditional.getCondition() instanceof BinaryExpr && cmpConditional) {
                    ((BinaryExpr) conditional.getCondition()).setOperator(BinaryExpr.Operator.notEquals);
                    cmpConditional = false;
                } else {
                    handleNestedConditional(expressionValue.expression);
                }
            } else {
                conditional = new ConditionalExpr(expressionValue.expression, null, null);
            }
            return null;
        case IFNE:
            if (conditional != null) {
                if (conditional.getCondition() instanceof BinaryExpr && cmpConditional) {
                    ((BinaryExpr) conditional.getCondition()).setOperator(BinaryExpr.Operator.equals);
                    cmpConditional = false;
                } else {
                    handleNestedConditional(new UnaryExpr(expressionValue.expression, UnaryExpr.Operator.not));
                }
            } else {
                conditional = new ConditionalExpr(new UnaryExpr(expressionValue.expression, UnaryExpr.Operator.not), null, null);
            }
            return null;
        case IFGT:
            ((BinaryExpr) conditional.getCondition()).setOperator(BinaryExpr.Operator.lessEquals);
            cmpConditional = false;
            return null;
        case IFLE:
            ((BinaryExpr) conditional.getCondition()).setOperator(BinaryExpr.Operator.greater);
            cmpConditional = false;
            return null;
        case IFLT:
            ((BinaryExpr) conditional.getCondition()).setOperator(BinaryExpr.Operator.greaterEquals);
            cmpConditional = false;
            return null;
        case IFGE:
            ((BinaryExpr) conditional.getCondition()).setOperator(BinaryExpr.Operator.less);
            cmpConditional = false;
            return null;
        case TABLESWITCH:
        case LOOKUPSWITCH:
            throw new UnsupportedOperationException(AbstractVisitor.OPCODES[insn.getOpcode()]);
        case IRETURN:
        case LRETURN:
        case FRETURN:
        case DRETURN:
        case ARETURN:
            return null;
        case PUTSTATIC:
            FieldInsnNode fieldNode = (FieldInsnNode) insn;
            ExpressionValue putField = (ExpressionValue) newValue(getType(fieldNode.desc));
            putField.expression = new AssignExpr(new FieldAccessExpr(new NameExpr(removeJavaLang(getObjectType(fieldNode.owner).getClassName())), fieldNode.name), expressionValue.expression, AssignExpr.Operator.assign);
            assign = putField;
            return null;
        case GETFIELD:
            fieldNode = (FieldInsnNode) insn;
            ExpressionValue getField = (ExpressionValue) newValue(Type.getType(fieldNode.desc));
            getField.expression = new FieldAccessExpr(expressionValue.expression, fieldNode.name);
            return getField;
        case NEWARRAY:
            PrimitiveType type;
            switch(((IntInsnNode) insn).operand) {
                case T_BOOLEAN:
                    type = PRIMITIVE_BOOLEAN;
                    break;
                case T_CHAR:
                    type = PRIMITIVE_CHAR;
                    break;
                case T_BYTE:
                    type = PRIMITIVE_BYTE;
                    break;
                case T_SHORT:
                    type = PRIMITIVE_SHORT;
                    break;
                case T_INT:
                    type = PRIMITIVE_INT;
                    break;
                case T_FLOAT:
                    type = PRIMITIVE_FLOAT;
                    break;
                case T_DOUBLE:
                    type = PRIMITIVE_DOUBLE;
                    break;
                case T_LONG:
                    type = PRIMITIVE_LONG;
                    break;
                default:
                    throw new AnalyzerException(insn, "Invalid array type");
            }
            ArrayList<Expression> dimensions = new ArrayList<Expression>();
            dimensions.add(expressionValue.expression);
            return new ExpressionValue(new ReferenceType(type, 1), new ArrayCreationExpr(type, dimensions, 0));
        case ANEWARRAY:
            ExpressionValue newArray = (ExpressionValue) newValue(Type.getObjectType(((TypeInsnNode) insn).desc));
            dimensions = new ArrayList<Expression>();
            dimensions.add(expressionValue.expression);
            newArray.expression = new ArrayCreationExpr(newArray.type, dimensions, 0);
            return newArray;
        case ARRAYLENGTH:
            return new ExpressionValue(PRIMITIVE_INT, new FieldAccessExpr(expressionValue.expression, "length"));
        case ATHROW:
            throw new UnsupportedOperationException(AbstractVisitor.OPCODES[insn.getOpcode()]);
        case CHECKCAST:
            ExpressionValue cast = (ExpressionValue) newValue(Type.getObjectType(((TypeInsnNode) insn).desc));
            cast.expression = new CastExpr(new ReferenceType(cast.type), expressionValue.expression);
            return cast;
        case INSTANCEOF:
            ExpressionValue instanceOf = (ExpressionValue) newValue(Type.getObjectType(((TypeInsnNode) insn).desc));
            instanceOf.expression = new InstanceOfExpr(expressionValue.expression, new ReferenceType(instanceOf.type));
            return instanceOf;
        case MONITORENTER:
        case MONITOREXIT:
            throw new UnsupportedOperationException(AbstractVisitor.OPCODES[insn.getOpcode()]);
        case IFNULL:
            handleNestedConditional(new BinaryExpr(expressionValue.expression, new NullLiteralExpr(), BinaryExpr.Operator.notEquals));
            return null;
        case IFNONNULL:
            handleNestedConditional(new BinaryExpr(expressionValue.expression, new NullLiteralExpr(), BinaryExpr.Operator.equals));
            return null;
        default:
            throw new Error("Internal error.");
    }
}
Also used : AnalyzerException(org.objectweb.asm.tree.analysis.AnalyzerException) ArrayList(java.util.ArrayList) FieldInsnNode(org.objectweb.asm.tree.FieldInsnNode) IntInsnNode(org.objectweb.asm.tree.IntInsnNode) ReferenceType(japa.parser.ast.type.ReferenceType) IincInsnNode(org.objectweb.asm.tree.IincInsnNode) PrimitiveType(japa.parser.ast.type.PrimitiveType)

Aggregations

ParseException (japa.parser.ParseException)2 BlockComment (japa.parser.ast.BlockComment)2 CompilationUnit (japa.parser.ast.CompilationUnit)2 ImportDeclaration (japa.parser.ast.ImportDeclaration)2 LineComment (japa.parser.ast.LineComment)2 PackageDeclaration (japa.parser.ast.PackageDeclaration)2 TypeParameter (japa.parser.ast.TypeParameter)2 AnnotationDeclaration (japa.parser.ast.body.AnnotationDeclaration)2 AnnotationMemberDeclaration (japa.parser.ast.body.AnnotationMemberDeclaration)2 ClassOrInterfaceDeclaration (japa.parser.ast.body.ClassOrInterfaceDeclaration)2 ConstructorDeclaration (japa.parser.ast.body.ConstructorDeclaration)2 EmptyMemberDeclaration (japa.parser.ast.body.EmptyMemberDeclaration)2 EmptyTypeDeclaration (japa.parser.ast.body.EmptyTypeDeclaration)2 EnumConstantDeclaration (japa.parser.ast.body.EnumConstantDeclaration)2 EnumDeclaration (japa.parser.ast.body.EnumDeclaration)2 FieldDeclaration (japa.parser.ast.body.FieldDeclaration)2 InitializerDeclaration (japa.parser.ast.body.InitializerDeclaration)2 JavadocComment (japa.parser.ast.body.JavadocComment)2 MethodDeclaration (japa.parser.ast.body.MethodDeclaration)2 Parameter (japa.parser.ast.body.Parameter)2