Package apigen.adt

Examples of apigen.adt.Field


    Iterator<Field> fields = type.altFieldIterator("many");
    String result = "";
    fields.next(); // skip head

    while (fields.hasNext()) {
      Field field = fields.next();

      if (!fields.hasNext()) {
        break; // skip tail
      }

      result += StringConversions.makeIdentifier(field.getId());
      result += ", ";
    }

    return result;
  }
View Full Code Here


  private String buildFormalSeparatorArgs(SeparatedListType type) {
    Iterator<Field> fields = type.separatorFieldIterator();
    String result = "";

    while (fields.hasNext()) {
      Field field = fields.next();

      result += buildTypeName(field.getType()) + " "
          + StringConversions.makeIdentifier(field.getId());
      result += ", ";
    }
    return result;
  }
View Full Code Here

     * chance of building a tower of this constructor where only this
     * argument changes. Therefore, this argument must be very important in
     * the computation of the hash code in order to avoid collissions
     */
    for (int i = 0; fields.hasNext(); i++) {
      Field field = fields.next();

      if (field.getType().equals(type.getId())) {
        return i;
      }
    }

    return -1;
View Full Code Here

  private void genAltFieldIndexMembers(Type type, Alternative alt) {
    Iterator<Field> fields = type.altFieldIterator(alt.getId());
    int argnr = 0;

    while (fields.hasNext()) {
      Field field = fields.next();
      String fieldId = getFieldIndex(field.getId());

      println("  private static int " + fieldId + " = " + argnr + ";");
      argnr++;
    }
  }
View Full Code Here

  private void genOverrideHasMethods(Type type, Alternative alt) {
    Iterator<Field> fields = type.altFieldIterator(alt.getId());

    while (fields.hasNext()) {
      Field field = fields.next();
      genOverrideHasMethod(field);
    }
  }
View Full Code Here

  private void genAltGetAndSetMethods(Type type, Alternative alt) {

    Iterator<Field> fields = type.altFieldIterator(alt.getId());
    while (fields.hasNext()) {
      Field field = fields.next();
      genAltGetAndSetMethod(field);
    }

    genOverrrideSetArgument(type, alt);
  }
View Full Code Here

    if (type.getAltArity(alt) > 0) {
      println("    switch(i) {");

      Iterator<Field> fields = type.altFieldIterator(alt.getId());
      for (int i = 0; fields.hasNext(); i++) {
        Field field = fields.next();
        String fieldType = field.getType();
        String fieldClass = TypeGenerator.qualifiedClassName(params,
            fieldType);

        boolean skip = false;
        String instance_of;
View Full Code Here

  private int computeAltArityNotReserved(Type type, Alternative alt) {
    Iterator<Field> fields = type.altFieldIterator(alt.getId());
    int count = 0;
    while (fields.hasNext()) {
      Field field = fields.next();
      if (!getConverter().isReserved(field.getType())) {
        count++;
      }
    }
    return count;
  }
View Full Code Here

  protected String buildActualTypedAltArgumentList(Iterator<Field> fields,
      boolean convertBuiltins) {
    StringBuffer buf = new StringBuffer();

    while (fields.hasNext()) {
      Field field = fields.next();
      String field_id = getFieldId(field.getId());
      String field_type = field.getType();

      if (convertBuiltins) {
        field_id = getConverter().makeBuiltinToATermConversion(
            field_type, field_id);
      }
View Full Code Here

  protected String buildActualTypedAltArgumentListNoConversion(
      Iterator<Field> fields) {
    StringBuffer buf = new StringBuffer();

    while (fields.hasNext()) {
      Field field = fields.next();
      String field_id = getFieldId(field.getId());

      buf.append(field_id);

      if (fields.hasNext()) {
        buf.append(", ");
View Full Code Here

TOP

Related Classes of apigen.adt.Field

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.