home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / call_prefix_minus.e < prev    next >
Encoding:
Text File  |  1998-01-16  |  2.3 KB  |  94 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 CALL_PREFIX_MINUS
  17. --   
  18. --   Prefix operator : "-".
  19. --   
  20.  
  21. inherit
  22.    CALL_PREFIX
  23.       redefine compile_to_c
  24.       end;
  25.    
  26. creation make
  27.    
  28. feature 
  29.    
  30.    precedence: INTEGER is 11;
  31.    
  32.    operator: STRING is
  33.       do
  34.      Result := us_minus;
  35.       end;
  36.    
  37.    isa_dca_inline_argument: INTEGER is
  38.       do
  39.      if result_type.is_integer then
  40.         Result := target.isa_dca_inline_argument;
  41.      end;
  42.       end;
  43.  
  44.    dca_inline_argument(formal_arg_type: TYPE) is
  45.       do
  46.      cpp.put_character('-');
  47.      cpp.put_character('(');
  48.      target.dca_inline_argument(formal_arg_type)
  49.      cpp.put_character(')');
  50.       end;
  51.  
  52.    is_static: BOOLEAN is
  53.       do
  54.      if target.result_type.is_integer then
  55.         if target.is_static then
  56.            Result := true;
  57.            static_value_mem := - target.static_value;
  58.         end;
  59.      end;
  60.       end;
  61.  
  62.    compile_to_c is
  63.       do
  64.      if run_control.boost and then
  65.         run_feature.current_type.is_basic_eiffel_expanded then
  66.         cpp.put_character('-');
  67.         cpp.put_character('(');
  68.         target.compile_to_c;
  69.         cpp.put_character(')');
  70.      else
  71.         call_proc_call_c2c;
  72.      end;
  73.       end;
  74.    
  75.    compile_to_jvm is
  76.       do
  77.      call_proc_call_c2jvm;
  78.       end;
  79.    
  80.    jvm_branch_if_false: INTEGER is
  81.       do
  82.      Result := jvm_standard_branch_if_false;
  83.       end;
  84.  
  85.    jvm_branch_if_true: INTEGER is
  86.       do
  87.      Result := jvm_standard_branch_if_true;
  88.       end;
  89.    
  90. end -- CALL_PREFIX_MINUS
  91.  
  92.  
  93.  
  94.