Changeset 3409


Ignore:
Timestamp:
Feb 14, 2008, 12:36:00 AM (13 years ago)
Author:
yura
Message:
  • It seems $native works.
File:
1 edited

Legend:

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

    r3407 r3409  
    534534      s.javaType : \{"boolean"; "char"; "byte"; "short"; "int"; "long";} =
    535535        'Symbol.'s.javaType'Value('<Rfp2Java t.var>')';
    536       '('s.javaType') Symbol.objectValue('<Rfp2Java t.var>')';
     536      '(('s.javaType') Symbol.objectValue('<Rfp2Java t.var>'))';
    537537    };
    538538    EVAR =
    539539      <ToChars s.javaType> : e.javaElemType '[]', <ToWord e.javaElemType> :: s.javaElemType,
    540       '('s.javaType') Symbol.toArrayValue('<Rfp2Java t.var>', new 's.javaElemType'['<Rfp2Java t.var>'.length()];';
     540      {
     541        s.javaElemType : \{"boolean"; "char"; "byte"; "short"; "int"; "long";} =
     542          'Symbol.arrayValue('<Rfp2Java t.var>', new 's.javaElemType'['<Rfp2Java t.var>'.length()])';
     543        '(('s.javaType') Symbol.arrayValue('<Rfp2Java t.var>', new 's.javaElemType'['<Rfp2Java t.var>'.length()]))';
     544      };
    541545  };
    542546
    543547$func ConvertFrom t.var e.arg = e;
    544  
    545548ConvertFrom t.var e.arg,
    546549  t.var : (s.refType e),
     
    556559  <Del_Pragmas <Gener_Var_Indices 1 (<Vars e.in>) 'arg'>> : e.rfArgTypes s,
    557560  <Del_Pragmas <Gener_Var_Indices 1 (<Vars e.out>) 'res'>> : e.rfResTypes s,
    558   <PrintLn 1>,
    559561  {
    560562    s.methodName : "" = 'new ' s.className 0;
     
    562564    s.className '.' s.methodName 0;
    563565  } :: e.funcHead s.shift,
    564   <PrintLn 1>,
    565566  {
    566567    s.shift : 1 = e.rfArgTypes : t e.rfArgTypes2, e.rfArgTypes2;
    567568    e.rfArgTypes;
    568569  } :: e.rfArgTypes2,
    569   <PrintLn 1>,
    570570  0 $iter {
    571     <WriteLn s.num e.javaArgTypes e.rfArgTypes2>,
    572     e.args <ConvertTo <L s.num e.javaArgTypes> <L s.num e.rfArgTypes2>> <Add s.num 1>;
     571    {e.args : /**/ = /**/; ', ';} :: e.comma,
     572    e.args e.comma <ConvertTo <L s.num e.javaArgTypes> <L s.num e.rfArgTypes2>> <Add s.num 1>;
    573573  } :: e.args s.num,
    574574  <Length e.javaArgTypes> : s.num =
    575   <PrintLn 3>,
    576   e.funcHead '(' e.args ');' :: v.funcCall,
    577   <PrintLn e.rfResTypes>,
     575  e.funcHead '(' e.args ')' :: v.funcCall,
    578576  e.rfResTypes : {
    579577    /**/ = v.funcCall';';
    580578    t.rfResType, (<Rfp2Java e.rfResTypes>'.assign('<ConvertFrom t.rfResType v.funcCall>');');
    581579  } :: e.body =
    582   <PrintLn 1>,
    583580  ()
    584581  e.refalFormat
    585   ('static '<Access_Mode s.linkage>' void '
    586   <Name_To_Java t.qname>' ('<Var_Args_To_Java Expr e.rfArgTypes Result e.rfResTypes>') throws RefalException')
    587   ('{' ('try {' (e.body) '} catch (java.lang.Exception e) {' ('throw new org.refal.plus.RefalException("'<Get &Module_Name>'", "'<Name_To_Java t.qname>'", e.toString());')'}') '}');
     582  ('static '<Access_Mode s.linkage>' void ' <Name_To_Java t.qname>' ('<Var_Args_To_Java Expr e.rfArgTypes Result e.rfResTypes>') throws RefalException {'
     583    ('try {' (e.body) '} catch (java.lang.Exception e) {' ('throw new org.refal.plus.RefalException("'<Get &Module_Name>'", "'<Name_To_Java t.qname>'", e.toString());')'}')
     584  '}' );
    588585  /*
    589586  {
Note: See TracChangeset for help on using the changeset viewer.