|C++ symbol table email@example.com (Joydip Dass) (1993-02-19)|
|Re: C++ symbol table firstname.lastname@example.org (1993-02-19)|
|Re: C++ symbol table chased@rbbb.Eng.Sun.COM (1993-02-19)|
|Re: C++ symbol table email@example.com (1993-02-21)|
|Re: C++ symbol table firstname.lastname@example.org (1993-02-23)|
|From:||Joydip Dass <email@example.com>|
|Keywords:||C++, parse, question, comment|
|Date:||Fri, 19 Feb 1993 02:05:54 GMT|
I am currently trying to do some work on parsing some C++ code. I am new
at this stuff so pardon my ignorance....
I have got hold of Jim Roskind`s C++ grammar. I have also modified his
Flex input file to suit my purposes. However, as he points out in his
documentation, the lexer he supplied does not include a SYMBOL TABLE and
does NOT KEEP TRACK OF CURRENT SCOPES. I am in need of these
My objectives are -
- To keep a list of all identifiers in the C++ code being parsed.
(Identifiers include - variables, #defines, and function names etc.)
- I want to be able to identify these things separately i.e. distinguish a
function name from a variable. I also want to be able to tell different
types of variables apart e.g. a pointer declaration from a non-pointer
variable OR an int declaration from a register declaration.
- I would like to store these in some sort of a hash table to do the
fastest possible searches.
This sounds a bit vague at the moment, but if I can achieve these
particular objectives I will be better equipped to plan future directions.
I have read the bit on symbol tables in "lex & yacc" by Levine, Mason and
Brown. It was most helpful in understanding the basic concepts of symbol
tabels etc. However, if anyone out there has already worked on this
problem I would like to get hold of it. I think what I am trying to do is
more complex than the examples in the book and any help would save me a
lot of time.
Many Thanks in advance to anyone who can help me.
[Maybe you could extract what you need from g++. -John]
Return to the
Search the comp.compilers archives again.