comp.lang.ada
 help / color / mirror / Atom feed
* Load an object from a file
@ 2009-04-03 12:01 Olivier Scalbert
  2009-04-03 13:07 ` Niklas Holsti
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Olivier Scalbert @ 2009-04-03 12:01 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2009-04-19 20:27 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-03 12:01 Load an object from a file Olivier Scalbert
2009-04-03 13:07 ` 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

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