home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / address_of.e next >
Encoding:
Text File  |  1998-01-16  |  3.7 KB  |  179 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://www.loria.fr/SmallEiffel
  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 ADDRESS_OF
  17.    --
  18.    -- For the special address form notation : $ feature_name
  19.    -- 
  20.  
  21. inherit EXPRESSION;
  22.    
  23. creation make
  24.    
  25. feature 
  26.    
  27.    feature_name: FEATURE_NAME;
  28.    
  29. feature {NONE}
  30.    
  31.    rf: RUN_FEATURE;
  32.      -- Corresponding one when runnable.
  33.    
  34. feature 
  35.    
  36.    is_static: BOOLEAN is false;
  37.    
  38.    is_pre_computable: BOOLEAN is false;
  39.  
  40.    isa_dca_inline_argument: INTEGER is 0;
  41.  
  42.    use_current: BOOLEAN is false;
  43.    
  44. feature 
  45.    
  46.    make(fn: like feature_name) is
  47.       require
  48.      fn /= Void
  49.       do
  50.      feature_name := fn;
  51.       ensure
  52.      feature_name = fn;
  53.       end;
  54.    
  55. feature 
  56.    
  57.    dca_inline_argument(formal_arg_type: TYPE) is
  58.       do
  59.       end;
  60.  
  61.    result_type: TYPE_POINTER is
  62.       do
  63.      Result := type_pointer;
  64.       end;
  65.       
  66.    afd_check is do end;
  67.  
  68.    compile_target_to_jvm, compile_to_jvm is
  69.       do
  70.      eh.add_position(start_position);
  71.      fatal_error(fz_jvm_error);
  72.       end;
  73.    
  74.    jvm_branch_if_false: INTEGER is
  75.       do
  76.       end;
  77.  
  78.    jvm_branch_if_true: INTEGER is
  79.       do
  80.       end;
  81.    
  82.    compile_to_jvm_into(dest: TYPE): INTEGER is
  83.       do
  84.       end;
  85.    
  86.    compile_to_jvm_assignment(a: ASSIGNMENT) is
  87.       do
  88.       end;
  89.    
  90.    compile_to_c is
  91.       do
  92.      cpp.put_string("((void *)");
  93.      rf.address_of; 
  94.      cpp.put_character(')');
  95.       end;
  96.    
  97.    frozen mapping_c_target(target_type: TYPE) is
  98.       do
  99.      compile_to_c;
  100.       end;
  101.  
  102.    frozen mapping_c_arg(formal_arg_type: TYPE) is
  103.       do
  104.      compile_to_c;
  105.       end;
  106.  
  107.    compile_to_c_old is do end;
  108.   
  109.    compile_to_jvm_old is do end;
  110.   
  111.    can_be_dropped, c_simple: BOOLEAN is true;
  112.  
  113.    to_runnable(ct: TYPE): like Current is
  114.       do
  115.      if current_type = Void then
  116.         current_type := ct;
  117.         rf := ct.run_class.get_rf_with(feature_name);
  118.         if rf = Void then
  119.            error(start_position,"Feature not found.");
  120.         end;
  121.         Result := Current;
  122.      else
  123.         !!Result.make(feature_name);
  124.         Result := Result.to_runnable(ct);
  125.      end;
  126.       end;
  127.    
  128.    precedence: INTEGER is
  129.       do
  130.      Result := atomic_precedence;
  131.       end;
  132.    
  133.    start_position: POSITION is
  134.       do
  135.      Result := feature_name.start_position;
  136.       end;
  137.    
  138.    pretty_print is
  139.       do
  140.      fmt.put_character('%D');
  141.      feature_name.pretty_print;
  142.       end;
  143.    
  144.    print_as_target is
  145.       do
  146.      error(start_position,"ADDRESS_OF/does_not_understand");
  147.       end;
  148.    
  149.    bracketed_pretty_print is
  150.       do
  151.      fmt.put_character('(');
  152.      pretty_print;
  153.      fmt.put_character(')');
  154.       end;
  155.  
  156.    short is
  157.       do
  158.      short_print.a_character('%D');
  159.      feature_name.short;
  160.       end;
  161.    
  162.    short_target is
  163.       do
  164.      bracketed_short;
  165.      short_print.a_dot;
  166.       end;
  167.    
  168. feature {CREATION_CALL,EXPRESSION_WITH_COMMENT}
  169.       
  170.    jvm_assign is
  171.       do
  172.       end;
  173.  
  174. invariant
  175.    
  176.    feature_name /= Void
  177.    
  178. end --  ADDRESS_OF
  179.