home *** CD-ROM | disk | FTP | other *** search
/ Hacker / Hacker.iso / HACKER / DECOMP / DECAF / fielvari.adb < prev    next >
Encoding:
Text File  |  1996-09-19  |  3.0 KB  |  94 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. with Ada.Text_Io;
  18. with Ada.Tags; use type Ada.Tags.Tag;
  19.  
  20. with Flags;
  21.  
  22. with Attribute.Constant_Value;
  23.  
  24. package body Field.Variable is
  25.    
  26.    function Read_Field 
  27.                (From_File : Byte_Utilities.File_Type;
  28.                 Context   : in CP.Acc_CP_Infos)      
  29.             return Acc_Field_Info is
  30.       New_One : Acc_Field_Info;
  31.    begin
  32.       -- Creates the Variable_Info
  33.       New_One := new Variable_Info;
  34.  
  35.       -- Decoding inside informations is done by the superclass
  36.       Decode (From_File, New_One, Context);
  37.       return New_One;
  38.    end Read_Field;
  39.  
  40.    procedure Display_Java_Spec (Infos     : access Variable_Info;
  41.                                 Context   : in CP.Acc_CP_Infos;
  42.                                 For_Class : in Unsigned_16;
  43.                                 For_Body  : in Boolean) is
  44.    begin
  45.       Ada.Text_Io.Put ("   ");
  46.       
  47.       -- displays the access rights of the variable or constant
  48.       Flags.Display (Infos.Access_Flags, Flags.Variable_Flag);
  49.       
  50.       -- displays the variable or constant type and its name
  51.       Ada.Text_Io.Put
  52.          (CP.Java_Decoded_String
  53.              (Context (Infos.Signature_Index),
  54.               Context,
  55.               CP.Variable_Signature) &
  56.           " " &
  57.           CP.Print_String (Context (Infos.Name_Index), Context)); 
  58.       
  59.       -- if there is a value, we display it
  60.       if Infos.Attributes_Count > 0 then
  61.          for I in 1 .. Infos.Attributes_Count loop
  62.             if Infos.Attributes(I).all'Tag = Attribute.Constant_Value.Constant_Value_Attribute'Tag then         
  63.                Ada.Text_Io.Put (" = ");
  64.                Attribute.Display (Infos.Attributes(I), Context);
  65.             end if;
  66.          end loop;
  67.       end if;
  68.       Ada.Text_Io.Put_Line (";");
  69.    end Display_Java_Spec;
  70.  
  71.    procedure Display_Ada_Spec (Infos     : access Variable_Info;
  72.                                Context   : in CP.Acc_CP_Infos;
  73.                                For_Class : in Unsigned_16) is
  74.    begin
  75.       null;
  76.    end Display_Ada_Spec;
  77.  
  78.    procedure Display_Java_Body (Infos     : access Variable_Info;
  79.                                 Context   : in CP.Acc_CP_Infos;
  80.                                 For_Class : in Unsigned_16) is
  81.    begin
  82.       null;
  83.    end Display_Java_Body;
  84.  
  85.  
  86.    procedure Display_Ada_Body (Infos     : access Variable_Info;
  87.                                Context   : in CP.Acc_CP_Infos;
  88.                                For_Class : in Unsigned_16) is
  89.    begin
  90.       null;
  91.    end Display_Ada_Body;
  92.  
  93. end Field.Variable;
  94.