home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / e_void.e < prev    next >
Encoding:
Text File  |  1998-01-16  |  3.2 KB  |  160 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 E_VOID
  17.    --
  18.    -- Handling of the Eiffel `Void'.
  19.    --
  20.  
  21. inherit 
  22.    NAME;
  23.    EXPRESSION 
  24.       redefine is_void
  25.       end;
  26.    
  27. creation make, implicit
  28.    
  29. feature 
  30.  
  31.    start_position: POSITION;
  32.  
  33. feature
  34.    
  35.    is_static, is_void, is_pre_computable, can_be_dropped: BOOLEAN is true;
  36.    
  37.    use_current: BOOLEAN is false;
  38.    
  39.    isa_dca_inline_argument: INTEGER is -1;
  40.  
  41. feature {NONE}
  42.  
  43.    make(sp: like start_position) is
  44.       require
  45.      sp /= Void
  46.       do
  47.      start_position := sp;
  48.      to_string := us_void;
  49.       ensure
  50.      sp /= Void
  51.       end;
  52.    
  53.    implicit is
  54.       do
  55.      to_string := us_void;
  56.       end;
  57.  
  58. feature 
  59.  
  60.    to_key: STRING is
  61.       do
  62.      Result := to_string;
  63.       end;
  64.  
  65.    dca_inline_argument(formal_arg_type: TYPE) is
  66.       do
  67.      mapping_c_arg(formal_arg_type);
  68.       end;
  69.  
  70.    frozen mapping_c_target(target_type: TYPE) is
  71.       do
  72.       end;
  73.  
  74.    frozen mapping_c_arg(formal_arg_type: TYPE) is
  75.       do
  76.      compile_to_c;
  77.       end;
  78.  
  79.    short is
  80.       do
  81.      short_print.hook_or(us_void,us_void);
  82.       end;
  83.    
  84.    short_target is
  85.       do
  86.      short;
  87.      short_print.a_dot;
  88.       end;
  89.  
  90.    compile_to_c is
  91.       do
  92.      cpp.put_string("NULL");
  93.       end;
  94.    
  95.    compile_to_c_old is
  96.       do 
  97.       end;
  98.       
  99.    compile_to_jvm_old is
  100.       do 
  101.       end;
  102.    
  103.    compile_target_to_jvm, compile_to_jvm is
  104.       do
  105.      code_attribute.opcode_aconst_null;
  106.       end;
  107.    
  108.    compile_to_jvm_assignment(a: ASSIGNMENT) is
  109.       do
  110.       end;
  111.    
  112.    jvm_branch_if_false: INTEGER is
  113.       do
  114.       end;
  115.  
  116.    jvm_branch_if_true: INTEGER is
  117.       do
  118.       end;
  119.  
  120.    compile_to_jvm_into(dest: TYPE): INTEGER is
  121.       do
  122.      Result := 1;
  123.      compile_to_jvm;
  124.       end;
  125.  
  126.    result_type: TYPE_NONE is
  127.       once
  128.      !!Result.make(Void);
  129.       end;
  130.    
  131.    to_runnable(ct: TYPE): like Current is
  132.       do
  133.      if current_type = Void then
  134.         current_type := ct;
  135.         Result := Current;
  136.      else
  137.         Result := twin;
  138.         Result.set_current_type(ct);
  139.      end;
  140.       end;
  141.    
  142.    print_as_target is 
  143.       do
  144.      fatal_error("Internal Error #1 in E_VOID.");
  145.       end;
  146.    
  147.    precedence: INTEGER is
  148.       do
  149.      Result := atomic_precedence;
  150.       end;
  151.    
  152. feature {CREATION_CALL,EXPRESSION_WITH_COMMENT}
  153.       
  154.    jvm_assign is
  155.       do
  156.       end;
  157.  
  158. end -- E_VOID
  159.  
  160.