Package apigen.adt

Examples of apigen.adt.Type


      JavaGenerationParameters params, GenerationObserver observer) {
    TypeConverter typeConverter = new TypeConverter(
        new JavaTypeConversions("factory"));
    Iterator<Type> typeIterator = adt.typeIterator();
    while (typeIterator.hasNext()) {
      Type type = typeIterator.next();

      if (type instanceof ListType) {
        if (type instanceof SeparatedListType) {
          run(new SeparatedListTypeGenerator(params,
              (SeparatedListType) type), observer);

        } else {
          run(new ListTypeGenerator(adt, params, (ListType) type),
              observer);
        }
      } else if (!typeConverter.isReserved(type.getId())) {
        run(new TypeGenerator(params, type), observer);
        generateAlternativeClasses(adt, params, type, observer);
      }
    }
  }
View Full Code Here


    Iterator<Type> types = adt.typeIterator();
    bucket = 0;
    int i = 0;

    while (types.hasNext()) {
      Type type = types.next();

      makeNewBucket(i);

      printTypeClassFiles(type);
      i++;
View Full Code Here

  protected void genVisits(ADT adt) {
    TypeConverter typeConverter = new TypeConverter(
        new JavaTypeConversions("factory"));
    Iterator<Type> types = adt.typeIterator();
    while (types.hasNext()) {
      Type type = types.next();

      if (type instanceof ListType) {
        genListVisit(type);
      } else if (!typeConverter.isReserved(type.getId())) {
        /* builtin childs are not visitable */
        Iterator<Alternative> alts = type.alternativeIterator();
        while (alts.hasNext()) {
          Alternative alt = alts.next();
          genVisit(type, alt);
        }
      }
View Full Code Here

  protected void genVisits(ADT adt) {
    TypeConverter typeConverter = new TypeConverter(
        new JavaTypeConversions("factory"));
    Iterator<Type> types = adt.typeIterator();
    while (types.hasNext()) {
      Type type = types.next();
      Iterator<Alternative> alts = type.alternativeIterator();

      if (type instanceof ListType) {
        genListVisit(type);
      } else if (!typeConverter.isReserved(type.getId())) {
        /* builtin childs are not visitable */
        genTypeVisit(type);
        while (alts.hasNext()) {
          Alternative alt = alts.next();
          genVisit(type, alt);
View Full Code Here

      String moduleName = moduleIt.next();

      Iterator<Type> types = api.typeIterator(moduleName);

      while (types.hasNext()) {
        Type type = types.next();

        if (type instanceof ListType) {
          if (type instanceof SeparatedListType) {
            genSeparatedListFromTermMethod(
                (SeparatedListType) type, forwarding,
                moduleName);
          } else {
            genListFromTerm((ListType) type, forwarding, moduleName);
          }
        } else if (!typeConverter.isReserved(type.getId())) {
          genTypeFromTermMethod(type, forwarding, moduleName);
        }
      }
    }
  }
View Full Code Here

      String moduleName = moduleIt.next();

      Iterator<Type> types = api.typeIterator(moduleName);

      while (types.hasNext()) {
        Type type = types.next();
        if (!typeConverter.isReserved(type.getId())) {
          genTypeFromStringMethod(type);
          genTypeFromFileMethod(type);
        }
      }
    }
View Full Code Here

  private void genEmptyLists(ADT api) {
    JavaGenerationParameters params = getJavaGenerationParameters();
    Iterator<Type> types = api.typeIterator(module);
    while (types.hasNext()) {
      Type type = types.next();
      if (type instanceof ListType) {
        String typeName = TypeGenerator.qualifiedClassName(params, type
            .getId());
        String emptyName = emptyListVariable(type);
        println("  private " + typeName + ' ' + emptyName + ";");
      }
    }
View Full Code Here

      String moduleName = moduleIt.next();

      Iterator<Type> types = api.typeIterator(moduleName);

      while (types.hasNext()) {
        Type type = types.next();
        if (type instanceof ListType) {
          ListType listType = (ListType) type;
          JavaGenerationParameters params = getJavaGenerationParameters();
          String typeName = TypeGenerator.qualifiedClassName(params,
              type.getId());
          String methodName = "make" + TypeGenerator.className(type);
          String paramTypeName = TypeGenerator.qualifiedClassName(
              params, listType.getElementType());
          String empty = emptyListVariable(type);
View Full Code Here

    println();
    genFactoryForImportedModules();
    println();
    Iterator<Type> types = api.typeIterator(module);
    while (types.hasNext()) {
      Type type = types.next();
      genTypeMembers(type, params);
      println();
    }
  }
View Full Code Here

    Iterator<String> moduleIt = moduleToGen.iterator();
    while (moduleIt.hasNext()) {
      String moduleName = moduleIt.next();
      Iterator<Type> types = api.typeIterator(moduleName);
      while (types.hasNext()) {
        Type type = types.next();
        if (type instanceof ListType) {
          if (type instanceof SeparatedListType) {
            genSeparatedListToTerm((SeparatedListType) type,
                forwarding, moduleName);
          }
        } else if (!typeConverter.isReserved(type.getId())) {
          /* no make method for operators with builtin codomain */
          Iterator<Alternative> alts = type.alternativeIterator();
          while (alts.hasNext()) {
            Alternative alt = alts.next();
            genInternalMakeMethod(type, alt, forwarding, moduleName);
            genMakeMethod(type, alt, forwarding, moduleName);
            if (!forwarding) {
View Full Code Here

TOP

Related Classes of apigen.adt.Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.