예제 #1
0
 public static Expression rewrite(Object paramObject1, Object paramObject2) {
   Translator localTranslator = (Translator) Compilation.getCurrent();
   Expression localExpression = localTranslator.rewrite(paramObject1);
   Object localObject = null;
   paramObject1 = null;
   FVector localFVector = (FVector) paramObject2;
   int j = localFVector.size();
   int i = 0;
   paramObject2 = localObject;
   if (i < j) {
     localObject = SchemeCompilation.lambda.rewrite(localFVector.get(i), localTranslator);
     if ((localObject instanceof ErrorExp)) {
       return (Expression) localObject;
     }
     if (!(localObject instanceof LambdaExp)) {
       return localTranslator.syntaxError("internal error with try-catch");
     }
     localObject = new CatchClause((LambdaExp) localObject);
     if (paramObject2 == null) {
       paramObject1 = localObject;
     }
     for (; ; ) {
       paramObject2 = localObject;
       i += 1;
       break;
       ((CatchClause) paramObject2).setNext((CatchClause) localObject);
     }
   }
   if ((localExpression instanceof ErrorExp)) {
     return localExpression;
   }
   paramObject2 = new TryExp(localExpression, null);
   ((TryExp) paramObject2).setCatchClauses((CatchClause) paramObject1);
   return (Expression) paramObject2;
 }
예제 #2
0
 public Expression rewrite(Object paramObject, Translator paramTranslator) {
   Object[] arrayOfObject = new Object[4];
   if (this.op_code == 0) {
     if (!pattern3.match(paramObject, arrayOfObject, 1)) {}
   } else {
     while (pattern4.match(paramObject, arrayOfObject, 0)) {
       if ((arrayOfObject[3] instanceof LList)) {
         break;
       }
       return paramTranslator.syntaxError("missing/invalid parameter list in " + getName());
     }
   }
   return paramTranslator.syntaxError(
       "wrong number of arguments to " + getName() + "(opcode:" + this.op_code + ")");
   Object localObject1 = (LList) arrayOfObject[3];
   int j = ((LList) localObject1).size();
   Type[] arrayOfType = new Type[j];
   int i = 0;
   while (i < j) {
     localObject1 = (Pair) localObject1;
     arrayOfType[i] = paramTranslator.exp2Type((Pair) localObject1);
     localObject1 = (LList) ((Pair) localObject1).getCdr();
     i += 1;
   }
   Type localType = paramTranslator.exp2Type(new Pair(arrayOfObject[2], null));
   if (this.op_code == 0) {
     paramObject =
         new PrimProcedure(((Number) arrayOfObject[1]).intValue(), localType, arrayOfType);
   }
   for (; ; ) {
     return new QuoteExp(paramObject);
     Object localObject2 = null;
     paramObject = paramTranslator.exp2Type((Pair) paramObject);
     localObject1 = paramObject;
     if (paramObject != null) {
       localObject1 = ((Type) paramObject).getImplementationType();
     }
     paramObject = localObject2;
     try {
       localObject1 = (ClassType) localObject1;
       paramObject = localObject1;
       ((ClassType) localObject1).getReflectClass();
       paramObject = localObject1;
       if ((arrayOfObject[1] instanceof Pair)) {
         paramTranslator = (Pair) arrayOfObject[1];
         if (paramTranslator.getCar() == "quote") {
           arrayOfObject[1] = ((Pair) paramTranslator.getCdr()).getCar();
         }
       }
       paramObject =
           new PrimProcedure(
               this.op_code,
               (ClassType) paramObject,
               arrayOfObject[1].toString(),
               localType,
               arrayOfType);
     } catch (Exception localException) {
       if (paramObject != null) {
         break label403;
       }
     }
   }
   char c = 'e';
   for (; ; ) {
     paramTranslator.error(c, "unknown class: " + arrayOfObject[0]);
     break;
     label403:
     c = 'w';
     ((ClassType) paramObject).setExisting(false);
   }
 }