home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / argument_name.e < prev    next >
Encoding:
Text File  |  1998-01-16  |  3.8 KB  |  149 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. deferred class ARGUMENT_NAME
  17. --
  18. -- Handling of arguments.
  19. --
  20.  
  21. inherit LOCAL_ARGUMENT;
  22.    
  23. feature
  24.  
  25.    is_writable: BOOLEAN is false;
  26.  
  27.    isa_dca_inline_argument: INTEGER is
  28.       do
  29.      Result := rank;
  30.       end;
  31.  
  32.    dca_inline_argument(formal_arg_type: TYPE) is
  33.       do
  34.      cpp.put_ith_argument(rank);
  35.       end;
  36.  
  37.    frozen mapping_c_target(target_type: TYPE) is
  38.       local
  39.      flag: BOOLEAN;
  40.      rt: TYPE;
  41.       do
  42.      flag := cpp.call_invariant_start(target_type);
  43.      rt := result_type.run_type;
  44.      if rt.is_reference then
  45.         if target_type.is_reference then
  46.            -- Reference into Reference :
  47.            cpp.put_character('(');
  48.            cpp.put_character('(');
  49.            cpp.put_character('T');
  50.            cpp.put_integer(target_type.id);
  51.            cpp.put_character('*');
  52.            cpp.put_character(')');
  53.            cpp.print_argument(rank);
  54.            cpp.put_character(')');
  55.         else
  56.            -- Reference into Expanded :
  57.            cpp.print_argument(rank);
  58.         end;
  59.      else
  60.         if target_type.is_reference then
  61.            -- Expanded into Reference :
  62.            cpp.print_argument(rank);
  63.         else
  64.            -- Expanded into Expanded :
  65.            cpp.print_argument(rank);
  66.         end;
  67.      end;
  68.      if flag then
  69.         cpp.call_invariant_end;
  70.      end;
  71.       end;
  72.  
  73.    frozen mapping_c_arg(formal_arg_type: TYPE) is
  74.       local
  75.      rt: like result_type;
  76.       do
  77.      rt := result_type.run_type;
  78.      if rt.is_reference then
  79.         if formal_arg_type.is_reference then
  80.            -- Reference into Reference :
  81.            cpp.print_argument(rank);
  82.         else
  83.            -- Reference into Expanded :
  84.            rt.to_expanded;
  85.            cpp.put_character('(');
  86.            cpp.print_argument(rank);
  87.            cpp.put_character(')');
  88.         end;
  89.      else
  90.         if formal_arg_type.is_reference then
  91.            -- Expanded into Reference :
  92.            rt.to_reference;
  93.            cpp.put_character('(');
  94.            cpp.print_argument(rank);
  95.            cpp.put_character(')');
  96.         else
  97.            -- Expanded into Expanded :
  98.            cpp.print_argument(rank);
  99.         end;
  100.      end;
  101.       end;
  102.  
  103.    compile_to_c is
  104.       do
  105.      if result_type.is_user_expanded then
  106.         cpp.put_character('*');
  107.      end;
  108.      cpp.print_argument(rank);
  109.       end;
  110.    
  111.    compile_to_jvm is
  112.       local
  113.      jvm_offset: INTEGER;
  114.       do
  115.      jvm_offset := jvm.argument_offset_of(Current);
  116.      result_type.run_type.jvm_push_local(jvm_offset);
  117.       end;
  118.    
  119.    compile_to_jvm_assignment(a: ASSIGNMENT) is
  120.       do
  121.       end;
  122.    
  123.    jvm_branch_if_false: INTEGER is
  124.       do
  125.      compile_to_jvm;
  126.      Result := code_attribute.opcode_ifeq;
  127.       end;
  128.  
  129.    jvm_branch_if_true: INTEGER is
  130.       do
  131.      compile_to_jvm;
  132.      Result := code_attribute.opcode_ifne;
  133.       end;
  134.  
  135.    compile_to_jvm_into(dest: TYPE): INTEGER is
  136.       do
  137.      Result := standard_compile_to_jvm_into(dest);
  138.       end;
  139.  
  140. feature {CREATION_CALL,EXPRESSION_WITH_COMMENT}
  141.       
  142.    jvm_assign is
  143.       do
  144.       end;
  145.  
  146. end -- ARGUMENT_NAME
  147.  
  148.  
  149.