home *** CD-ROM | disk | FTP | other *** search
/ Hacker / Hacker.iso / HACKER / DECOMP / DECAF / atlovata.adb < prev    next >
Encoding:
Text File  |  1996-09-19  |  2.1 KB  |  60 lines

  1. --
  2. -- Copyright (C) 1996 Ada Resource Association (ARA), Columbus, Ohio.
  3. -- Author: Gilles Demailly
  4. --
  5. --
  6. -- Permission to use, copy, modify, and distribute this software and its
  7. -- documentation for any purpose and without fee is hereby granted,
  8. -- provided that the above copyright and authorship notice appear in all
  9. -- copies and that both that copyright notice and this permission notice
  10. -- appear in supporting documentation.
  11. -- 
  12. -- The ARA makes no representations about the suitability of this software
  13. -- for any purpose.  It is provided "as is" without express
  14. -- or implied warranty.
  15. -- 
  16.  
  17. with Ada.Text_Io;
  18.  
  19. package body Attribute.Local_Variable_Table is
  20.  
  21.    use Byte_Utilities;
  22.      
  23.    procedure Decode (This      : access Local_Variable_Table_Attribute;
  24.                      From_File : in Byte_Utilities.File_Type;
  25.                      Context   : in CP.Acc_CP_Infos) is
  26.    begin
  27.       -- reads the local variable table length
  28.       Read (From_File, This.Local_Variable_Table_Length);
  29.  
  30.       if This.Local_Variable_Table_Length > 0 then
  31.  
  32.          -- table allocation
  33.          This.Local_Variable_Table := new Variable_Infos (1..This.Local_Variable_Table_Length);
  34.          
  35.          -- fills the table with Start_Pc, Length, Name_Index, 
  36.          -- Signature_Index, and slot values
  37.          -----------------------------------------------------
  38.          for I in 1..This.Local_Variable_Table_Length loop
  39.             Read (From_File, This.Local_Variable_Table (I).Start_Pc);
  40.             Read (From_File, This.Local_Variable_Table (I).Length);
  41.             Read (From_File, This.Local_Variable_Table (I).Name_Index);
  42.             Read (From_File, This.Local_Variable_Table (I).Signature_Index);
  43.             Read (From_File, This.Local_Variable_Table (I).Slot);
  44.          end loop;
  45.       else
  46.          This.Local_Variable_Table := null;
  47.       end if;
  48.  
  49.    end Decode;
  50.  
  51.    procedure Display (This    : access Local_Variable_Table_Attribute;
  52.                       Context : in CP.Acc_CP_Infos) is
  53.    begin
  54.       -- this procedure is not yet implemented (uncalled)
  55.       Ada.Text_Io.Put_Line
  56.          (" Local Variable Table available");
  57.    end Display;
  58.  
  59. end Attribute.Local_Variable_Table;
  60.