home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / expression_with_comment.e < prev    next >
Text File  |  1999-06-05  |  5KB  |  242 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://SmallEiffel.loria.fr
  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 {NONE}
  32.  
  33.    make(e: like expression; c: like comment) is
  34.       require
  35.          e /= Void;
  36.          really_a_comment: c.count > 0
  37.       do
  38.          expression := e;
  39.          comment := c;
  40.       ensure
  41.          expression = e;
  42.          comment = c
  43.       end;
  44.  
  45. feature
  46.  
  47.    static_result_base_class: BASE_CLASS is
  48.       do
  49.          Result := expression.static_result_base_class;
  50.       end;
  51.  
  52.    is_writable: BOOLEAN is
  53.       do
  54.          Result := expression.is_writable;
  55.       end;
  56.  
  57.    is_manifest_string: BOOLEAN is
  58.       do
  59.          Result := expression.is_manifest_string;
  60.       end;
  61.  
  62.    is_void: BOOLEAN is
  63.       do
  64.          Result := expression.is_void;
  65.       end;
  66.  
  67.    is_result: BOOLEAN is
  68.       do
  69.          Result := expression.is_result;
  70.       end;
  71.  
  72.    is_current: BOOLEAN is
  73.       do
  74.          Result := expression.is_current;
  75.       end;
  76.  
  77.    assertion_check(tag: CHARACTER) is
  78.       do
  79.          expression.assertion_check(tag);
  80.       end;
  81.  
  82.    is_static: BOOLEAN is
  83.       do
  84.          Result := expression.is_static;
  85.       end;
  86.  
  87.    static_value: INTEGER is
  88.       do
  89.          Result := expression.static_value;
  90.       end;
  91.  
  92.    is_pre_computable: BOOLEAN is
  93.       do
  94.          Result := expression.is_pre_computable;
  95.       end;
  96.  
  97.    isa_dca_inline_argument: INTEGER is
  98.       do
  99.          Result := expression.isa_dca_inline_argument;
  100.       end;
  101.  
  102.    dca_inline_argument(formal_arg_type: TYPE) is
  103.       do
  104.          expression.dca_inline_argument(formal_arg_type);
  105.       end;
  106.  
  107.    frozen mapping_c_target(target_type: TYPE) is
  108.       do
  109.          expression.mapping_c_target(target_type);
  110.       end;
  111.  
  112.    frozen mapping_c_arg(formal_arg_type: TYPE) is
  113.       do
  114.          expression.mapping_c_arg(formal_arg_type);
  115.       end;
  116.  
  117.    afd_check is
  118.       do
  119.          expression.afd_check;
  120.       end;
  121.  
  122.    collect_c_tmp is
  123.       do
  124.           expression.collect_c_tmp;
  125.       end;
  126.  
  127.    compile_to_c is
  128.       do
  129.          expression.compile_to_c;
  130.       end;
  131.  
  132.    c_declare_for_old is
  133.       do
  134.          expression.c_declare_for_old;
  135.       end;
  136.  
  137.    compile_to_c_old is
  138.       do
  139.          expression.compile_to_c_old;
  140.       end;
  141.  
  142.    compile_to_jvm_old is
  143.       do
  144.          expression.compile_to_jvm_old;
  145.       end;
  146.  
  147.    compile_to_jvm is
  148.       do
  149.          expression.compile_to_jvm;
  150.       end;
  151.  
  152.    compile_target_to_jvm is
  153.       do
  154.          expression.compile_target_to_jvm
  155.       end;
  156.  
  157.    jvm_branch_if_false: INTEGER is
  158.       do
  159.          Result := expression.jvm_branch_if_false;
  160.       end;
  161.  
  162.    jvm_branch_if_true: INTEGER is
  163.       do
  164.          Result := expression.jvm_branch_if_true;
  165.       end;
  166.  
  167.    compile_to_jvm_into(dest: TYPE): INTEGER is
  168.       do
  169.          Result := expression.compile_to_jvm_into(dest);
  170.       end;
  171.  
  172.    use_current: BOOLEAN is
  173.       do
  174.          Result := expression.use_current;
  175.       end;
  176.  
  177.    c_simple: BOOLEAN is
  178.       do
  179.          Result := expression.c_simple;
  180.       end;
  181.  
  182.    can_be_dropped: BOOLEAN is
  183.       do
  184.          Result := expression.can_be_dropped;
  185.       end;
  186.  
  187.    to_runnable(ct: TYPE): like Current is
  188.       local
  189.          e: EXPRESSION;
  190.       do
  191.          e := expression.to_runnable(ct);
  192.          if expression = e then
  193.             Result := Current;
  194.          else
  195.             !!Result.make(e,comment);
  196.          end;
  197.       end;
  198.  
  199.    start_position: POSITION is
  200.       do
  201.          Result := expression.start_position;
  202.       end;
  203.  
  204.    bracketed_pretty_print, pretty_print is
  205.       do
  206.          expression.pretty_print;
  207.          comment.pretty_print;
  208.       end;
  209.  
  210.    print_as_target is
  211.       do
  212.          expression.print_as_target;
  213.       end;
  214.  
  215.    short is
  216.       do
  217.          expression.short;
  218.       end;
  219.  
  220.    short_target is
  221.       do
  222.          expression.short_target;
  223.       end;
  224.  
  225.    result_type: TYPE is
  226.       do
  227.          Result := expression.result_type;
  228.       end;
  229.  
  230.    precedence: INTEGER is
  231.       do
  232.          Result := expression.precedence;
  233.       end;
  234.  
  235.    jvm_assign is
  236.       do
  237.          expression.jvm_assign;
  238.       end;
  239.  
  240. end -- EXPRESSION_WITH_COMMENT
  241.  
  242.