Package apigen.adt

Examples of apigen.adt.Type


  private void genFactoryInitialization(ADT api) {
    Iterator<Type> types = api.typeIterator(module);
    int listTypeCount = 0;

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

      if (type instanceof ListType) {
        if (type instanceof SeparatedListType) {
          genSeparatedListInitialization(listTypeCount,
              (SeparatedListType) type);
        } else {
          genNormalListTypeInitialization(type, listTypeCount);
        }
        listTypeCount++;
      } else if (!typeConverter.isReserved(type.getId())) {
        Iterator<Alternative> alts = type.alternativeIterator();
        while (alts.hasNext()) {
          Alternative alt = alts.next();
          String funVar = funVariable(type, alt);
          String afunName = type.getId() + "_" + alt.getId();

          println("    "
              + patternVariable(type, alt)
              + " = factory.parse(\""
              + StringConversions.escapeQuotes(alt
                  .buildMatchPattern().toString()) + "\");");
          println("    " + funVar + " = factory.makeAFun(\"" + "_"
              + afunName + "\", " + type.getAltArity(alt)
              + ", false);");
          println();
        }
      }
    }
View Full Code Here


    Iterator<String> moduleIt = modules.iterator();
    while (moduleIt.hasNext()) {
      Iterator<Type> types = api.typeIterator(moduleIt.next());

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

  }
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 */
        while (alts.hasNext()) {
          Alternative alt = alts.next();
          genVisit(type, alt);
        }
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.