home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / call_infix_power.e < prev    next >
Encoding:
Text File  |  1998-01-16  |  2.5 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_INFIX_POWER
  17. --   
  18. --   Infix operator : "^".
  19. --         
  20.  
  21. inherit 
  22.    CALL_INFIX 
  23.       redefine pretty_print 
  24.       end;
  25.    
  26. creation make
  27.    
  28. feature 
  29.    
  30.    precedence: INTEGER is 9;
  31.    
  32.    operator: STRING is 
  33.       do
  34.      Result := us_pow;
  35.       end;
  36.    
  37.    pretty_print is
  38.      -- Because : `foo ^ foo ^ foo' means : `foo ^ (foo ^ foo)'
  39.       do
  40.      if target.precedence = atomic_precedence then
  41.         target.pretty_print;
  42.         print_op;
  43.         if arg1.precedence = atomic_precedence then
  44.            arg1.pretty_print;
  45.         elseif precedence > arg1.precedence then
  46.            arg1.bracketed_pretty_print;
  47.         else
  48.            arg1.pretty_print;
  49.         end;
  50.      elseif target.precedence <= precedence then
  51.         target.bracketed_pretty_print;
  52.         print_op;           
  53.         arg1.pretty_print;
  54.      else
  55.         target.pretty_print;
  56.         print_op;          
  57.         arg1.pretty_print;
  58.      end;        
  59.       end;
  60.    
  61.    isa_dca_inline_argument: INTEGER is
  62.      -- *** FAIRE ***
  63.       do
  64.       end;
  65.  
  66.    dca_inline_argument(formal_arg_type: TYPE) is
  67.      -- *** FAIRE ***
  68.       do
  69.       end;
  70.  
  71.    is_static: BOOLEAN is
  72.       do
  73.      if result_type.is_integer then
  74.         if target.is_static and then arg1.is_static then
  75.            Result := true;
  76.            static_value_mem := target.static_value ^ arg1.static_value;
  77.         end;
  78.      end;
  79.       end;
  80.    
  81.    compile_to_jvm is
  82.       do
  83.      call_proc_call_c2jvm;
  84.       end;
  85.    
  86.    jvm_branch_if_false: INTEGER is
  87.       do
  88.      Result := jvm_standard_branch_if_false;
  89.       end;
  90.  
  91.    jvm_branch_if_true: INTEGER is
  92.       do
  93.      Result := jvm_standard_branch_if_true;
  94.       end;
  95.    
  96. end -- CALL_INFIX_POWER
  97.  
  98.