home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / call_prefix_not.e < prev    next >
Encoding:
Text File  |  1998-01-16  |  2.4 KB  |  98 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_NOT
  17. --   
  18. --   Prefix operator : "not".
  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_not;
  35.       end;
  36.    
  37.    isa_dca_inline_argument: INTEGER is
  38.      -- *** FAIRE ***
  39.       do
  40.       end;
  41.  
  42.    dca_inline_argument(formal_arg_type: TYPE) is
  43.      -- *** FAIRE ***
  44.       do
  45.       end;
  46.  
  47.    is_static: BOOLEAN is
  48.       do
  49.      if target.result_type.is_boolean then
  50.         if target.is_static then
  51.            Result := true;
  52.            if target.static_value = 0 then
  53.           static_value_mem := 1;
  54.            end;
  55.         end;
  56.      end;
  57.       end;
  58.  
  59.    compile_to_c is
  60.       do
  61.      if run_control.boost and then
  62.         target.result_type.run_type.is_boolean then
  63.         cpp.put_string("!(");
  64.         target.compile_to_c;
  65.         cpp.put_character(')');
  66.      else
  67.         call_proc_call_c2c;
  68.      end;
  69.       end;
  70.  
  71.    compile_to_jvm is
  72.       do
  73.      call_proc_call_c2jvm;
  74.       end;
  75.    
  76.    jvm_branch_if_false: INTEGER is
  77.       do
  78.      if current_type.is_boolean then
  79.         target.compile_to_jvm;
  80.         Result := code_attribute.opcode_ifne;
  81.      else
  82.         Result := jvm_standard_branch_if_false;
  83.      end;
  84.       end;
  85.  
  86.    jvm_branch_if_true: INTEGER is
  87.       do
  88.      if current_type.is_boolean then
  89.         target.compile_to_jvm;
  90.         Result := code_attribute.opcode_ifeq;
  91.      else
  92.         Result := jvm_standard_branch_if_true;
  93.      end;
  94.       end;
  95.  
  96. end -- CALL_PREFIX_NOT
  97.  
  98.