--- Brian Wheeler <[EMAIL PROTECTED]> wrote:
> Ok, what if we did IFF with these caveats:
> * all chunks must be padded to 4 bytes (instead of IFF's
> 2)
> * no nesting of FORMs
>
> Chunks we'd need are:
>
> Name: 'PINF' - Parrot Information
> Size: 28 bytes + size of directory
> Optional: No
> Data:
> long magic cookie (or will PINF) be enough?
> 8-byte word: endianness (magic value
> 0x123456789abcdef0)
> byte: word size
> byte[7]: empty
> word: major version
> word: minor version
> long count of directory entries
> --- directory goes here ---
> -- each entry as follows --
> long type of chunk
> long offset
>
>
> Name: 'PBYT' - Parrot Bytecode
> Size: Varies
> Optional: Sure. :)
> Data:
> bytes of the bytecode
>
>
> Name: 'PSTR' - Parrot String Table
> Size: Varies
> Optional: Yes
> Data:
> long Count of string entries
> --- each string as follows ---
> long byte length
> n bytes + pad string data
>
>
> Name: 'PFIX' - Parrot Fixup Table
> Size: Varies
> Optional: Yes
> Data:
> --- beats me...how are we doing fixups? ---
>
>
> Name: 'PNOT' - Parrot Notes Block
> Size: Varies
> Optional: Yes
> Data:
> free-form text for 'notes' about the file.
>
>
>
>
> How's this?
>
A few more chunks:
Name: 'PCON' - Parrot Constants Block
Size: Varies
Optional: Yes
Data: the constants section (you know, all
those
intialized PMCs... :-)
Name: 'PSOU' - Parrot Source Block
Size: Varies
Optional: Yes
Data: the source code for the program
Name: 'PMOD' - Parrot Module list
Size: Varies
Optional: Yes
Data: the list of all the modules that need to
be loaded for this module to work (since
there may be a lot of time between
BEGIN{}
and execution, we need to record just
what
was loaded so we can reload and
initialize
it)
Name: 'PSYM' - Parrot symbol table
Size: Varies
Optional: Yes
Data: an offset-based hash table for every
symbol defined in the module (dynamic
symbol table manipulation is two-level -
an in-memory table that is queried first
for dynamic overrides and the static per-
module one for compile-time definitions)
Name: 'PSPS' Parrot Special Subroutines
Size: Varies
Optional: Yes
Data: word: number of special routines
(followed by a list of
word: type
word: bytecode offset
pairs) (the point of this is that
multiple
BEGIN/INIT/CHECK/END subs are allowed, so
they can't be simply stored in the symbol
table)
There are probably some other sections I can't think of,
but these are a start.
-- BKS
__________________________________________________
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/