[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]cscc symbol table and random question

From: Gopal V
Subject: Re: [DotGNU]cscc symbol table and random question
Date: Fri, 7 Feb 2003 23:20:45 +0530
User-agent: Mutt/1.2.5i

If memory serves me right, CH Gowri Kumar wrote:
> I wanted to use the symbol table and corresponding interface functions of
> the symbol table but could n't figure out where they are available.

Would that be the scope thingy ? ... ILScopeLookup ?

CSCC uses a RedBlack tree for the "symbol table" .. codegen/cg_rbtree.c
should be the place to improve lookups :) .. B-Trees anyone ? ;-)

Anyway the ILScope* functions handle the scoping and lookup for CSCC.

See the ILNode_SemAnalysis(ILNode_Identifier) for a look at using ILScope.

> Can anyone point me the exact source?

The cs_gather.c is the Type Gathering phase when the parsed tree is 
gathered and the various types collected, members constructed and 
AddMemberToScope liberally used :).

> Why use C instead of C++?

The conflict between inheritance vs visitors design of the compiler
has effectively reached a truce with TreeCC . We don't need OO :)

And more often than not , it's just a matter of which language you're
comfortable with.

> At many a places i find that C++ features are being simulated using C.

TreeCC ? . TreeCC has better features than C++ for building compilers.
Yes, TreeCC can output C++ , but IMHO I like the current setup better.
It's relatively straightforward to debug with gdb , it's fast enough,
builds on lotsa platforms ...

> Better design might overcome the running time....

C++ -- Design for 80% of time , Implement in 20% :)
C   -- Build for 80% of time , Clean up for the rest :)

The difference between insanity and genius is measured by success

reply via email to

[Prev in Thread] Current Thread [Next in Thread]