On Fri, 2 Mar 2001, Maurice Lombardi wrote:
HelloWorld. Seems to need a major rewriting in gpc.
I think it can be added without much effort. One possibility is to set the root node to the unit or program name, then create a seperate symbol table for each. When it's necessary to create jump targets/etc, just combine the unit name with the identifier.
For example...
unit Foo;
interface
var FooInt : Integer;
procedure CallFoo;
implementation
{...}
end.
program Bar;
uses Foo;
procedure CallFoo; {...}
begin {...} end.
One Symbol Table would have a name of "Foo" with symbol nodes "FooInt" and "CallFoo". If referenced, they would be referred to as "Foo_FooInt" and "Foo_CallFoo". The other Symbol Table would have a name of "Bar" with a symbol node of "CallFoo". If referenced, it would be called "Bar_CallFoo".
Obviously this leaves out things such as scope, as well as a thing or two I haven't thought of, but hopefully it gives you an idea of how it can be implemented.
See ya! Orlando Llanes
"Meine Damen und Herren, Elvis hat soeben das Gebaeude verlassen!"
"Look out fo' flyeeng feet" O__/ ollanes@pobox.com /|____. O <__. /> / \ ____________|_________ http://pages.prodigy.net/ollanes/ (inactive)