예제 #1
0
  /** Dumps the AST. */
  public void dump(CodeWriter w) {
    super.dump(w);

    w.allowBreak(4, " ");
    w.begin(0);
    w.write("(value " + value + ")");
    w.end();
  }
예제 #2
0
 /** Write the expression to an output file. */
 public void prettyPrint(CodeWriter w, PrettyPrinter tr) {
   w.begin(0);
   w.write("(");
   print(castType, w, tr);
   w.write(")");
   w.allowBreak(2, " ");
   printSubExpr(expr, w, tr);
   w.end();
 }
예제 #3
0
파일: For_c.java 프로젝트: Bludge0n/AREsoft
  /** Write the statement to an output file. */
  public void prettyPrint(CodeWriter w, PrettyPrinter tr) {
    w.write("for (");
    w.begin(0);

    if (inits != null) {
      boolean first = true;
      for (Iterator i = inits.iterator(); i.hasNext(); ) {
        ForInit s = (ForInit) i.next();
        printForInit(s, w, tr, first);
        first = false;

        if (i.hasNext()) {
          w.write(",");
          w.allowBreak(2, " ");
        }
      }
    }

    w.write(";");
    w.allowBreak(0);

    if (cond != null) {
      printBlock(cond, w, tr);
    }

    w.write(";");
    w.allowBreak(0);

    if (iters != null) {
      for (Iterator i = iters.iterator(); i.hasNext(); ) {
        ForUpdate s = (ForUpdate) i.next();
        printForUpdate(s, w, tr);

        if (i.hasNext()) {
          w.write(",");
          w.allowBreak(2, " ");
        }
      }
    }

    w.end();
    w.write(")");

    printSubStmt(body, w, tr);
  }