예제 #1
0
  @Override
  public void genCyan(
      PWInterface pw, boolean printInMoreThanOneLine, CyanEnv cyanEnv, boolean genFunctions) {
    if (cyanEnv.getCreatingInstanceGenericPrototype()) {
      pw.print(cyanEnv.formalGenericParamToRealParam(methodName.getSymbolString()));
    } else {
      pw.print(methodName.getSymbolString());
    }

    super.genCyan(pw, printInMoreThanOneLine, cyanEnv, genFunctions);
  }
예제 #2
0
 /**
  * generate the parameter declarations of this method.
  *
  * @param env
  */
 public void genJava(PWInterface pw, Env env) {
   int size = parameterList.size();
   for (ParameterDec paramDec : parameterList) {
     paramDec.genJava(pw, env);
     if (--size > 0) pw.print(", ");
   }
 }
예제 #3
0
  @Override
  public void genCyan(
      PWInterface pw, boolean printInMoreThanOneLine, CyanEnv cyanEnv, boolean genFunctions) {

    if (cyanEnv.getCreatingInstanceGenericPrototype()) {
      pw.print(cyanEnv.formalGenericParamToRealParam(selector.getSymbolString()));
    } else {
      pw.print(selector.getSymbolString());
    }
    int size = parameterList.size();
    boolean onlyOneTypeWithoutParameterName = false;
    if (size == 1 && parameterList.get(0).getVariableSymbol() == null) {
      // there is one parameter and the first one does not have a type
      onlyOneTypeWithoutParameterName = true;
    } else if (size == 0) onlyOneTypeWithoutParameterName = true;

    pw.print(" ");
    if (!onlyOneTypeWithoutParameterName) pw.print("(");
    for (ParameterDec p : parameterList) {
      p.genCyan(pw, false, cyanEnv, genFunctions);
      --size;
      if (size > 0) pw.print(", ");
    }
    if (!onlyOneTypeWithoutParameterName) pw.print(")");
    pw.print(" ");
  }
예제 #4
0
 @Override
 public void genJavaAsConstructor(PWInterface pw, Env env, String javaNameDeclaringObject) {
   pw.printIdent(javaNameDeclaringObject + "()");
 }
예제 #5
0
 public void genJava(PWInterface pw, Env env, boolean isMultiMethod) {
   super.genJava(pw, env, isMultiMethod);
   pw.print(NameServer.getJavaNameOfSelector(methodName.getSymbolString()));
   pw.print("()");
 }