|Parsing C++ Declarations firstname.lastname@example.org (HalfWayMan) (2005-03-18)|
|Re: Parsing C++ Declarations Brian.Inglis@SystematicSW.ab.ca (Brian Inglis) (2005-03-20)|
|Re: Parsing C++ Declarations email@example.com (DrDiettrich) (2005-03-20)|
|From:||Brian Inglis <Brian.Inglis@SystematicSW.ab.ca>|
|Date:||20 Mar 2005 10:15:02 -0500|
|Posted-Date:||20 Mar 2005 10:15:02 EST|
On 18 Mar 2005 00:47:53 -0500 in comp.compilers, "HalfWayMan"
>I have been writing compilers for some time now, but one thing that
>always seems to bug me is parsing of C and C++ declarations. Perhaps
>it's not the parsing that I have the problem with, more the
>representation of the declaration afterwards. In a current project I
>am representing declarations as a list of either specifiers or
>declarators. However, this leads to problems and holes in type
>comparisons and conversion. I was wondering if any of you knew of an
>elegent way of representing this information.
>Perhaps I'm doing it all wrong. It would be a shame.
Studying an implementation of cdecl and c++decl, which enumerates all
the parts, but does not define all the properties, may help:
don't forget about such things as incomplete types and tentative
definitions. Some scanning of comp.std.c for thread topics about
definitions and declarations may also help. And you could look at the
GCC front ends for C and C++.
Thanks. Take care, Brian Inglis Calgary, Alberta, Canada
fake address use address above to reply
Return to the
Search the comp.compilers archives again.