コード例 #1
0
ファイル: BooleanLit_c.java プロジェクト: Bludge0n/AREsoft
  /** 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
ファイル: Cast_c.java プロジェクト: Hounge/apkinspector
 /** 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
ファイル: ObjectDumper.java プロジェクト: shamouda/x10
 public void dump(Object o) {
   Set<Object> cache = CollectionFactory.newHashSet();
   w.write("(");
   dumpObject(o, cache);
   w.write(")");
   w.newline(0);
   try {
     w.flush();
   } catch (IOException e) {
   }
 }
コード例 #4
0
 public void prettyPrint(CodeWriter w, PrettyPrinter tr) {
   w.write("adviceexecution()");
 }
コード例 #5
0
ファイル: BooleanLit_c.java プロジェクト: Bludge0n/AREsoft
 /** Write the expression to an output file. */
 public void prettyPrint(CodeWriter w, PrettyPrinter tr) {
   w.write(String.valueOf(value));
 }
コード例 #6
0
ファイル: ObjectDumper.java プロジェクト: shamouda/x10
  protected void dumpObject(Object obj, Set<Object> cache) {
    if (obj == null) {
      w.write("null");
      return;
    }

    w.write(StringUtil.getShortNameComponent(obj.getClass().getName()));

    //        w.allowBreak(0, " ");
    //        w.write(obj.toString());

    if (cache.contains(obj)) {
      return;
    }
    cache.add(obj);

    w.allowBreak(1, " ");
    w.begin(0);

    try {
      Field[] fields = obj.getClass().getDeclaredFields();
      java.lang.reflect.AccessibleObject.setAccessible(fields, true);
      for (int i = 0; i < fields.length; i++) {
        Field field = fields[i];
        if ((field.getModifiers() & modifiersMask) != 0) continue;
        w.write("(");
        w.write(field.getName());
        w.allowBreak(1, " ");
        try {
          Object o = field.get(obj);
          dumpObject(o, cache);
        } catch (IllegalAccessException exn) {
          w.write("##[" + exn.getMessage() + "]");
        }
        w.write(")");
        w.newline(0);
      }
    } catch (SecurityException exn) {
    }

    w.end();
  }
コード例 #7
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);
  }