Class ExpectedTreesVisitor
java.lang.Object
com.sun.source.util.TreeScanner<Void,Void>
org.checkerframework.framework.ajava.TreeScannerWithDefaults
org.checkerframework.framework.ajava.ExpectedTreesVisitor
- All Implemented Interfaces:
TreeVisitor<Void,
Void>
After this visitor visits a tree,
getTrees()
returns all the trees that should match with
some JavaParser node. Some trees shouldn't be matched with a JavaParser node because there isn't
a corresponding JavaParser node. These trees are excluded.
The primary purpose is to test the JointJavacJavaParserVisitor
class when the
-AajavaChecks
flag is used. That class traverses a javac tree and JavaParser AST simultaneously,
so the trees this class stores can be used to test if the entirety of the javac tree was visited.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
defaultAction
(Tree tree) Records thattree
should have a corresponding JavaParser node.getTrees()
Returns the visited trees that should match to some JavaParser node.visitAnnotation
(AnnotationTree tree, Void p) visitBindingPattern17
(Tree tree, Void p) Visit a binding pattern tree.visitClass
(ClassTree tree, Void p) visitDoWhileLoop
(DoWhileLoopTree tree, Void p) visitEmptyStatement
(EmptyStatementTree tree, Void p) visitForLoop
(ForLoopTree tree, Void p) visitImport
(ImportTree tree, Void p) visitMethod
(MethodTree tree, Void p) visitModifiers
(ModifiersTree tree, Void p) visitNewArray
(NewArrayTree tree, Void p) visitNewClass
(NewClassTree tree, Void p) visitSwitch
(SwitchTree tree, Void p) visitSwitchExpression17
(Tree tree, Void p) Visit a switch expression tree.visitSynchronized
(SynchronizedTree tree, Void p) visitVariable
(VariableTree tree, Void p) visitWhileLoop
(WhileLoopTree tree, Void p) visitYield17
(Tree tree, Void p) Visit a yield tree.Methods inherited from class org.checkerframework.framework.ajava.TreeScannerWithDefaults
scan, visitAnnotatedType, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBinary, visitBlock, visitBreak, visitCase, visitCatch, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitContinue, visitEnhancedForLoop, visitErroneous, visitExports, visitIdentifier, visitInstanceOf, visitIntersectionType, visitLabeledStatement, visitLiteral, visitMemberReference, visitMemberSelect, visitModule, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPrimitiveType, visitProvides, visitRequires, visitReturn, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnary, visitUnionType, visitUses, visitWildcard
Methods inherited from class com.sun.source.util.TreeScanner
reduce, scan, visitBindingPattern, visitDefaultCaseLabel, visitGuardedPattern, visitParenthesizedPattern, visitSwitchExpression, visitYield
-
Constructor Details
-
ExpectedTreesVisitor
public ExpectedTreesVisitor()
-
-
Method Details
-
getTrees
Returns the visited trees that should match to some JavaParser node.- Returns:
- the visited trees that should match to some JavaParser node
-
defaultAction
Records thattree
should have a corresponding JavaParser node.- Specified by:
defaultAction
in classTreeScannerWithDefaults
- Parameters:
tree
- the tree to record
-
visitAnnotation
- Specified by:
visitAnnotation
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitAnnotation
in classTreeScannerWithDefaults
-
visitBindingPattern17
Description copied from class:TreeScannerWithDefaults
Visit a binding pattern tree.- Overrides:
visitBindingPattern17
in classTreeScannerWithDefaults
- Parameters:
tree
- a binding pattern treep
- null- Returns:
- null
-
visitClass
- Specified by:
visitClass
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitClass
in classTreeScannerWithDefaults
-
visitExpressionStatement
- Specified by:
visitExpressionStatement
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitExpressionStatement
in classTreeScannerWithDefaults
-
visitForLoop
- Specified by:
visitForLoop
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitForLoop
in classTreeScannerWithDefaults
-
visitSwitch
- Specified by:
visitSwitch
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitSwitch
in classTreeScannerWithDefaults
-
visitSwitchExpression17
Description copied from class:TreeScannerWithDefaults
Visit a switch expression tree.- Overrides:
visitSwitchExpression17
in classTreeScannerWithDefaults
- Parameters:
tree
- switch expression treep
- null- Returns:
- null
-
visitSynchronized
- Specified by:
visitSynchronized
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitSynchronized
in classTreeScannerWithDefaults
-
visitIf
- Specified by:
visitIf
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitIf
in classTreeScannerWithDefaults
-
visitImport
- Specified by:
visitImport
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitImport
in classTreeScannerWithDefaults
-
visitMethod
- Specified by:
visitMethod
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitMethod
in classTreeScannerWithDefaults
-
visitMethodInvocation
- Specified by:
visitMethodInvocation
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitMethodInvocation
in classTreeScannerWithDefaults
-
visitModifiers
- Specified by:
visitModifiers
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitModifiers
in classTreeScannerWithDefaults
-
visitNewArray
- Specified by:
visitNewArray
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitNewArray
in classTreeScannerWithDefaults
-
visitNewClass
- Specified by:
visitNewClass
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitNewClass
in classTreeScannerWithDefaults
-
visitLambdaExpression
- Specified by:
visitLambdaExpression
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitLambdaExpression
in classTreeScannerWithDefaults
-
visitWhileLoop
- Specified by:
visitWhileLoop
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitWhileLoop
in classTreeScannerWithDefaults
-
visitDoWhileLoop
- Specified by:
visitDoWhileLoop
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitDoWhileLoop
in classTreeScannerWithDefaults
-
visitVariable
- Specified by:
visitVariable
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitVariable
in classTreeScannerWithDefaults
-
visitYield17
Description copied from class:TreeScannerWithDefaults
Visit a yield tree.- Overrides:
visitYield17
in classTreeScannerWithDefaults
- Parameters:
tree
- a yield treep
- null- Returns:
- null
-
visitEmptyStatement
- Specified by:
visitEmptyStatement
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitEmptyStatement
in classTreeScannerWithDefaults
-