home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / type_none.e < prev    next >
Text File  |  1999-06-05  |  5KB  |  288 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 TYPE_NONE
  17.    --
  18.    -- For declaration of type NONE.
  19.    --
  20.  
  21. inherit TYPE;
  22.  
  23. creation make
  24.  
  25. feature
  26.  
  27.    base_class_name: CLASS_NAME;
  28.  
  29.    id: INTEGER is -1;
  30.  
  31.    is_expanded: BOOLEAN is false;
  32.  
  33.    is_basic_eiffel_expanded: BOOLEAN is false;
  34.  
  35.    is_reference: BOOLEAN is true;
  36.  
  37.    is_none: BOOLEAN is true;
  38.  
  39.    is_dummy_expanded: BOOLEAN is false;
  40.  
  41.    is_user_expanded: BOOLEAN is false;
  42.  
  43.    is_generic: BOOLEAN is false;
  44.  
  45.    is_array: BOOLEAN is false;
  46.  
  47.    is_any: BOOLEAN is false;
  48.  
  49.    is_like_current: BOOLEAN is false;
  50.  
  51.    is_like_argument: BOOLEAN is false;
  52.  
  53.    is_like_feature: BOOLEAN is false;
  54.  
  55.    jvm_method_flags: INTEGER is 17;
  56.  
  57.    static_base_class_name: CLASS_NAME is   
  58.       do
  59.          Result := base_class_name;
  60.       end;
  61.  
  62.    run_class: RUN_CLASS is
  63.       do
  64.       end;
  65.  
  66.    generic_list: ARRAY[TYPE] is
  67.       do
  68.          fatal_error_generic_list;
  69.       end;
  70.  
  71.    expanded_initializer: RUN_FEATURE_3 is
  72.       do
  73.       end;
  74.  
  75.    c_header_pass1 is
  76.       do
  77.       end;
  78.  
  79.    c_header_pass2 is
  80.       do
  81.       end;
  82.  
  83.    c_header_pass3 is
  84.       do
  85.       end;
  86.  
  87.    c_header_pass4 is
  88.       do
  89.       end;
  90.  
  91.    c_type_for_argument_in(str: STRING) is
  92.       do
  93.          str.append(fz_t0_star);
  94.       end;
  95.  
  96.    c_type_for_target_in(str: STRING) is
  97.       do
  98.          str.append(fz_t0_star);
  99.       end;
  100.  
  101.    c_type_for_result_in(str: STRING) is
  102.       do
  103.          str.append(fz_t0_star);
  104.       end;
  105.  
  106.    c_initialize is
  107.       do
  108.          cpp.put_string(fz_null);
  109.       end;
  110.  
  111.    c_initialize_in(str: STRING) is
  112.       do
  113.          str.append(fz_null);
  114.       end;
  115.  
  116.    space_for_variable, space_for_object: INTEGER is
  117.       do
  118.          Result := space_for_pointer;
  119.       end;
  120.  
  121.    need_c_struct: BOOLEAN is false;
  122.  
  123.    has_creation(fn: FEATURE_NAME): BOOLEAN is
  124.       do
  125.          eh.add_position(fn.start_position);
  126.          error(start_position,"No creation for NONE.");
  127.       end;
  128.  
  129.    is_run_type: BOOLEAN is true;
  130.  
  131.    start_position: POSITION is
  132.       do
  133.          Result := base_class_name.start_position;
  134.       end;
  135.  
  136.    to_runnable(rt: TYPE): like Current is
  137.       do
  138.          Result := Current;
  139.       end;
  140.  
  141.    written_mark, run_time_mark: STRING is
  142.       do
  143.          Result := as_none;
  144.       end;
  145.  
  146.    smallest_ancestor(other: TYPE): TYPE is
  147.       do
  148.          Result := other;
  149.       end;
  150.  
  151.    is_a(other: TYPE): BOOLEAN is
  152.       do
  153.          Result := true;
  154.       end;
  155.  
  156.    run_type: TYPE is
  157.       do
  158.          Result := Current;
  159.       end;
  160.  
  161.    used_as_reference is
  162.       do
  163.       end;
  164.  
  165.    to_reference is
  166.       do
  167.       end;
  168.  
  169.    jvm_descriptor_in(str: STRING) is
  170.       do
  171.          str.append(jvm_root_descriptor);
  172.       end;
  173.  
  174.    jvm_target_descriptor_in(str: STRING) is
  175.       do
  176.       end;
  177.  
  178.    jvm_return_code is
  179.       do
  180.          code_attribute.opcode_areturn;
  181.       end;
  182.  
  183.    jvm_push_local(offset: INTEGER) is
  184.       do
  185.          code_attribute.opcode_aload(offset);
  186.       end;
  187.  
  188.    jvm_check_class_invariant is
  189.       do
  190.       end;
  191.  
  192.    jvm_push_default: INTEGER is
  193.       do
  194.          code_attribute.opcode_aconst_null;
  195.          Result := 1;
  196.       end;
  197.  
  198.    jvm_write_local(offset: INTEGER) is
  199.       do
  200.          code_attribute.opcode_astore(offset);
  201.       end;
  202.  
  203.    jvm_xnewarray is
  204.       local
  205.          idx: INTEGER;
  206.       do
  207.          idx := constant_pool.idx_jvm_root_class;
  208.          code_attribute.opcode_anewarray(idx);
  209.       end;
  210.  
  211.    jvm_xastore is
  212.       do
  213.          code_attribute.opcode_aastore;
  214.       end;
  215.  
  216.    jvm_xaload is
  217.       do
  218.          code_attribute.opcode_aaload;
  219.       end;
  220.  
  221.    jvm_if_x_eq: INTEGER is
  222.       do
  223.          Result := code_attribute.opcode_if_acmpeq;
  224.       end;
  225.  
  226.    jvm_if_x_ne: INTEGER is
  227.       do
  228.          Result := code_attribute.opcode_if_acmpne;
  229.       end;
  230.  
  231.    jvm_to_reference is
  232.       do
  233.       end;
  234.  
  235.    jvm_expanded_from_reference(other: TYPE): INTEGER is
  236.       do
  237.          check
  238.             false
  239.          end;
  240.       end;
  241.  
  242.    jvm_convert_to(destination: TYPE): INTEGER is
  243.       do
  244.          Result := 1;
  245.       end;
  246.  
  247.    jvm_standard_is_equal is
  248.       do
  249.       end;
  250.  
  251. feature {RUN_CLASS,TYPE}
  252.  
  253.    need_gc_mark_function: BOOLEAN is false;
  254.  
  255.    just_before_gc_mark_in(str: STRING) is
  256.       do
  257.       end;
  258.  
  259.    gc_info_in(str: STRING) is
  260.       do
  261.       end;
  262.  
  263.    gc_define1 is
  264.       do
  265.       end;
  266.  
  267.    gc_define2 is
  268.       do
  269.       end;
  270.  
  271. feature {TYPE}
  272.  
  273.    short_hook is
  274.       do
  275.          short_print.a_class_name(base_class_name);
  276.       end;
  277.  
  278. feature {NONE}
  279.  
  280.    make(sp: like start_position) is
  281.       do
  282.          !!base_class_name.make(as_none,sp);
  283.       end;
  284.  
  285. end -- TYPE_NONE
  286.  
  287.  
  288.