home *** CD-ROM | disk | FTP | other *** search
/ Hacker / Hacker.iso / HACKER / DECOMP / DECAF / attribut.ads < prev    next >
Encoding:
Text File  |  1996-09-19  |  2.8 KB  |  88 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. -- This package provides the abstract class Attribute :
  18. -- this class is the common superclass of all Java Attribute classes.
  19. --
  20. -- For more information about Java Class file format check :
  21. --    The Java Virtual Machine Specification
  22. --    (Release 1.0 Beta - Draft - August 21, 1995)
  23.  
  24.  
  25. with Basic_Definitions;
  26. use Basic_Definitions;
  27.  
  28. with Byte_Utilities;
  29.  
  30. with CP;
  31.  
  32. package Attribute is
  33.  
  34.    -- Abstract type of Attributes
  35.    ------------------------------
  36.    type Attribute is abstract tagged private;
  37.    
  38.    -- Access to Attribute
  39.    ----------------------
  40.    type Acc_Attribute is access all Attribute'Class;
  41.    
  42.    -- Array of Attributes
  43.    ----------------------
  44.    type Attributes is array (Unsigned_16 range <>) of Acc_Attribute;
  45.  
  46.    -- Access to array of Attributes
  47.    --------------------------------
  48.    type Acc_Attributes is access Attributes;
  49.  
  50.    -- Raised when an unknown kind of Attribute is read
  51.    ---------------------------------------------------
  52.    E_Unknown_Attribute : exception;
  53.  
  54.    -- Read an Attribute from a file
  55.    -- (Includes a call to Decode)
  56.    -- may raise E_Unknown_Attribute
  57.    --------------------------------
  58.    function Read_Attribute
  59.                (From_File : Byte_Utilities.File_Type;
  60.                 Context   : CP.Acc_CP_Infos)      
  61.             return Acc_Attribute;
  62.  
  63.    -- Decode informations of an attribute from a file
  64.    -- this procedure must be overwritten by subclasses
  65.    ---------------------------------------------------
  66.    procedure Decode (This      : access Attribute;
  67.                      From_File : in Byte_Utilities.File_Type;
  68.                      Context   : in CP.Acc_CP_Infos) is abstract;
  69.  
  70.    -- Display an Attribute
  71.    -- this procedure must be overwritten by subclasses
  72.    ---------------------------------------------------
  73.    procedure Display (This    : access Attribute;
  74.                       Context : in CP.Acc_CP_Infos) is abstract;
  75.  
  76.  
  77. private
  78.  
  79.    -- All Attributes share these two instance variables
  80.    ----------------------------------------------------
  81.    type Attribute is abstract tagged
  82.       record
  83.          Name   : Unsigned_16;
  84.          Length : Unsigned_32;
  85.       end record;
  86.  
  87. end Attribute;
  88.