BaseTreeVisitor implements TreeVisitor { @Override public void visitNumericLiteral(NumericLiteral pyNumericLiteralTree) { }  @Override void visitFileInput(FileInput fileInput); @Override void visitStatementList(StatementList statementList); @Override void visitIfStatement(IfStatement pyIfStatementTree); @Override void visitElseClause(ElseClause pyElseClauseTree); @Override void visitExecStatement(ExecStatement pyExecStatementTree); @Override void visitAssertStatement(AssertStatement pyAssertStatementTree); @Override void visitDelStatement(DelStatement pyDelStatementTree); @Override void visitPassStatement(PassStatement pyPassStatementTree); @Override void visitPrintStatement(PrintStatement pyPrintStatementTree); @Override void visitReturnStatement(ReturnStatement pyReturnStatementTree); @Override void visitYieldStatement(YieldStatement pyYieldStatementTree); @Override void visitYieldExpression(YieldExpression pyYieldExpressionTree); @Override void visitRaiseStatement(RaiseStatement pyRaiseStatementTree); @Override void visitBreakStatement(BreakStatement pyBreakStatementTree); @Override void visitContinueStatement(ContinueStatement pyContinueStatementTree); @Override void visitFunctionDef(FunctionDef pyFunctionDefTree); @Override void visitName(Name pyNameTree); @Override void visitClassDef(ClassDef pyClassDefTree); @Override void visitAliasedName(AliasedName aliasedName); @Override void visitDottedName(DottedName dottedName); @Override void visitImportFrom(ImportFrom pyImportFromTree); @Override void visitForStatement(ForStatement pyForStatementTree); @Override void visitImportName(ImportName pyImportNameTree); @Override void visitGlobalStatement(GlobalStatement pyGlobalStatementTree); @Override void visitNonlocalStatement(NonlocalStatement pyNonlocalStatementTree); @Override void visitWhileStatement(WhileStatement pyWhileStatementTree); @Override void visitExpressionStatement(ExpressionStatement pyExpressionStatementTree); @Override void visitTryStatement(TryStatement pyTryStatementTree); @Override void visitFinallyClause(FinallyClause finallyClause); @Override void visitExceptClause(ExceptClause exceptClause); @Override void visitWithStatement(WithStatement pyWithStatementTree); @Override void visitWithItem(WithItem withItem); @Override void visitQualifiedExpression(QualifiedExpression pyQualifiedExpressionTree); @Override void visitCallExpression(CallExpression pyCallExpressionTree); @Override void visitArgumentList(ArgList argList); @Override void visitRegularArgument(RegularArgument regularArgumentTree); @Override void visitAssignmentStatement(AssignmentStatement pyAssignmentStatementTree); @Override void visitAssignmentExpression(AssignmentExpression assignmentExpression); @Override void visitExpressionList(ExpressionList pyExpressionListTree); @Override void visitBinaryExpression(BinaryExpression pyBinaryExpressionTree); @Override void visitLambda(LambdaExpression pyLambdaExpressionTree); @Override void visitParameterList(ParameterList parameterList); @Override void visitTupleParameter(TupleParameter tree); @Override void visitParameter(Parameter tree); @Override void visitTypeAnnotation(TypeAnnotation tree); @Override void visitNumericLiteral(NumericLiteral pyNumericLiteralTree); @Override void visitStringLiteral(StringLiteral pyStringLiteralTree); @Override void visitStringElement(StringElement tree); @Override void visitListLiteral(ListLiteral pyListLiteralTree); @Override void visitUnaryExpression(UnaryExpression pyUnaryExpressionTree); @Override void visitUnpackingExpression(UnpackingExpression unpackingExpressionTree); @Override void visitAwaitExpression(AwaitExpression pyAwaitExpressionTree); @Override void visitSliceExpression(SliceExpression pySliceExpressionTree); @Override void visitSliceList(SliceList sliceList); @Override void visitSliceItem(SliceItem sliceItem); @Override void visitSubscriptionExpression(SubscriptionExpression pySubscriptionExpressionTree); @Override void visitParenthesizedExpression(ParenthesizedExpression pyParenthesizedExpressionTree); @Override void visitTuple(Tuple pyTupleTree); @Override void visitConditionalExpression(ConditionalExpression pyConditionalExpressionTree); @Override void visitPyListOrSetCompExpression(ComprehensionExpression tree); @Override void visitComprehensionFor(ComprehensionFor tree); @Override void visitComprehensionIf(ComprehensionIf tree); @Override void visitDictionaryLiteral(DictionaryLiteral pyDictionaryLiteralTree); @Override void visitSetLiteral(SetLiteral pySetLiteralTree); @Override void visitKeyValuePair(KeyValuePair keyValuePair); @Override void visitDictCompExpression(DictCompExpressionImpl tree); @Override void visitCompoundAssignment(CompoundAssignmentStatement pyCompoundAssignmentStatementTree); @Override void visitAnnotatedAssignment(AnnotatedAssignment annotatedAssignment); @Override void visitNone(NoneExpression pyNoneExpressionTree); @Override void visitRepr(ReprExpression pyReprExpressionTree); @Override void visitEllipsis(EllipsisExpression pyEllipsisExpressionTree); @Override void visitDecorator(Decorator decorator); void visitToken(Token token); @Override void visitFormattedExpression(FormattedExpression formattedExpression); @Override void visitFormatSpecifier(FormatSpecifier formatSpecifier);  }
@Test public void assignment_expr() { setRootRule(PythonGrammar.NAMED_EXPR_TEST); AstNode astNode = p.parse("b := 42"); AssignmentExpression assignmentExpression = (AssignmentExpression) treeMaker.expression(astNode); FirstLastTokenVerifierVisitor visitor = spy(FirstLastTokenVerifierVisitor.class); assignmentExpression.accept(visitor); verify(visitor).visitNumericLiteral((NumericLiteral) assignmentExpression.expression()); }
@Test public void repr_expression() { setRootRule(PythonGrammar.ATOM); ReprExpression expr = (ReprExpression) parse("`1`", treeMaker::expression); FirstLastTokenVerifierVisitor visitor = spy(FirstLastTokenVerifierVisitor.class); expr.accept(visitor); verify(visitor).visitNumericLiteral((NumericLiteral) expr.expressionList().expressions().get(0)); }