home *** CD-ROM | disk | FTP | other *** search
/ Hacker / Hacker.iso / HACKER / DECOMP / DECAF / field.ads < prev    next >
Encoding:
Text File  |  1996-09-19  |  4.0 KB  |  111 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. --
  18. -- This package provides the abstract class Field_Info :
  19. -- this class is the common superclass of field variables
  20. -- and methods (it has been included because these two
  21. -- classes share the same structure).
  22. --
  23. -- For more information about Java Class file format check :
  24. --    The Java Virtual Machine Specification
  25. --    (Release 1.0 Beta - Draft - August 21, 1995)
  26.  
  27. with Basic_Definitions;
  28. use Basic_Definitions;
  29.  
  30. with Byte_Utilities;
  31.  
  32. with CP;
  33.  
  34. with Attribute;
  35.  
  36. package Field is
  37.  
  38.    -- type and access type for Field_Info
  39.    --------------------------------------
  40.    type Field_Info is abstract tagged private;
  41.    
  42.    type Acc_Field_Info is access all Field_Info'Class;
  43.    
  44.    -- array type and access to array of Field_Info
  45.    -----------------------------------------------
  46.    type Field_Infos is array (Unsigned_16 range <>) of Acc_Field_Info;
  47.    
  48.    type Acc_Field_Infos is access Field_Infos;
  49.    
  50.    -- Decode the information contained in a field
  51.    ----------------------------------------------
  52.    procedure Decode (From_File : Byte_Utilities.File_Type;
  53.                      Some_Info : access Field_Info;
  54.                      Context   : in CP.Acc_CP_Infos);
  55.  
  56.    -- Read a field from a file
  57.    ---------------------------
  58.    function Read_Field 
  59.                (From_File : Byte_Utilities.File_Type;
  60.                 Context   : in CP.Acc_CP_Infos)      
  61.             return Acc_Field_Info is abstract;
  62.  
  63.    -- Default displaying procedure
  64.    -------------------------------
  65.    procedure Display (Field   : access Field_Info;
  66.                       Context : in CP.Acc_CP_Infos);
  67.  
  68.    -- Display Field information for a Java spec
  69.    -- this procedure must be overwritten by subclasses
  70.    ---------------------------------------------------
  71.    procedure Display_Java_Spec (Infos     : access Field_Info;
  72.                                 Context   : in CP.Acc_CP_Infos;
  73.                                 For_Class : in Unsigned_16;
  74.                                 For_Body  : in Boolean) is abstract;
  75.  
  76.    -- Display Field information for an Ada spec
  77.    -- this procedure must be overwritten by subclasses
  78.    ---------------------------------------------------
  79.    procedure Display_Ada_Spec (Infos     : access Field_Info;
  80.                                Context   : in CP.Acc_CP_Infos;
  81.                                For_Class : in Unsigned_16) is abstract;
  82.  
  83.    -- Display Field information for a Java body
  84.    -- this procedure must be overwritten by subclasses
  85.    ---------------------------------------------------
  86.    procedure Display_Java_Body (Infos     : access Field_Info;
  87.                                 Context   : in CP.Acc_CP_Infos;
  88.                                 For_Class : in Unsigned_16) is abstract;
  89.  
  90.    -- Display Field information for an Ada body
  91.    -- this procedure must be overwritten by subclasses
  92.    ---------------------------------------------------
  93.    procedure Display_Ada_Body (Infos     : access Field_Info;
  94.                                Context   : in CP.Acc_CP_Infos;
  95.                                For_Class : in Unsigned_16) is abstract;
  96.  
  97. private
  98.  
  99.    -- the structure shared by field informations
  100.    ---------------------------------------------
  101.    type Field_Info is abstract tagged 
  102.       record
  103.          Access_Flags     : Unsigned_16;
  104.          Name_Index       : Unsigned_16;
  105.          Signature_Index  : Unsigned_16;
  106.          Attributes_Count : Unsigned_16;
  107.          Attributes       : Attribute.Acc_Attributes;
  108.       end record;
  109.    
  110. end Field;
  111.