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 child package provides the class Code_Attribute :
- -- Code attributes contain the bytecode and exception informations
- -- of Java methods.
- --
- -- 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;
-
- package Attribute.Code is
-
- -- This class attribute name in Java files
- ------------------------------------------
- C_Class_Name : constant Wide_String := "Code";
-
- -- Exception handler informations
- ---------------------------------
- type Exception_Info is private;
-
- type Exception_Infos is array (Unsigned_16 range <>) of Exception_Info;
-
- type Acc_Exception_Infos is access Exception_Infos;
-
- -- Java method bytecode and exception informations
- --------------------------------------------------
- type Code_Attribute is new Attribute with private;
-
- type Acc_Code_Attribute is access all Code_Attribute'Class;
-
-
- -- Decode informations of the attribute from a file
- ---------------------------------------------------
- procedure Decode (This : access Code_Attribute;
- From_File : in Byte_Utilities.File_Type;
- Context : in CP.Acc_CP_Infos);
-
- -- Display the attribute
- ------------------------
- procedure Display (This : access Code_Attribute;
- Context : in CP.Acc_CP_Infos);
-
- private
-
- -- Exception handler informations
- ---------------------------------
- type Exception_Info is
- record
- Start_Pc : Unsigned_16;
- End_Pc : Unsigned_16;
- Handler_Pc : Unsigned_16;
- Catch_Type : Unsigned_16;
- end record;
-
- -- Java method bytecode and exception informations
- --------------------------------------------------
- type Code_Attribute is new Attribute with
- record
- Max_Stack : Unsigned_16;
- Max_Locals : Unsigned_16;
- Code_Length : Unsigned_32;
- Code : Byte_Utilities.Acc_Bytes;
- Exceptions_Count : Unsigned_16;
- Exception_Table : Acc_Exception_Infos;
- Attributes_Count : Unsigned_16;
- Attributes : Acc_Attributes;
- end record;
-
- end Attribute.Code;
-