JTBProcessor extends GJDepthFirst<Object, Node> implements
      ParserConstants { public InterfaceDefinition toInterfaceDefinition(final ITFFile fileContent) { return (InterfaceDefinition) visit(fileContent, null); } @Inject protected  JTBProcessor(final XMLNodeFactory nodeFactory,
      @Named(IDL_DTD) final String idlDtd); void setFilename(final String filename); InterfaceDefinition toInterfaceDefinition(final ITFFile fileContent); SharedTypeDefinition toSharedTypeDefinition(final IDTFile fileContent); @Override Object visit(final ITFFile n, final Node argu); @Override Object visit(final IDTFile n, final Node argu); @Override Object visit(final IncludeDirective n, final Node argu); @Override Object visit(final org.ow2.mind.idl.jtb.syntaxtree.TypeDefinition n,
      final Node argu); @Override Object visit(final TypeDefSpecification n, final Node argu); @Override Object visit(final QualifiedTypeSpecification n, final Node argu); @Override Object visit(final org.ow2.mind.idl.jtb.syntaxtree.TypeQualifier n,
      final Node argu); @Override Object visit(final TypeSpecification n, final Node argu); @Override Object visit(final TypeDefName n, final Node argu); @Override Object visit(final TypeSpecifiers n, final Node argu); @Override Object visit(final StructOrUnionSpecification n, final Node argu); @Override Object visit(final StructOrUnionDefinition n, final Node argu); @Override Object visit(final StructOrUnionReference n, final Node argu); @Override Object visit(final StructMember n, final Node argu); @Override Object visit(final EnumSpecification n, final Node argu); @Override Object visit(final org.ow2.mind.idl.jtb.syntaxtree.EnumDefinition n,
      final Node argu); @Override Object visit(final org.ow2.mind.idl.jtb.syntaxtree.EnumReference n,
      final Node argu); @Override Object visit(final org.ow2.mind.idl.jtb.syntaxtree.EnumMember n,
      final Node argu); @Override Object visit(final Declarators n, final Node argu); @Override Object visit(final Declarator n, Node argu); @Override Object visit(final PointerSpecification n, Node argu); @Override Object visit(final QualifierPointerSpecification n, final Node argu); @Override Object visit(final DirectDeclarator n, Node argu); @Override Object visit(final AbstractDeclarator n, Node argu); @Override Object visit(final AbstractDirectDeclarator n, Node argu); @Override Object visit(final ArraySpecification n, final Node argu); @Override Object visit(
      final org.ow2.mind.idl.jtb.syntaxtree.ConstantDefinition n,
      final Node argu); @Override Object visit(
      final org.ow2.mind.idl.jtb.syntaxtree.InterfaceDefinition n,
      final Node argu); @Override Object visit(final InterfaceInheritanceSpecification n, final Node argu); @Override Object visit(final MethodDefinition n, final Node argu); @Override Object visit(final ParameterList n, final Node argu); @Override Object visit(final org.ow2.mind.idl.jtb.syntaxtree.Parameter n,
      final Node argu); @Override Object visit(final ParameterQualifier n, final Node argu); @Override Object visit(
      final org.ow2.mind.idl.jtb.syntaxtree.ConstantExpression n,
      final Node argu); @Override Object visit(final LogicalOrExpression n, final Node argu); @Override Object visit(final LogicalAndExpression n, final Node argu); @Override Object visit(final OrExpression n, final Node argu); @Override Object visit(final XorExpression n, final Node argu); @Override Object visit(final AndExpression n, final Node argu); @Override Object visit(final ShiftExpression n, final Node argu); @Override Object visit(final AdditiveExpression n, final Node argu); @Override Object visit(final MulExpression n, final Node argu); @Override Object visit(final CastExpression n, final Node argu); @Override Object visit(final UnaryExpression n, final Node argu); @Override Object visit(final PrimaryExpression n, final Node argu); @Override Object visit(final org.ow2.mind.idl.jtb.syntaxtree.Literal n,
      final Node argu); @Override Object visit(final ShiftOperation n, final Node argu); @Override Object visit(final AdditiveOperation n, final Node argu); @Override Object visit(final MulOperation n, final Node argu); @Override Object visit(final org.ow2.mind.idl.jtb.syntaxtree.UnaryOperation n,
      final Node argu); @Override Node visit(final StringValue n, final Node argu); @Override Node visit(final IntegerValue n, final Node argu); @Override Node visit(final BooleanValue n, final Node argu); @Override Node visit(final NullValue n, final Node argu); @Override Node visit(final org.ow2.mind.idl.jtb.syntaxtree.Annotation n,
      final Node argu); @Override Node visit(final AnnotationParameters n, final Node argu); @Override Node visit(final AnnotationValuePair n, final Node argu); @Override Node visit(final AnnotationAnnotationValue n, final Node argu); @Override Node visit(final ArrayAnnotationValue n, final Node argu); static final String IDL_DTD; }
@Test(groups = {"functional"}) public void test1() throws Exception { final Parser parser = getParser("test1.itf"); final ITFFile content = parser.ITFFile(); final InterfaceDefinition idlFile = processor .toInterfaceDefinition(content); final IDLChecker checker = new ASTChecker().assertIDL(idlFile); final TypeCheckerIterator typeChecker = checker.definesType(); typeChecker.whereFirst().isTypedefOf("myint").isPrimitiveType("int"); typeChecker.andNext().isTypedefOf("mypointer").isPointerOf().isArrayOf() .isPrimitiveType("int"); typeChecker.andNext().isStructDef("s").hasMembers("a", "b").whereFirst() .hasType().isArrayOf().isPrimitiveType("int"); final MethodCheckerIterator methodsChecker = checker.containsMethods("m1", "m2", "m3", "m4", "m5"); ParameterCheckerIterator paramsChecker; methodsChecker.whereFirst().returnsType().isPrimitiveType("void"); paramsChecker = methodsChecker.hasParameters("a", "b"); paramsChecker.whereFirst().hasType().isPrimitiveType("int"); paramsChecker.andNext().hasType().isPrimitiveType("int"); methodsChecker.andNext().returnsType().isPrimitiveType("unsigned float"); methodsChecker.hasParameters("f1").whereFirst().hasType() .isPrimitiveType("float"); methodsChecker.andNext().returnsType().isPointerOf() .isPrimitiveType("void"); paramsChecker = methodsChecker.hasParameters("a", "b"); paramsChecker.whereFirst().hasType().isPrimitiveType("int"); paramsChecker.andNext().hasType().isPrimitiveType("int"); methodsChecker.andNext().returnsType().isPrimitiveType("int"); paramsChecker = methodsChecker.hasParameters("p0", "p1"); paramsChecker.whereFirst().hasType().isPrimitiveType("int"); paramsChecker.andNext().hasType().isPrimitiveType("int"); methodsChecker.andNext().returnsType().isPrimitiveType("int"); paramsChecker = methodsChecker.hasParameters("p1", "p0"); paramsChecker.whereFirst().hasType().isPrimitiveType("int"); paramsChecker.andNext().hasType().isPrimitiveType("float"); assertNotNull(idlFile); }