Package apigen.adt

Examples of apigen.adt.Alternative


          }
        } 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) {
              genAltFromTerm(type, alt);
            }
View Full Code Here


        }
        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

    genInitializeEmptySeparatedList(type, listTypeCount);
    genInitializeManyPattern(type);
  }

  private void genInitializeManyPattern(SeparatedListType type) {
    Alternative alt = type.getManyAlternative();
    println("    "
        + patternListVariable(type)
        + " = factory.parse(\""
        + StringConversions.escapeQuotes(alt.buildMatchPattern()
            .toString()) + "\");");
  }
View Full Code Here

  }

  protected void genAltFromTermCalls(Type type) {
    Iterator<Alternative> alts = type.alternativeIterator();
    while (alts.hasNext()) {
      Alternative alt = alts.next();
      String methodName = concatTypeAlt(type, alt) + "FromTerm";
      println("    tmp = " + methodName + "(trm);");
      println("    if (tmp != null) {");
      println("      return tmp;");
      println("    }");
View Full Code Here

  private void genListTypeTomAltOperators(Type type) {
    Iterator<Alternative> alts = type.alternativeIterator();

    while (alts.hasNext()) {
      Alternative alt = alts.next();
      if (!alt.isEmpty() && !alt.isMany() && !alt.isSingle()) {
        genTomAltOperator(type, alt);
      }
    }
  }
View Full Code Here

  private void genTomAltOperators(Type type) {
    Iterator<Alternative> alts = type.alternativeIterator();

    while (alts.hasNext()) {
      Alternative alt = alts.next();
      genTomAltOperator(type, alt);
    }
  }
View Full Code Here

      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.Alternative

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.