home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / expression_with_comment.e < prev    next >
Encoding:
Text File  |  1998-01-16  |  4.2 KB  |  200 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 EXPRESSION_WITH_COMMENT
  17. --
  18. -- To store one expression with a following comment.
  19. -- 
  20.  
  21. inherit EXPRESSION;
  22.    
  23. creation make
  24.    
  25. feature 
  26.    
  27.    expression : EXPRESSION;
  28.    
  29.    comment : COMMENT;
  30.    
  31. feature 
  32.    
  33.    make(i: like expression; c: like comment) is
  34.       require
  35.      i /= Void;
  36.      really_a_comment: c.count > 0
  37.       do
  38.      expression := i;
  39.      comment := c;
  40.       end;
  41.    
  42.    is_static: BOOLEAN is 
  43.       do 
  44.      Result := expression.is_static; 
  45.      if Result then
  46.         static_value_mem := expression.static_value_mem;
  47.      end;      
  48.       end;
  49.       
  50.    is_pre_computable: BOOLEAN is 
  51.       do
  52.      Result := expression.is_pre_computable;
  53.       end;
  54.  
  55.    isa_dca_inline_argument: INTEGER is
  56.       do
  57.      Result := expression.isa_dca_inline_argument;
  58.       end;
  59.    
  60.    dca_inline_argument(formal_arg_type: TYPE) is
  61.       do
  62.      expression.dca_inline_argument(formal_arg_type);
  63.       end;
  64.    
  65.    frozen mapping_c_target(target_type: TYPE) is
  66.       do
  67.      expression.mapping_c_target(target_type);
  68.       end;
  69.  
  70.    frozen mapping_c_arg(formal_arg_type: TYPE) is
  71.       do
  72.      expression.mapping_c_arg(formal_arg_type);
  73.       end;
  74.  
  75.    afd_check is
  76.       do
  77.      expression.afd_check;
  78.       end;
  79.    
  80.    compile_to_c is
  81.       do
  82.      expression.compile_to_c;
  83.       end;
  84.    
  85.    compile_to_c_old is 
  86.       do
  87.      expression.compile_to_c_old;
  88.       end;
  89.       
  90.    compile_to_jvm_old is 
  91.       do
  92.      expression.compile_to_jvm_old;
  93.       end;
  94.       
  95.    compile_to_jvm is
  96.       do
  97.      expression.compile_to_jvm;
  98.       end;
  99.  
  100.    compile_target_to_jvm is
  101.       do
  102.      expression.compile_target_to_jvm
  103.       end;
  104.    
  105.    compile_to_jvm_assignment(a: ASSIGNMENT) is
  106.       do
  107.      expression.compile_to_jvm_assignment(a);
  108.       end;
  109.    
  110.    jvm_branch_if_false: INTEGER is
  111.       do
  112.      Result := expression.jvm_branch_if_false;
  113.       end;
  114.  
  115.    jvm_branch_if_true: INTEGER is
  116.       do
  117.      Result := expression.jvm_branch_if_true;
  118.       end;
  119.  
  120.    compile_to_jvm_into(dest: TYPE): INTEGER is
  121.       do
  122.      Result := expression.compile_to_jvm_into(dest);
  123.       end;
  124.  
  125.    use_current: BOOLEAN is
  126.       do
  127.      Result := expression.use_current;
  128.       end;
  129.    
  130.    c_simple: BOOLEAN is
  131.       do
  132.      Result := expression.c_simple;
  133.       end;
  134.    
  135.    can_be_dropped: BOOLEAN is
  136.       do
  137.      Result := expression.can_be_dropped;
  138.       end;
  139.    
  140.    to_runnable(ct: TYPE): like Current is
  141.       do
  142.      if current_type = Void then
  143.         current_type := ct;
  144.         expression := expression.to_runnable(ct);
  145.         Result := Current;
  146.      else
  147.         Result := twin;
  148.         Result.set_current_type(Void);
  149.         Result := Result.to_runnable(ct);
  150.      end;
  151.       end;
  152.    
  153.    start_position: POSITION is
  154.       do
  155.      Result := expression.start_position;
  156.       end;
  157.    
  158.    bracketed_pretty_print, pretty_print is
  159.       do
  160.      expression.pretty_print;
  161.      comment.pretty_print;
  162.       end;
  163.    
  164.    print_as_target is
  165.       do
  166.      expression.print_as_target;
  167.       end;
  168.    
  169.    short is
  170.       do
  171.      expression.short;
  172.       end;
  173.    
  174.    short_target is
  175.       do
  176.      expression.short_target;
  177.       end;
  178.    
  179.    result_type: TYPE is
  180.       do
  181.      Result := expression.result_type;
  182.       end;
  183.    
  184. feature
  185.    
  186.    precedence: INTEGER is
  187.       do
  188.      Result := expression.precedence;
  189.       end;
  190.    
  191. feature {CREATION_CALL,EXPRESSION_WITH_COMMENT}
  192.       
  193.    jvm_assign is
  194.       do
  195.      expression.jvm_assign;
  196.       end;
  197.  
  198. end -- EXPRESSION_WITH_COMMENT
  199.  
  200.