Interface SourceVisitor<T>

    • Method Detail

      • visitCompilationUnit

        default T visitCompilationUnit​(CompilationUnit cu)
        Visits a compilation unit.
        Parameters:
        cu - the compilation unit node
        Returns:
        the visitor's result, null unless overridden
      • visitImportDecl

        default T visitImportDecl​(ImportDecl decl)
        Visits an import declaration.
        Parameters:
        decl - the declaration node
        Returns:
        the visitor's result, null unless overridden
      • visitClassDecl

        default T visitClassDecl​(ClassDecl decl)
        Visits a class declaration.
        Parameters:
        decl - the declaration node
        Returns:
        the visitor's result, null unless overridden
      • visitInterfaceDecl

        default T visitInterfaceDecl​(InterfaceDecl decl)
        Visits an interface declaration.
        Parameters:
        decl - the declaration node
        Returns:
        the visitor's result, null unless overridden
      • visitEnumDecl

        default T visitEnumDecl​(EnumDecl decl)
        Visits an enum declaration.
        Parameters:
        decl - the declaration node
        Returns:
        the visitor's result, null unless overridden
      • visitEnumConstantDecl

        default T visitEnumConstantDecl​(EnumConstantDecl decl)
        Visits one enum constant.
        Parameters:
        decl - the declaration node
        Returns:
        the visitor's result, null unless overridden
      • visitMethodDecl

        default T visitMethodDecl​(MethodDecl decl)
        Visits a method declaration.
        Parameters:
        decl - the declaration node
        Returns:
        the visitor's result, null unless overridden
      • visitConstructorDecl

        default T visitConstructorDecl​(ConstructorDecl decl)
        Visits a constructor declaration.
        Parameters:
        decl - the declaration node
        Returns:
        the visitor's result, null unless overridden
      • visitFieldDecl

        default T visitFieldDecl​(FieldDecl decl)
        Visits a field declaration.
        Parameters:
        decl - the declaration node
        Returns:
        the visitor's result, null unless overridden
      • visitParameterDecl

        default T visitParameterDecl​(ParameterDecl decl)
        Visits a method or constructor parameter.
        Parameters:
        decl - the declaration node
        Returns:
        the visitor's result, null unless overridden
      • visitAnnotationExpr

        default T visitAnnotationExpr​(AnnotationExpr expr)
        Visits an annotation use.
        Parameters:
        expr - the annotation node
        Returns:
        the visitor's result, null unless overridden
      • visitBlock

        T visitBlock​(BlockStmt stmt)
        Visits a braced block.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitIf

        T visitIf​(IfStmt stmt)
        Visits an if statement.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitWhile

        T visitWhile​(WhileStmt stmt)
        Visits a while loop.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitDoWhile

        T visitDoWhile​(DoWhileStmt stmt)
        Visits a do-while loop.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitFor

        T visitFor​(ForStmt stmt)
        Visits a counted for loop.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitForEach

        T visitForEach​(ForEachStmt stmt)
        Visits an enhanced for loop.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitSwitch

        T visitSwitch​(SwitchStmt stmt)
        Visits a switch statement.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitTryCatch

        T visitTryCatch​(TryCatchStmt stmt)
        Visits a try statement, with its catch clauses and finally block.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitReturn

        T visitReturn​(ReturnStmt stmt)
        Visits a return statement.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitThrow

        T visitThrow​(ThrowStmt stmt)
        Visits a throw statement.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitVarDecl

        T visitVarDecl​(VarDeclStmt stmt)
        Visits a local variable declaration.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitExprStmt

        T visitExprStmt​(ExprStmt stmt)
        Visits an expression used as a statement.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitSynchronized

        T visitSynchronized​(SynchronizedStmt stmt)
        Visits a synchronized block.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitLabeled

        T visitLabeled​(LabeledStmt stmt)
        Visits a labeled statement.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitBreak

        T visitBreak​(BreakStmt stmt)
        Visits a break statement.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitContinue

        T visitContinue​(ContinueStmt stmt)
        Visits a continue statement.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitIRRegion

        T visitIRRegion​(IRRegionStmt stmt)
        Visits a region of control flow that stayed in IR form because it could not be structured.
        Parameters:
        stmt - the statement node
        Returns:
        the visitor's result
      • visitLiteral

        T visitLiteral​(LiteralExpr expr)
        Visits a literal.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitVarRef

        T visitVarRef​(VarRefExpr expr)
        Visits a variable reference.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitFieldAccess

        T visitFieldAccess​(FieldAccessExpr expr)
        Visits a field access.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitArrayAccess

        T visitArrayAccess​(ArrayAccessExpr expr)
        Visits an array element access.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitMethodCall

        T visitMethodCall​(MethodCallExpr expr)
        Visits a method call.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitNew

        T visitNew​(NewExpr expr)
        Visits an object allocation.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitNewArray

        T visitNewArray​(NewArrayExpr expr)
        Visits an array allocation.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitArrayInit

        T visitArrayInit​(ArrayInitExpr expr)
        Visits a braced array initializer.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitBinary

        T visitBinary​(BinaryExpr expr)
        Visits a binary operation.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitUnary

        T visitUnary​(UnaryExpr expr)
        Visits a unary operation.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitCast

        T visitCast​(CastExpr expr)
        Visits a cast.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitInstanceOf

        T visitInstanceOf​(InstanceOfExpr expr)
        Visits an instanceof test.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitTernary

        T visitTernary​(TernaryExpr expr)
        Visits a ternary conditional.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitSwitchExpr

        default T visitSwitchExpr​(SwitchExpr expr)
        Default so existing visitors need no change; only the source emitter overrides it.
        Parameters:
        expr - the switch expression to visit
        Returns:
        the visitor result, null unless overridden
      • visitLambda

        T visitLambda​(LambdaExpr expr)
        Visits a lambda expression.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitMethodRef

        T visitMethodRef​(MethodRefExpr expr)
        Visits a method reference.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitThis

        T visitThis​(ThisExpr expr)
        Visits a this reference.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitSuper

        T visitSuper​(SuperExpr expr)
        Visits a super reference.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitClass

        T visitClass​(ClassExpr expr)
        Visits a class literal.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitDynamicConstant

        T visitDynamicConstant​(DynamicConstantExpr expr)
        Visits a dynamically computed constant.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitInvokeDynamic

        T visitInvokeDynamic​(InvokeDynamicExpr expr)
        Visits an invokedynamic call site.
        Parameters:
        expr - the expression node
        Returns:
        the visitor's result
      • visitPrimitiveType

        T visitPrimitiveType​(PrimitiveSourceType type)
        Visits a primitive type.
        Parameters:
        type - the type node
        Returns:
        the visitor's result
      • visitReferenceType

        T visitReferenceType​(ReferenceSourceType type)
        Visits a class or interface type.
        Parameters:
        type - the type node
        Returns:
        the visitor's result
      • visitArrayType

        T visitArrayType​(ArraySourceType type)
        Visits an array type.
        Parameters:
        type - the type node
        Returns:
        the visitor's result
      • visitVoidType

        T visitVoidType​(VoidSourceType type)
        Visits the void type.
        Parameters:
        type - the type node
        Returns:
        the visitor's result