From: Grzegorz J. <ja...@ac...> - 2004-07-21 23:45:51
|
Hi all, Shigeru Chiba wrote: [...] > > Yes, parsing C++ code should not need backward references with respect to > types. AFAIK with this exception: struct A { void f(B); typedef B int; }; > So now I must say that I cannot remember why I chose the approach > currently used in OpenC++. However, there should be some examples in > which the lexical analyzer must help the parser to record all the > declared type names etc. Thus, as far as I remember, the code of the > lexical analyzer of gcc 2.x(?) was quite tangled with the code of the > parser. I didn't like to make the OpenC++ code tangled. Hope this info > helps you guys. I think the parser needs to maintain the type name > table for completely supporting templates. I think we can keep the OpenC++ parser clean with this design: <<iface>> +--------+ +--------------+ | Parser |---->| TypeResolver | +--------+ +--------------+ Where TypeResolver instance provides all the functionality requiring maintaining the type name table. Perhaps ClassWalker or Environment can be made an implementation of TypeResolver. That way code would stay not tangled (i.e. Parser still does not implement type name table, nor does it depend on concrete classes from the next layers, like Environment or ClassWalker). Best regards Grzegorz > > Chiba > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users |