Package apigen.adt

Examples of apigen.adt.Step


  }

  private void genSetterSteps(Iterator<Step> steps, List<Step> parentPath,
      String arg) {
    if (steps.hasNext()) {
      Step step = steps.next();
      switch (step.getType()) {
      case Step.ARG:
        print("ATsetArgument((ATermAppl)");
        break;
      case Step.ELEM:
        print("ATreplace((ATermList)");
        break;
      case Step.TAIL:
        print("ATreplaceTail((ATermList)");
        break;
      }
      print(genGetterSteps(parentPath.iterator(), "arg"));
      if (step.getType() == Step.TAIL) {
        print(", (ATermList)");
      } else {
        print(", (ATerm)");
      }
      parentPath.add(step);
      genSetterSteps(steps, parentPath, arg);
      print(", " + step.getIndex() + ")");
    } else {
      print(arg);
    }
  }
View Full Code Here


    }
  }

  private String genGetterSteps(Iterator<Step> steps, String arg) {
    if (steps.hasNext()) {
      Step step = steps.next();
      int index = step.getIndex();
      switch (step.getType()) {
      case Step.ARG:
        return genGetterSteps(steps, "ATgetArgument((ATermAppl)" + arg
            + ", " + step.getIndex() + ")");
      case Step.ELEM:
        if (index == 0) {
          return genGetterSteps(steps, "ATgetFirst((ATermList)" + arg
              + ")");
        }
        return genGetterSteps(steps, "ATelementAt((ATermList)" + arg
            + ", " + step.getIndex() + ")");
      case Step.TAIL:
        if (index == 0) {
          return genGetterSteps(steps, arg);
        } else if (index == 1) {
          return genGetterSteps(steps, "ATgetNext((ATermList)" + arg
              + ")");
        } else {
          return genGetterSteps(steps, "ATgetTail((ATermList)" + arg
              + ", " + step.getIndex() + ")");
        }
      }
    }

    return arg;
View Full Code Here

TOP

Related Classes of apigen.adt.Step

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.