home *** CD-ROM | disk | FTP | other *** search
/ Hacker / Hacker.iso / HACKER / DECOMP / DECAF / attrexce.adb < prev    next >
Encoding:
Text File  |  1996-09-19  |  1.9 KB  |  61 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.Exceptions is
  20.  
  21.    use Byte_Utilities;
  22.      
  23.    procedure Decode (This      : access Exceptions_Attribute;
  24.                      From_File : in Byte_Utilities.File_Type;
  25.                      Context   : in CP.Acc_CP_Infos) is
  26.    begin
  27.       -- reads the number of exceptions contained in the table
  28.       Read (From_File, This.Number_Of_Exceptions);
  29.       if This.Number_Of_Exceptions > 0 then
  30.  
  31.          -- exception table allocation
  32.          This.Exception_Index_Table := 
  33.            new Index_Table (1..This.Number_Of_Exceptions);
  34.  
  35.          -- reads the exception indexes
  36.          for I in 1..This.Number_Of_Exceptions loop
  37.             Read (From_File, This.Exception_Index_Table (I));
  38.          end loop;
  39.       else
  40.          This.Exception_Index_Table := null;
  41.       end if;
  42.    end Decode;
  43.  
  44.    procedure Display (This    : access Exceptions_Attribute;
  45.                       Context : in CP.Acc_CP_Infos) is
  46.    begin
  47.       -- displays the names of the exceptions
  48.       for I in 1 .. This.Number_Of_Exceptions loop
  49.          if I > 1 then
  50.             Ada.Text_Io.Put (", ");
  51.          end if;
  52.          Ada.Text_Io.Put
  53.             (CP.Java_Decoded_String
  54.                 (Context (This.Exception_Index_Table (I)),
  55.                  Context,
  56.                  CP.Class_Name));
  57.       end loop;
  58.    end Display;
  59.  
  60. end Attribute.Exceptions;
  61.