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 CP_Info :
- -- this class is the common superclass of all Java Constant_Pool
- -- informations classes.
- --
- -- 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;
-
- package CP is
-
- -- Decoding purpose is used for Constant Pool information
- -- to String conversion
- ---------------------------------------------------------
- type Decoding_Purpose is
- (Class_Name, Variable_Signature, Method_Signature);
-
- -- Abstract type and access type for Constant Pool Infos
- --------------------------------------------------------
- type CP_Info is abstract tagged private;
-
- type Acc_CP_Info is access all CP_Info'Class;
-
- -- array type and access type to Constant Pool Infos
- ----------------------------------------------------
- type CP_Infos is array (Unsigned_16 range <>) of Acc_CP_Info;
-
- type Acc_CP_Infos is access CP_Infos;
-
-
- -- Raised if an unknown kind of Constant Pool is read
- -----------------------------------------------------
- E_Unknown_Tag : exception;
-
- -- Decode a Constant Pool information
- -- this procedure must be overwritten by subclasses
- ---------------------------------------------------
- procedure Decode (From_File : Byte_Utilities.File_Type;
- Some_Info : access CP_Info) is abstract;
-
- -- Read a Constant Pool information
- -----------------------------------
- function Read_Constant
- (From_File : Byte_Utilities.File_Type)
- return Acc_CP_Info;
-
- -- Display a Constant Pool information
- -- this procedure must be overwritten by subclasses
- ---------------------------------------------------
- procedure Display (Some_Info : access CP_Info;
- Context : in Acc_CP_Infos) is abstract;
-
- -- Returns True is the information is a class
- ---------------------------------------------
- function Is_Class
- (Some_Info : access CP_Info) return Boolean;
-
- -- Returns True is the information uses two indexes
- -- in the Constant Pool table (which is -why?- the
- -- case for Long_Integer and Long_Floats)
- ---------------------------------------------------
- function Use_Two_Indexes_In_Table
- (Some_Info : access CP_Info) return Boolean;
-
-
- --
- -- Differents Constant Pool information to string conversion functions
- --
-
- function As_String
- (Some_Info : access CP_Info) return Wide_String;
-
- function Print_String
- (Some_Info : access CP_Info;
- Context : Acc_CP_Infos) return String;
-
- function Java_Decoded_String
- (Some_Info : access CP_Info;
- Context : Acc_CP_Infos;
- Purpose : Decoding_Purpose) return String;
-
- private
-
- -- Abstract type and access type for Constant Pool Infos
- --------------------------------------------------------
- type CP_Info is abstract tagged
- record
- Tag : Unsigned_8;
- end record;
-
- end CP;
-