Changeset 3709


Ignore:
Timestamp:
Apr 16, 2008, 7:06:14 PM (13 years ago)
Author:
yura
Message:
  • Use Func as interface.
Location:
to-imperative/trunk/compiler/refal/org/refal/plus/compiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/compiler/refal/org/refal/plus/compiler/rfp_asail_java.rf

    r3589 r3709  
    394394        e1 : \{
    395395          '(Comparable<?>)' e;
    396           'new Func' e;
    397396          'Symbol.new' e;
    398397        } =
     
    418417    (STATIC e) =
    419418      (<Rfp2Java t.item>);
    420     ("FUNC?" t.name) = ('new Func () {'
    421       ('public boolean eval (Expr arg, Result res) throws RefalException {'
    422         ('return '<Name_To_Java t.name>' (arg, res);')
    423       '}') '}');
    424     (s.FUNC t.name), s.FUNC : \{ FUNC; TFUNC; } = ('new Func () {'
    425       ('public boolean eval (Expr arg, Result res) throws RefalException {'
    426         ((<Name_To_Java t.name>' (arg, res);')
    427          ('return true;'))
    428       '}') '}');
     419    ("FUNC?" t.name) =
     420      ('Symbol.newFunc("'t.name'", new Func () {'
     421        ('public boolean eval (Expr arg, Result res) throws RefalException {'
     422          ('return '<Name_To_Java t.name>' (arg, res);')
     423        '}')
     424      '})');
     425    (s.FUNC t.name), s.FUNC : \{ FUNC; TFUNC; } =
     426      ('Symbol.newFunc("'t.name'", new Func () {'
     427        ('public boolean eval (Expr arg, Result res) throws RefalException {'
     428          ((<Name_To_Java t.name>' (arg, res);')('return true;'))
     429        '}')
     430      '})');
    429431    s.sym, {
    430432      <IsInt s.sym> =
  • to-imperative/trunk/compiler/refal/org/refal/plus/compiler/rfp_asail_jbc.rf

    r3700 r3709  
    832832    <Get &Func_Refs> : e (s.cl_name s.mod_name s.func_name s.type) e,
    833833      <ClassWriter <COMPUTE_MAXS>> :: s.cw,
    834       <CWvisit s.cw <V1_5> <ACC_FINAL> <ToWord s.class_name '$' s.cl_name> <Null> "org/refal/plus/Func" ()>,
     834      <CWvisit s.cw <V1_5> <ACC_FINAL> <ToWord s.class_name '$' s.cl_name> <Null> "java/lang/Object" ("org/refal/plus/Func")>,
    835835      <CWvisitMethod s.cw <ACC_SYNTHETIC> "<init>" "()V" <Null> ()> :: s.mv,
    836836      <IIMVvisitVarInsn s.mv <ALOAD> 0>,
    837       <IIMVvisitMethodInsn s.mv <INVOKESPECIAL> "org/refal/plus/Func" "<init>" "()V">,
     837      <IIMVvisitMethodInsn s.mv <INVOKESPECIAL> "java/lang/Object" "<init>" "()V">,
    838838      <IIMVvisitInsn s.mv <RETURN>>,
    839839      <IIMVvisitMaxs s.mv 0 0>,
     
    15031503    <IIMVvisitTypeInsn <MV> <NEW> "org/refal/plus/Expr">,
    15041504    <IIMVvisitInsn <MV> <DUP>>,
     1505    <IIMVvisitLdcInsn <MV> s.cl_name>,
    15051506    <IIMVvisitTypeInsn <MV> <NEW> s.cl_name>,
    15061507    <IIMVvisitInsn <MV> <DUP>>,
    15071508    <IIMVvisitMethodInsn <MV> <INVOKESPECIAL> s.cl_name "<init>" "()V">,
     1509    <IIMVvisitMethodInsn <MV> <INVOKESTATIC> "org/refal/plus/Symbol" "newFunc" "(Ljava/lang/String;Lorg/refal/plus/Func;)Ljava/lang/Comparable;">,
    15081510    <IIMVvisitMethodInsn <MV> <INVOKESPECIAL> "org/refal/plus/Expr" "<init>" "(Ljava/lang/Comparable;)V">;
    15091511  s.sym =
Note: See TracChangeset for help on using the changeset viewer.