home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / native.e < prev    next >
Text File  |  1999-06-05  |  5KB  |  154 lines

  1. --          This file is part of SmallEiffel The GNU Eiffel Compiler.
  2. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  3. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr
  4. --                       http://SmallEiffel.loria.fr
  5. -- SmallEiffel is  free  software;  you can  redistribute it and/or modify it
  6. -- under the terms of the GNU General Public License as published by the Free
  7. -- Software  Foundation;  either  version  2, or (at your option)  any  later
  8. -- version. SmallEiffel is distributed in the hope that it will be useful,but
  9. -- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. -- or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU General Public License
  11. -- for  more  details.  You  should  have  received a copy of the GNU General
  12. -- Public  License  along  with  SmallEiffel;  see the file COPYING.  If not,
  13. -- write to the  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. -- Boston, MA 02111-1307, USA.
  15. --
  16. deferred class NATIVE
  17.    --
  18.    -- An external language (see SmallEiffel/man/external.html).
  19.    --
  20.  
  21. inherit GLOBALS;
  22.  
  23. feature
  24.  
  25.    language_name: STRING is
  26.       deferred
  27.       end;
  28.  
  29.    frozen pretty_print is
  30.       do
  31.          fmt.put_character('%"');
  32.          fmt.put_string(language_name);
  33.          fmt.put_character('%"');
  34.       end;
  35.  
  36.    use_current(er: EXTERNAL_ROUTINE): BOOLEAN is
  37.       require
  38.          er /= Void;
  39.       deferred
  40.       end;
  41.  
  42.    stupid_switch(name: STRING): BOOLEAN is
  43.       require
  44.          name /= Void
  45.       deferred
  46.       end;
  47.  
  48. feature -- C stuff :
  49.  
  50.    c_define_function(rf8: RUN_FEATURE_8; bcn, name: STRING) is
  51.          -- Produce C to define `rf8'.
  52.       require
  53.          rf8.base_feature.first_name.to_string = name;
  54.          rf8.base_feature.base_class.name.to_string = bcn
  55.       deferred
  56.       end;
  57.  
  58.    c_mapping_function(rf8: RUN_FEATURE_8; bcn, name: STRING) is
  59.          -- Produce C to use `rf8'.
  60.       require
  61.          rf8.base_feature.first_name.to_string = name;
  62.          rf8.base_feature.base_class.name.to_string = bcn
  63.       deferred
  64.       end;
  65.  
  66.    c_define_procedure(rf7: RUN_FEATURE_7; bcn, name: STRING) is
  67.          -- Produce C to define `rf7'.
  68.       require
  69.          rf7.base_feature.first_name.to_string = name;
  70.          rf7.base_feature.base_class.name.to_string = bcn
  71.       deferred
  72.       end;
  73.  
  74.    c_mapping_procedure(rf7: RUN_FEATURE_7; bcn, name: STRING) is
  75.          -- Produce C to use `rf7'.
  76.       require
  77.          rf7.base_feature.first_name.to_string = name;
  78.          rf7.base_feature.base_class.name.to_string = bcn
  79.       deferred
  80.       end;
  81.  
  82. feature -- Java stuff :
  83.  
  84.    jvm_add_method_for_function(rf8: RUN_FEATURE_8; bcn, name: STRING) is
  85.       require
  86.          rf8.base_feature.first_name.to_string = name;
  87.          rf8.base_feature.base_class.name.to_string = bcn
  88.       deferred
  89.       end;
  90.  
  91.    jvm_define_function(rf8: RUN_FEATURE_8; bcn, name: STRING) is
  92.          -- Produce Java byte code to define `rf8'.
  93.       require
  94.          rf8.base_feature.first_name.to_string = name;
  95.          rf8.base_feature.base_class.name.to_string = bcn
  96.       deferred
  97.       end;
  98.  
  99.    jvm_mapping_function(rf8: RUN_FEATURE_8; bcn, name: STRING) is
  100.          -- Produce Java byte code to use `rf8'.
  101.       require
  102.          rf8.base_feature.first_name.to_string = name;
  103.          rf8.base_feature.base_class.name.to_string = bcn
  104.       deferred
  105.       end;
  106.  
  107.    jvm_add_method_for_procedure(rf7: RUN_FEATURE_7; bcn, name: STRING) is
  108.       require
  109.          rf7.base_feature.first_name.to_string = name;
  110.          rf7.base_feature.base_class.name.to_string = bcn
  111.       deferred
  112.       end;
  113.  
  114.    jvm_define_procedure(rf7: RUN_FEATURE_7; bcn, name: STRING) is
  115.          -- Produce Java byte code to define `rf7'.
  116.       require
  117.          rf7.base_feature.first_name.to_string = name;
  118.          rf7.base_feature.base_class.name.to_string = bcn
  119.       deferred
  120.       end;
  121.  
  122.    jvm_mapping_procedure(rf7: RUN_FEATURE_7; bcn, name: STRING) is
  123.          -- Produce Java byte code to use `rf7'.
  124.       require
  125.          rf7.base_feature.first_name.to_string = name;
  126.          rf7.base_feature.base_class.name.to_string = bcn
  127.       deferred
  128.       end;
  129.  
  130. feature {NONE}
  131.  
  132.    fe_c2jvm(rf: RUN_FEATURE) is
  133.       do
  134.          eh.add_position(jvm.target_position);
  135.          eh.add_position(rf.start_position);
  136.          fatal_error("Command 'compile_to_jvm' cannot compile this code.");
  137.       end;
  138.  
  139.    fe_c2c(rf: RUN_FEATURE) is
  140.       do
  141.          eh.add_position(rf.start_position);
  142.          fatal_error("Command 'compile_to_c' cannot compile this code.");
  143.       end;
  144.  
  145. feature {NONE}
  146.  
  147.    body: STRING is "................................................................%
  148.                    %................................................................%
  149.                    %................................................................%
  150.                    %................................................................";
  151.  
  152. end -- NATIVE
  153.  
  154.