@Test public void testNoArrayInfo() throws Exception { new StandardVisitor() { @Override public void visitArrayInfo(ArrayInfo arrayInfo) { fail("There is no array info in the AST, so this method should not get called."); } }.visit(ParseHelper.parse("void foo(int x) { }")); }
@Override public void visit(IAstNode node) { if (node == null) { throw new RuntimeException("Attempt to visit null node"); } currentDepth++; node.accept(this); currentDepth--; }
StandardVisitor implements IAstVisitor { @Override public void visit(IAstNode node) { if (node == null) { throw new RuntimeException("Attempt to visit null node"); } currentDepth++; node.accept(this); currentDepth--; } }
StandardVisitor implements IAstVisitor { @Override public void visit(IAstNode node) { if (node == null) { throw new RuntimeException("Attempt to visit null node"); } currentDepth++; node.accept(this); currentDepth--; } StandardVisitor(); }
StandardVisitor implements IAstVisitor { @Override public void visit(IAstNode node) { if (node == null) { throw new RuntimeException("Attempt to visit null node"); } currentDepth++; node.accept(this); currentDepth--; } StandardVisitor(); VisitationDepth getVistitationDepth(); @Override void visit(IAstNode node); @Override void visitFunctionDefinition(FunctionDefinition functionDefinition); @Override void visitTranslationUnit(TranslationUnit translationUnit); @Override void visitFunctionPrototype(FunctionPrototype functionPrototype); @Override void visitBlockStmt(BlockStmt stmt); @Override void visitIfStmt(IfStmt ifStmt); @Override void visitDeclarationStmt(DeclarationStmt declarationStmt); @Override void visitVariablesDeclaration(VariablesDeclaration variablesDeclaration); @Override void visitPrecisionDeclaration(PrecisionDeclaration precisionDeclaration); @Override void visitInitializer(Initializer initializer); @Override void visitBinaryExpr(BinaryExpr binaryExpr); @Override void visitParenExpr(ParenExpr parenExpr); @Override void visitVariableIdentifierExpr(VariableIdentifierExpr variableIdentifierExpr); @Override void visitUnaryExpr(UnaryExpr unaryExpr); @Override void visitMemberLookupExpr(MemberLookupExpr memberLookupExpr); @Override void visitDiscardStmt(DiscardStmt discardStmt); @Override void visitBreakStmt(BreakStmt breakStmt); @Override void visitContinueStmt(ContinueStmt continueStmt); @Override void visitReturnStmt(ReturnStmt returnStmt); @Override void visitFunctionCallExpr(FunctionCallExpr functionCallExpr); @Override void visitExprStmt(ExprStmt exprStmt); @Override void visitTypeConstructorExpr(TypeConstructorExpr typeConstructorExpr); @Override void visitBasicType(BasicType basicType); @Override void visitSamplerType(SamplerType samplerType); @Override void visitImageType(ImageType imageType); @Override void visitVoidType(VoidType voidType); @Override void visitAtomicIntType(AtomicIntType atomicIntType); @Override void visitQualifiedType(QualifiedType qualifiedType); @Override void visitForStmt(ForStmt forStmt); @Override void visitDoStmt(DoStmt doStmt); @Override void visitWhileStmt(WhileStmt whileStmt); @Override void visitNullStmt(NullStmt nullStmt); @Override void visitTernaryExpr(TernaryExpr ternaryExpr); @Override void visitArrayInfo(ArrayInfo arrayInfo); @Override void visitVariableDeclInfo(VariableDeclInfo variableDeclInfo); @Override void visitParameterDecl(ParameterDecl parameterDecl); @Override void visitArrayIndexExpr(ArrayIndexExpr arrayIndexExpr); @Override void visitIntConstantExpr(IntConstantExpr intConstantExpr); @Override void visitUIntConstantExpr(UIntConstantExpr uintConstantExpr); @Override void visitFloatConstantExpr(FloatConstantExpr floatConstantExpr); @Override void visitBoolConstantExpr(BoolConstantExpr boolConstantExpr); @Override void visitStructDefinitionType(StructDefinitionType structDefinitionType); @Override void visitArrayConstructorExpr(ArrayConstructorExpr arrayConstructorExpr); @Override void visitArrayType(ArrayType arrayType); @Override void visitSwitchStmt(SwitchStmt switchStmt); @Override void visitDefaultCaseLabel(DefaultCaseLabel defaultCaseLabel); @Override void visitExprCaseLabel(ExprCaseLabel exprCaseLabel); @Override void visitInterfaceBlock(InterfaceBlock interfaceBlock); @Override void visitDefaultLayout(DefaultLayout defaultLayout); @Override void visitStructNameType(StructNameType structNameType); @Override void visitExtensionStatement(ExtensionStatement extensionStatement); @Override void visitPragmaStatement(PragmaStatement pragmaStatement); final void abortVisitation(); }
StandardVisitor implements IAstVisitor { @Override public void visit(IAstNode node) { if (node == null) { throw new RuntimeException("Attempt to visit null node"); } currentDepth++; node.accept(this); currentDepth--; } StandardVisitor(); VisitationDepth getVistitationDepth(); @Override void visit(IAstNode node); @Override void visitFunctionDefinition(FunctionDefinition functionDefinition); @Override void visitTranslationUnit(TranslationUnit translationUnit); @Override void visitFunctionPrototype(FunctionPrototype functionPrototype); @Override void visitBlockStmt(BlockStmt stmt); @Override void visitIfStmt(IfStmt ifStmt); @Override void visitDeclarationStmt(DeclarationStmt declarationStmt); @Override void visitVariablesDeclaration(VariablesDeclaration variablesDeclaration); @Override void visitPrecisionDeclaration(PrecisionDeclaration precisionDeclaration); @Override void visitInitializer(Initializer initializer); @Override void visitBinaryExpr(BinaryExpr binaryExpr); @Override void visitParenExpr(ParenExpr parenExpr); @Override void visitVariableIdentifierExpr(VariableIdentifierExpr variableIdentifierExpr); @Override void visitUnaryExpr(UnaryExpr unaryExpr); @Override void visitMemberLookupExpr(MemberLookupExpr memberLookupExpr); @Override void visitDiscardStmt(DiscardStmt discardStmt); @Override void visitBreakStmt(BreakStmt breakStmt); @Override void visitContinueStmt(ContinueStmt continueStmt); @Override void visitReturnStmt(ReturnStmt returnStmt); @Override void visitFunctionCallExpr(FunctionCallExpr functionCallExpr); @Override void visitExprStmt(ExprStmt exprStmt); @Override void visitTypeConstructorExpr(TypeConstructorExpr typeConstructorExpr); @Override void visitBasicType(BasicType basicType); @Override void visitSamplerType(SamplerType samplerType); @Override void visitImageType(ImageType imageType); @Override void visitVoidType(VoidType voidType); @Override void visitAtomicIntType(AtomicIntType atomicIntType); @Override void visitQualifiedType(QualifiedType qualifiedType); @Override void visitForStmt(ForStmt forStmt); @Override void visitDoStmt(DoStmt doStmt); @Override void visitWhileStmt(WhileStmt whileStmt); @Override void visitNullStmt(NullStmt nullStmt); @Override void visitTernaryExpr(TernaryExpr ternaryExpr); @Override void visitArrayInfo(ArrayInfo arrayInfo); @Override void visitVariableDeclInfo(VariableDeclInfo variableDeclInfo); @Override void visitParameterDecl(ParameterDecl parameterDecl); @Override void visitArrayIndexExpr(ArrayIndexExpr arrayIndexExpr); @Override void visitIntConstantExpr(IntConstantExpr intConstantExpr); @Override void visitUIntConstantExpr(UIntConstantExpr uintConstantExpr); @Override void visitFloatConstantExpr(FloatConstantExpr floatConstantExpr); @Override void visitBoolConstantExpr(BoolConstantExpr boolConstantExpr); @Override void visitStructDefinitionType(StructDefinitionType structDefinitionType); @Override void visitArrayConstructorExpr(ArrayConstructorExpr arrayConstructorExpr); @Override void visitArrayType(ArrayType arrayType); @Override void visitSwitchStmt(SwitchStmt switchStmt); @Override void visitDefaultCaseLabel(DefaultCaseLabel defaultCaseLabel); @Override void visitExprCaseLabel(ExprCaseLabel exprCaseLabel); @Override void visitInterfaceBlock(InterfaceBlock interfaceBlock); @Override void visitDefaultLayout(DefaultLayout defaultLayout); @Override void visitStructNameType(StructNameType structNameType); @Override void visitExtensionStatement(ExtensionStatement extensionStatement); @Override void visitPragmaStatement(PragmaStatement pragmaStatement); final void abortVisitation();  }