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.
- --
-
- --
- -- Package Class_File provides the top level type Class_File used
- -- to represent a complete Java Class File. File reading and
- -- class display services are implemented with this version
- --
- -- 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;
-
- with Field;
-
- package Class_File is
-
- -- this exception may be raised if the file read is not Java compliant
- ----------------------------------------------------------------------
- Bad_File : exception;
-
- -- this array type and its access type is used to store
- -- arrays of 16 bit integers
- -------------------------------------------------------
- type Unsigned_16_Array is array (Unsigned_16 range <>) of Unsigned_16;
-
- type Acc_Unsigned_16_Array is access Unsigned_16_Array;
-
- -- type Class_File
- ------------------
- type Class_File is private;
-
-
- -- Read a Class from a Java class file
- --------------------------------------
- function Read_Class (From_File : Byte_Utilities.File_Type)
- return Class_File;
-
- -- Internal tool debugging information, should disappear soon
- -------------------------------------------------------------
- procedure Display_Class (Infos : in Class_File);
-
- -- Display the spec (and the body) of the Class with Java syntax
- ----------------------------------------------------------------
- procedure Display_Java_Spec (Infos : in Class_File;
- For_Body : in Boolean := False);
-
- -- Display the spec of the Class with Ada syntax
- ------------------------------------------------
- procedure Display_Ada_Spec (Infos : in Class_File);
-
- -- Display the body of the Class with Ada syntax
- ------------------------------------------------
- procedure Display_Ada_Body (Infos : in Class_File);
-
- -- Display the spec of the Class with Smalltalk syntax
- ------------------------------------------------------
- procedure Display_Stk_Spec (Infos : in Class_File);
-
- -- Display the body of the class with Smalltalk syntax
- ------------------------------------------------------
- procedure Display_Stk_Body (Infos : in Class_File);
-
- private
-
- -- current type Class_File reflects the contents of a Java Class file
- ---------------------------------------------------------------------
- type Class_File is
- record
- Magic : Unsigned_32;
- Minor_Version : Unsigned_16;
- Major_Version : Unsigned_16;
- Constant_Pool_Count : Unsigned_16;
- Constant_Pool : CP.Acc_CP_Infos;
- Access_Flags : Unsigned_16;
- This_Class : Unsigned_16;
- Super_Class : Unsigned_16;
- Interfaces_Count : Unsigned_16;
- Interfaces : Acc_Unsigned_16_Array;
- Fields_Count : Unsigned_16;
- Fields : Field.Acc_Field_Infos;
- Methods_Count : Unsigned_16;
- Methods : Field.Acc_Field_Infos;
- Attribute_Count : Unsigned_16;
- Attributes : Attribute.Acc_Attributes;
- end record;
-
- end Class_File;
-