[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Data structure documentation & BUG?
> Date: Fri, 9 Feb 96 14:19:32 EST
> From: Mike Griebling <grieblm@trt.allied.com>
>
> I've been trying to find documentation on the ooc data structures. Most useful
> would be a summary of how they differ from the o2c data structures showing new
> field mappings to the old data structures. In my case, I'm moving a code
> generator from o2c and porting it to ooc. Lots of fields seem to be different
> and changed or are missing. A comparison document would clear up a lot of
> these problems.
The encoding of statements isn't comparable at all (abstract syntax
tree vs GSA). This leaves only the elements of the symbol table
(Const, Struct, Object) to draw any comparison. While I took the
general layout of these data types from o2c, I simplified some aspects
(eg holding declarations of proc/module in a binary tree, and
fields/tb-procs of records in a simple list), and added additional
fields (like splitting mnolev into moduleId/level, taking the receiver
out of the formal parameter list). I don't think that I can put
together a document that answers questions like "If you did this in
o2c, then you must to this in OOC", without generalising improperly
(and erroneously). But if you come with concrete questions, like "How
do I get the global variables of a module?", I will be more than happy
to answer them in detail (and put together a Q&A document).
> That example ANSI-C generator would do a lot of good in filling in the documentation
> gaps. I'm beginning to understand as well what you've been saying that GSA is
> drastically different from o2c's interface to the back-end. :-( "What do you
> mean there are no variables?"
It will take some time before I can even begin with the ANSI-C
back-end. And it won't help with tricky stuff like register/storage
allocation. Live without variables is tough, isn't it? ;-)
> If I were to add information to the GSA tree, such as register allocations, etc.
> how should that be done? What happens to references to external memory (such
> as arrays, records, etc)?
I can add nothing beyond Guy's reply.
> BUG? I tried compiling the Matrix.Mod example program and got a bus error exception
> in PrintGSA.Argument. Anyone else have this occur? Note: I was compiling with
> the --gsa -s flags.
Sigh. This was one of the perfectly simple changes that backfires
horribly. The fixed release is on cognac.
-- Michael