home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / base_type_constant.e < prev    next >
Text File  |  1999-06-05  |  4KB  |  168 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. deferred class BASE_TYPE_CONSTANT
  17.    --
  18.    -- Root of : BOOLEAN_CONSTANT, CHARACTER_CONSTANT, INTEGER_CONSTANT
  19.    --           and REAL_CONSTANT.
  20.    --
  21.  
  22. inherit EXPRESSION;
  23.  
  24. feature
  25.  
  26.    start_position: POSITION;
  27.  
  28. feature
  29.  
  30.    is_writable: BOOLEAN is false;
  31.  
  32.    is_current: BOOLEAN is false;
  33.  
  34.    is_manifest_string: BOOLEAN is false;
  35.  
  36.    is_result: BOOLEAN is false;
  37.  
  38.    is_void: BOOLEAN is false;
  39.  
  40.    use_current: BOOLEAN is false;
  41.  
  42.    can_be_dropped: BOOLEAN is true;
  43.  
  44. feature
  45.  
  46.    frozen afd_check is
  47.       do
  48.       end;
  49.  
  50.    frozen is_pre_computable: BOOLEAN is
  51.       do
  52.          Result := is_static;
  53.       end;
  54.  
  55.    frozen c_declare_for_old is
  56.       do
  57.       end;
  58.  
  59.    frozen compile_to_c_old is
  60.       do
  61.       end;
  62.  
  63.    frozen collect_c_tmp is
  64.       do
  65.       end;
  66.  
  67.    frozen compile_to_jvm_old is
  68.       do
  69.       end;
  70.  
  71.    frozen to_runnable(ct: TYPE): like Current is
  72.       do
  73.          Result := Current;
  74.       end;
  75.  
  76.    frozen assertion_check(tag: CHARACTER) is
  77.       do
  78.       end;
  79.  
  80.    isa_dca_inline_argument: INTEGER is
  81.       do
  82.          if is_static then
  83.             Result := -1;
  84.          end;
  85.       end;
  86.  
  87.    dca_inline_argument(formal_arg_type: TYPE) is
  88.       do
  89.          mapping_c_arg(formal_arg_type);
  90.       end;
  91.  
  92.    frozen mapping_c_target(target_type: TYPE) is
  93.       do
  94.          compile_to_c;
  95.       end;
  96.  
  97.    frozen mapping_c_arg(formal_arg_type: TYPE) is
  98.       do
  99.          if formal_arg_type.is_reference then
  100.             -- Expanded into Reference :
  101.             result_type.to_reference;
  102.             cpp.put_character('(');
  103.             compile_to_c;
  104.             cpp.put_character(')');
  105.          else
  106.             -- Expanded into Expanded :
  107.             compile_to_c;
  108.          end;
  109.       end;
  110.  
  111. feature {NONE}
  112.  
  113.    to_string: STRING is
  114.       deferred
  115.       end;
  116.  
  117. feature
  118.  
  119.    frozen bracketed_pretty_print, frozen pretty_print is
  120.       do
  121.          fmt.put_string(to_string);
  122.       end;
  123.  
  124.    frozen print_as_target is
  125.       do
  126.          fmt.put_character('(');
  127.          pretty_print;
  128.          fmt.put_character(')');
  129.          fmt.put_character('.');
  130.       end;
  131.  
  132.    frozen short is
  133.       do
  134.          short_print.a_base_type_constant(to_string);
  135.       end;
  136.  
  137.    frozen short_target is
  138.       do
  139.          bracketed_short;
  140.          short_print.a_dot;
  141.       end;
  142.  
  143.    frozen precedence: INTEGER is
  144.       do
  145.          Result := atomic_precedence;
  146.       end;
  147.  
  148.    frozen base_class_name: CLASS_NAME is
  149.       do
  150.          Result := result_type.base_class_name;
  151.       end;
  152.  
  153.    frozen jvm_assign is
  154.       do
  155.       end;
  156.  
  157. feature {BASE_TYPE_CONSTANT}
  158.  
  159.    frozen set_current_type(ct: TYPE) is
  160.       do
  161.          current_type := ct;
  162.       ensure
  163.          current_type = ct;
  164.       end;
  165.  
  166. end -- BASE_TYPE_CONSTANT
  167.  
  168.