if (ret) out.print("  abstract ATerm " + base + "("); else out.print("  abstract void " + base + "("); genFormals(out, appl.getArguments()); out.println(");");
String decl;  if (ret) { decl = "public ATerm " + base + "("; } else { decl = "public void " + base + "("; }   decl += buildFormals(appl.getArguments()); decl += ")";  if (gen_impl) { JavaTif.printFoldOpen(out, decl); }  out.print("  " + decl);  if (gen_impl) { out.println(); out.println("  {"); out.println("    if (tool != null) {"); out.print(  "      " + (ret ? "return " : "") + "tool." + base + "("); genActuals(out, appl.getArguments()); out.println(");"); out.println("    }"); out.println("    else {"); out.print(  "      throw new UnsupportedOperationException("); out.println("\"method `" + base + "' not supported.\");"); out.println("    }"); out.println("  }"); JavaTif.printFoldClose(out); } else { out.println(";"); }
  public void genMethods(PrintWriter out, String base, boolean ret)  {    for(int i=0; i<size(); i++) {      ATermAppl appl = ((ATermAppl)elementAt(i));      if (ret)	out.print("  abstract ATerm " + base + "(");      else	out.print("  abstract void " + base + "(");      genFormals(out, appl.getArguments());      out.println(");");    }  }