Changeset 1819


Ignore:
Timestamp:
Dec 27, 2005, 2:48:51 PM (15 years ago)
Author:
orlov
Message:
  • Merged converters to C++ and Java. Not properly working yet.
Location:
to-imperative/trunk/compiler
Files:
4 added
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/compiler/Makefile

    r1706 r1819  
    1313  rfp_err \
    1414  rfp_src \
    15   rfp_asail \
     15  rfp_asail_cpp \
     16  rfp_asail_java \
    1617  rfp_as2as \
    1718  rfp_check \
  • to-imperative/trunk/compiler/rfp_compile.rf

    r1706 r1819  
    187187  <Map &Set-Var- (Instantiated? True) (e.arg-vars)> : e,
    188188  s.tag : {
    189     FUNC = (FATAL);
    190     FUNC? = (RETFAIL);
     189    FUNC = FUNC (FATAL);
     190    FUNC? = FUNC? (RETFAIL);
    191191    STUB =
    192192      <Prepare-Res (Apply Apply "Unexpected fail")> : (e.message),
    193       (RETFAIL) ((ERROR e.message));
    194   } :: e.fails,
    195   (FUNC t.name (<Vars-Print e.arg-vars>) (<Vars-Print e.res-vars>)
     193      FUNC? (RETFAIL) ((ERROR e.message));
     194  } :: s.tag e.fails,
     195  (s.tag t.name (<Vars-Print e.arg-vars>) (<Vars-Print e.res-vars>)
    196196    <Comp-Sentence Tail (e.fails) (e.arg) e.Sentence>
    197197  ) :: e.comp-func,
  • to-imperative/trunk/compiler/rfpc.rf

    r1706 r1819  
    2727$use "rfp_debug"; // rfp_debug.rfi
    2828$use "rfp_compile"; // rfp_compile.rfi
    29 $use "rfp_asail"; //rfp_asail.rfi
     29$use "rfp_asail_cpp"; //rfp_asail_cpp.rfi
     30$use "rfp_asail_java"; //rfp_asail_java.rfi
    3031$use "rfp_as2as";
    3132$use "rfp_check";
     
    178179          \{
    179180            <In-Table? &RFP-Options CC>;
     181            <In-Table? &RFP-Options HH>;
     182            <In-Table? &RFP-Options JAVA>;
    180183            <In-Table? &RFP-Options AS-AIL>;
    181184            <In-Table? &RFP-Options AS-TRANSFORMED>;
    182             <In-Table? &RFP-Options HH>;
    183185          },
    184186          {
     
    207209          \{
    208210            <In-Table? &RFP-Options CC>;
     211            <In-Table? &RFP-Options HH>;
     212            <In-Table? &RFP-Options JAVA>;
    209213            <In-Table? &RFP-Options AS-AIL>;
    210             <In-Table? &RFP-Options HH>;
    211214          },
    212215          <Verbose "compilation to abstract imperative language started">,
     
    279282                  $fail;;
    280283              },
     284              <CPP-Pretty-Print 0 s.channel () e.module>,
     285              { s.need-close? : 1 = <Close-Channel s.channel>;; },
     286              $fail;
     287            <In-Table? &RFP-Options JAVA>,
     288              e.Items : (INTERFACE t.asail-mod-name e.headers) (MODULE t e.module),
     289              {
     290                <In-Table? &RFP-Options NO-OPTIM> = e.module;
     291                <Verbose "as-ail optimization started">,
     292                  <ASAIL-Optim e.module> :: e.module,
     293                  <Verbose "as-ail optimization finished"> =
     294                  e.module;
     295              } :: e.module,
     296              <Verbose "compilation from as-ail to java started">,
     297              {
     298                e.headers (/*e.exports*/) $iter {
     299                  e.headers : (s.decl t.name) e.rest =
     300                    e.rest (e.exports t.name);
     301                } :: e.headers (e.exports),
     302                  e.headers : /*empty*/ =
     303                  e.exports;
     304              } :: e.exports,
     305              <RFP-ASAIL-To-Java t.asail-mod-name (e.exports) e.module> :: e.module,
     306              <Verbose "compilation from as-ail to java finished">,
     307              <Open-Channel e.basename ('.java')> :: s.channel s.need-close?,
     308              {
     309                e.dirname : v =
     310                  <PrintLN! s.channel
     311                  'package '<Subst (&RFP-Dir-Separator) (('.')) e.dirname>';'>;;
     312              },
     313              <PrintLN! s.channel 'import org.refal.plus.*;'>,
    281314              <CPP-Pretty-Print 0 s.channel () e.module>,
    282315              { s.need-close? : 1 = <Close-Channel s.channel>;; },
     
    313346  ((('hh')) (BIND HH)
    314347    "generate header files")
     348  ((('j') ('java')) (BIND JAVA)
     349    "output Java code")
    315350  ((('asr') ('as-refal')) (BIND AS-REFAL)
    316351    "output Refal Abstract Syntax")
     
    421456      <In-Table? &RFP-Options CC>;
    422457      <In-Table? &RFP-Options HH>;
     458      <In-Table? &RFP-Options JAVA>;
    423459      <In-Table? &RFP-Options AS-REFAL>;
    424460      <In-Table? &RFP-Options AS-TRANSFORMED>;
Note: See TracChangeset for help on using the changeset viewer.