home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / cecil_target.e < prev    next >
Text File  |  1999-06-05  |  3KB  |  160 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. class CECIL_TARGET
  17.    --
  18.    -- Pseudo expression to handle CECIL target.
  19.    --
  20.  
  21. inherit EXPRESSION;
  22.  
  23. creation make
  24.  
  25. feature {NONE}
  26.  
  27.    run_feature: RUN_FEATURE;
  28.  
  29.    make(rf: RUN_FEATURE) is
  30.       require
  31.          rf /= Void
  32.       do
  33.          run_feature := rf;
  34.       ensure
  35.          run_feature = rf
  36.       end;
  37.  
  38. feature
  39.  
  40.    is_current: BOOLEAN is true;
  41.  
  42.    is_writable: BOOLEAN is false;
  43.  
  44.    is_static: BOOLEAN is false;
  45.  
  46.    is_pre_computable: BOOLEAN is false;
  47.  
  48.    is_manifest_string: BOOLEAN is false;
  49.  
  50.    is_result: BOOLEAN is false;
  51.  
  52.    is_void: BOOLEAN is false;
  53.  
  54.    can_be_dropped: BOOLEAN is true;
  55.  
  56.    use_current: BOOLEAN is true;
  57.  
  58.    isa_dca_inline_argument: INTEGER is 0;
  59.  
  60.    c_simple: BOOLEAN is true;
  61.  
  62.    static_result_base_class: BASE_CLASS is
  63.       do
  64.          Result := result_type.base_class;
  65.       end;
  66.  
  67.    result_type: TYPE is
  68.       do
  69.          Result := run_feature.current_type;
  70.       end;
  71.  
  72.    static_value: INTEGER is
  73.       do
  74.       end;
  75.  
  76.    start_position: POSITION is
  77.       do
  78.       end;
  79.  
  80.    assertion_check(tag: CHARACTER) is
  81.       do
  82.       end;
  83.  
  84.    afd_check is
  85.       do
  86.       end;
  87.  
  88.    to_runnable(ct: TYPE): like Current is
  89.       do
  90.          Result := Current;
  91.       end;
  92.  
  93.    dca_inline_argument(formal_arg_type: TYPE) is
  94.       do
  95.       end;
  96.  
  97.    mapping_c_target(target_type: TYPE) is
  98.       do
  99.          run_feature.current_type.mapping_cast;
  100.          cpp.put_character('C');
  101.       end;
  102.  
  103.    mapping_c_arg(formal_arg_type: TYPE) is
  104.       do
  105.          mapping_c_target(result_type);
  106.       end;
  107.  
  108.    c_declare_for_old is
  109.       do
  110.       end;
  111.  
  112.    compile_to_c_old is
  113.       do
  114.       end;
  115.  
  116.    compile_to_jvm_old is
  117.       do
  118.       end;
  119.  
  120.    collect_c_tmp is
  121.       do
  122.       end;
  123.  
  124.    compile_to_c is
  125.       do
  126.          if result_type.is_user_expanded then
  127.             cpp.put_character('*');
  128.          end;
  129.          cpp.print_current;
  130.       end;
  131.  
  132.    compile_to_jvm is
  133.       do
  134.          result_type.jvm_push_local(0);
  135.       end;
  136.  
  137.    compile_target_to_jvm is
  138.       do
  139.          compile_to_jvm;
  140.       end;
  141.  
  142.    jvm_branch_if_false: INTEGER is
  143.       do
  144.          compile_to_jvm;
  145.          Result := code_attribute.opcode_ifeq;
  146.       end;
  147.  
  148.    jvm_branch_if_true: INTEGER is
  149.       do
  150.          compile_to_jvm;
  151.          Result := code_attribute.opcode_ifne;
  152.       end;
  153.  
  154.    compile_to_jvm_into(dest: TYPE): INTEGER is
  155.       do
  156.       end;
  157.  
  158. end -- CECIL_TARGET
  159.  
  160.