From ce2b823193ceb1808f1d569d2a4ab0e958ff6279 Mon Sep 17 00:00:00 2001 From: David Renz Date: Tue, 29 Mar 2016 11:34:54 +0200 Subject: [PATCH] Added missing notes to visitor --- .../pmd/lang/apex/ast/ApexParserVisitor.java | 164 +++++++++-- .../apex/ast/ApexParserVisitorAdapter.java | 274 +++++++++++++++++- .../pmd/lang/apex/ast/ApexTreeBuilder.java | 2 +- 3 files changed, 409 insertions(+), 31 deletions(-) diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexParserVisitor.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexParserVisitor.java index 6325f9a292..79d55687fe 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexParserVisitor.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexParserVisitor.java @@ -4,59 +4,167 @@ package net.sourceforge.pmd.lang.apex.ast; public interface ApexParserVisitor { - Object visit(ApexNode node, Object data); + Object visit(ApexNode node, Object data); - Object visit(ASTUserClass node, Object data); + Object visit(ASTAnnotation node, Object data); - Object visit(ASTMethod node, Object data); + Object visit(ASTAnonymousClass node, Object data); - Object visit(ASTModifierNode node, Object data); + Object visit(ASTArrayLoadExpression node, Object data); - Object visit(ASTParameter node, Object data); + Object visit(ASTArrayStoreExpression node, Object data); - Object visit(ASTBlockStatement node, Object data); + Object visit(ASTAssignmentExpression node, Object data); - Object visit(ASTUserClassMethods node, Object data); + Object visit(ASTBinaryExpression node, Object data); - Object visit(ASTBridgeMethodCreator node, Object data); + Object visit(ASTBindExpressions node, Object data); - Object visit(ASTReturnStatement node, Object data); + Object visit(ASTBlockStatement node, Object data); - Object visit(ASTLiteralExpression node, Object data); + Object visit(ASTBooleanExpression node, Object data); - Object visit(ASTConstructorPreambleStatement node, Object data); + Object visit(ASTBreakStatement node, Object data); - Object visit(ASTUserInterface node, Object data); + Object visit(ASTBridgeMethodCreator node, Object data); - Object visit(ASTUserEnum node, Object data); + Object visit(ASTCatchBlockStatement node, Object data); - Object visit(ASTFieldDeclaration node, Object data); + Object visit(ASTClassRefExpression node, Object data); - Object visit(ASTWhileLoopStatement node, Object data); + Object visit(ASTCompilation node, Object data); - Object visit(ASTTryCatchFinallyBlockStatement node, Object data); + Object visit(ASTConstructorPreambleStatement node, Object data); - Object visit(ASTForLoopStatement node, Object data); + Object visit(ASTContinueStatement node, Object data); - Object visit(ASTIfElseBlockStatement node, Object data); + Object visit(ASTDmlDeleteStatement node, Object data); - Object visit(ASTIfBlockStatement node, Object data); + Object visit(ASTDmlInsertStatement node, Object data); - Object visit(ASTForEachStatement node, Object data); + Object visit(ASTDmlMergeStatement node, Object data); - Object visit(ASTDoLoopStatement node, Object data); + Object visit(ASTDmlUndeleteStatement node, Object data); - Object visit(ASTTernaryExpression node, Object data); + Object visit(ASTDmlUpdateStatement node, Object data); - Object visit(ASTCompilation node, Object data); + Object visit(ASTDmlUpsertStatement node, Object data); - Object visit(ASTField node, Object data); + Object visit(ASTDoLoopStatement node, Object data); - Object visit(ASTBreakStatement node, Object data); + Object visit(ASTDottedExpression node, Object data); - Object visit(ASTThrowStatement node, Object data); + Object visit(ASTExpression node, Object data); - Object visit(ASTSoqlExpression node, Object data); + Object visit(ASTExpressionStatement node, Object data); - Object visit(ASTBooleanExpression node, Object data); + Object visit(ASTField node, Object data); + + Object visit(ASTFieldDeclaration node, Object data); + + Object visit(ASTFieldDeclarationStatements node, Object data); + + Object visit(ASTForEachStatement node, Object data); + + Object visit(ASTForLoopStatement node, Object data); + + Object visit(ASTIfBlockStatement node, Object data); + + Object visit(ASTIfElseBlockStatement node, Object data); + + Object visit(ASTInstanceOfExpression node, Object data); + + Object visit(ASTJavaMethodCallExpression node, Object data); + + Object visit(ASTJavaVariableExpression node, Object data); + + Object visit(ASTLiteralExpression node, Object data); + + Object visit(ASTMapEntryNode node, Object data); + + Object visit(ASTMethod node, Object data); + + Object visit(ASTMethodCallExpression node, Object data); + + Object visit(ASTModifierNode node, Object data); + + Object visit(ASTModifierOrAnnotation node, Object data); + + Object visit(ASTNewListInitExpression node, Object data); + + Object visit(ASTNewListLiteralExpression node, Object data); + + Object visit(ASTNewMapInitExpression node, Object data); + + Object visit(ASTNewMapLiteralExpression node, Object data); + + Object visit(ASTNewNameValueObjectExpression node, Object data); + + Object visit(ASTNewObjectExpression node, Object data); + + Object visit(ASTNewSetInitExpression node, Object data); + + Object visit(ASTNewSetLiteralExpression node, Object data); + + Object visit(ASTPackageVersionExpression node, Object data); + + Object visit(ASTParameter node, Object data); + + Object visit(ASTPostfixExpression node, Object data); + + Object visit(ASTPrefixExpression node, Object data); + + Object visit(ASTProperty node, Object data); + + Object visit(ASTReferenceExpression node, Object data); + + Object visit(ASTReturnStatement node, Object data); + + Object visit(ASTRunAsBlockStatement node, Object data); + + Object visit(ASTSoqlExpression node, Object data); + + Object visit(ASTSoslExpression node, Object data); + + Object visit(ASTStandardCondition node, Object data); + + Object visit(ASTStatement node, Object data); + + Object visit(ASTSuperMethodCallExpression node, Object data); + + Object visit(ASTSuperVariableExpression node, Object data); + + Object visit(ASTTernaryExpression node, Object data); + + Object visit(ASTTestNode node, Object data); + + Object visit(ASTThisMethodCallExpression node, Object data); + + Object visit(ASTThisVariableExpression node, Object data); + + Object visit(ASTThrowStatement node, Object data); + + Object visit(ASTTriggerVariableExpression node, Object data); + + Object visit(ASTTryCatchFinallyBlockStatement node, Object data); + + Object visit(ASTUserClass node, Object data); + + Object visit(ASTUserClassMethods node, Object data); + + Object visit(ASTUserEnum node, Object data); + + Object visit(ASTUserExceptionMethods node, Object data); + + Object visit(ASTUserInterface node, Object data); + + Object visit(ASTUserTrigger node, Object data); + + Object visit(ASTVariableDeclaration node, Object data); + + Object visit(ASTVariableDeclarationStatements node, Object data); + + Object visit(ASTVariableExpression node, Object data); + + Object visit(ASTWhileLoopStatement node, Object data); } diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexParserVisitorAdapter.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexParserVisitorAdapter.java index bab5a9cc9f..2989f97799 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexParserVisitorAdapter.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexParserVisitorAdapter.java @@ -77,8 +77,7 @@ public class ApexParserVisitorAdapter implements ApexParserVisitor { @Override public Object visit(ASTWhileLoopStatement node, Object data) { - // TODO Auto-generated method stub - return null; + return visit((ApexNode) node, data); } @Override @@ -145,4 +144,275 @@ public class ApexParserVisitorAdapter implements ApexParserVisitor { public Object visit(ASTBooleanExpression node, Object data) { return visit((ApexNode) node, data); } + + @Override + public Object visit(ASTAnnotation node, Object data) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Object visit(ASTAnonymousClass node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTArrayLoadExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTArrayStoreExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTAssignmentExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTBinaryExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTBindExpressions node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTCatchBlockStatement node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTClassRefExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTContinueStatement node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTDmlDeleteStatement node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTDmlInsertStatement node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTDmlMergeStatement node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTDmlUndeleteStatement node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTDmlUpdateStatement node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTDmlUpsertStatement node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTDottedExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTExpressionStatement node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTFieldDeclarationStatements node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTInstanceOfExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTJavaMethodCallExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTJavaVariableExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTMapEntryNode node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTMethodCallExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTModifierOrAnnotation node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTNewListInitExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTNewListLiteralExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTNewMapInitExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTNewMapLiteralExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTNewNameValueObjectExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTNewObjectExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTNewSetInitExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTNewSetLiteralExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTPackageVersionExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTPostfixExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTPrefixExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTProperty node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTReferenceExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTRunAsBlockStatement node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTSoslExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTStandardCondition node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTStatement node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTSuperMethodCallExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTSuperVariableExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTTestNode node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTThisMethodCallExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTThisVariableExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTTriggerVariableExpression node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTUserExceptionMethods node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTUserTrigger node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTVariableDeclaration node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTVariableDeclarationStatements node, Object data) { + return visit((ApexNode) node, data); + } + + @Override + public Object visit(ASTVariableExpression node, Object data) { + return visit((ApexNode) node, data); + } } diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexTreeBuilder.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexTreeBuilder.java index 73d401304b..53de6560f9 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexTreeBuilder.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ApexTreeBuilder.java @@ -107,8 +107,8 @@ public final class ApexTreeBuilder extends AstVisitor { register(BinaryExpression.class, ASTBinaryExpression.class); register(BindExpressions.class, ASTBindExpressions.class); register(BlockStatement.class, ASTBlockStatement.class); - register(BreakStatement.class, ASTBreakStatement.class); register(BooleanExpression.class, ASTBooleanExpression.class); + register(BreakStatement.class, ASTBreakStatement.class); register(BridgeMethodCreator.class, ASTBridgeMethodCreator.class); register(CatchBlockStatement.class, ASTCatchBlockStatement.class); register(ClassRefExpression.class, ASTClassRefExpression.class);