comp.lang.ada
 help / color / mirror / Atom feed
From: Olivier Scalbert <olivier.scalbert@algosyn.com>
Subject: Load an object from a file
Date: Fri, 03 Apr 2009 14:01:15 +0200
Date: 2009-04-03T14:01:15+02:00	[thread overview]
Message-ID: <49d5fa88$0$2862$ba620e4c@news.skynet.be> (raw)

Hello everybody !

In my Ada self-study context, I was asking myself how can I create and 
fill objects or records from a file.
As an example, I have tried to represent a java class file format 
structure and fill it with a .class java file.

The ClassFile structure is something like:

     ClassFile {
     	u4 magic;
     	u2 minor_version;
     	u2 major_version;
     	u2 constant_pool_count;
     	cp_info constant_pool[constant_pool_count-1];
     	u2 access_flags;
     	u2 this_class;
     	u2 super_class;
     	u2 interfaces_count;
     	u2 interfaces[interfaces_count];
     	u2 fields_count;
     	field_info fields[fields_count];
     	u2 methods_count;
     	method_info methods[methods_count];
     	u2 attributes_count;
     	attribute_info attributes[attributes_count];
     }


JVM Specs can be found there:
http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html

I have no problem to represent and to fill from file, the first four fields.
But I do not know what is the best (Ada) way of representing the array 
of info constant_pool as the size is only known at run time.(= 
constant_pool_cout).
Also how can I fill this array ?

Thanks to help me and have a nice day.

Olivier



             reply	other threads:[~2009-04-03 12:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-03 12:01 Olivier Scalbert [this message]
2009-04-03 13:07 ` Load an object from a file Niklas Holsti
2009-04-03 13:37 ` Ludovic Brenta
2009-04-03 15:19   ` Olivier Scalbert
2009-04-03 16:08     ` Georg Bauhaus
2009-04-03 16:22       ` Ludovic Brenta
2009-04-03 16:41         ` Olivier Scalbert
2009-04-03 16:46       ` Adam Beneschan
2009-04-03 20:22         ` Ludovic Brenta
2009-04-09 20:32   ` Olivier Scalbert
2009-04-09 21:22     ` Ludovic Brenta
2009-04-09 22:22       ` Olivier Scalbert
2009-04-19 13:08   ` Olivier Scalbert
2009-04-19 19:52     ` Ludovic Brenta
2009-04-19 20:27     ` Gautier
2009-04-03 13:41 ` Thomas Løcke
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox