home *** CD-ROM | disk | FTP | other *** search
- --
- -- Copyright (C) 1996 Ada Resource Association (ARA), Columbus, Ohio.
- -- Author: Gilles Demailly
- --
- --
- -- Permission to use, copy, modify, and distribute this software and its
- -- documentation for any purpose and without fee is hereby granted,
- -- provided that the above copyright and authorship notice appear in all
- -- copies and that both that copyright notice and this permission notice
- -- appear in supporting documentation.
- --
- -- The ARA makes no representations about the suitability of this software
- -- for any purpose. It is provided "as is" without express
- -- or implied warranty.
- --
-
- --
- -- This package provides the abstract class Field_Info :
- -- this class is the common superclass of field variables
- -- and methods (it has been included because these two
- -- classes share the same structure).
- --
- -- For more information about Java Class file format check :
- -- The Java Virtual Machine Specification
- -- (Release 1.0 Beta - Draft - August 21, 1995)
-
- with Basic_Definitions;
- use Basic_Definitions;
-
- with Byte_Utilities;
-
- with CP;
-
- with Attribute;
-
- package Field is
-
- -- type and access type for Field_Info
- --------------------------------------
- type Field_Info is abstract tagged private;
-
- type Acc_Field_Info is access all Field_Info'Class;
-
- -- array type and access to array of Field_Info
- -----------------------------------------------
- type Field_Infos is array (Unsigned_16 range <>) of Acc_Field_Info;
-
- type Acc_Field_Infos is access Field_Infos;
-
- -- Decode the information contained in a field
- ----------------------------------------------
- procedure Decode (From_File : Byte_Utilities.File_Type;
- Some_Info : access Field_Info;
- Context : in CP.Acc_CP_Infos);
-
- -- Read a field from a file
- ---------------------------
- function Read_Field
- (From_File : Byte_Utilities.File_Type;
- Context : in CP.Acc_CP_Infos)
- return Acc_Field_Info is abstract;
-
- -- Default displaying procedure
- -------------------------------
- procedure Display (Field : access Field_Info;
- Context : in CP.Acc_CP_Infos);
-
- -- Display Field information for a Java spec
- -- this procedure must be overwritten by subclasses
- ---------------------------------------------------
- procedure Display_Java_Spec (Infos : access Field_Info;
- Context : in CP.Acc_CP_Infos;
- For_Class : in Unsigned_16;
- For_Body : in Boolean) is abstract;
-
- -- Display Field information for an Ada spec
- -- this procedure must be overwritten by subclasses
- ---------------------------------------------------
- procedure Display_Ada_Spec (Infos : access Field_Info;
- Context : in CP.Acc_CP_Infos;
- For_Class : in Unsigned_16) is abstract;
-
- -- Display Field information for a Java body
- -- this procedure must be overwritten by subclasses
- ---------------------------------------------------
- procedure Display_Java_Body (Infos : access Field_Info;
- Context : in CP.Acc_CP_Infos;
- For_Class : in Unsigned_16) is abstract;
-
- -- Display Field information for an Ada body
- -- this procedure must be overwritten by subclasses
- ---------------------------------------------------
- procedure Display_Ada_Body (Infos : access Field_Info;
- Context : in CP.Acc_CP_Infos;
- For_Class : in Unsigned_16) is abstract;
-
- private
-
- -- the structure shared by field informations
- ---------------------------------------------
- type Field_Info is abstract tagged
- record
- Access_Flags : Unsigned_16;
- Name_Index : Unsigned_16;
- Signature_Index : Unsigned_16;
- Attributes_Count : Unsigned_16;
- Attributes : Attribute.Acc_Attributes;
- end record;
-
- end Field;
-