Building a C++-translator

stal@ztivax.zfe.siemens.de (Michael Stal)
Fri, 20 Mar 1992 13:22:40 GMT

          From comp.compilers

Related articles
Building a C++-translator stal@ztivax.zfe.siemens.de (1992-03-20)
| List of all articles for this month |

Newsgroups: comp.compilers,comp.lang.c++
From: stal@ztivax.zfe.siemens.de (Michael Stal)
Keywords: C++, question, tools
Organization: Siemens AG, Munich, W-Germany
Date: Fri, 20 Mar 1992 13:22:40 GMT

I am designing a program which should read C++ source files, extract
information such as the class hierarchy, data members and so on.


Originally, I considered using YACC and LEX together with the Roskind C++
grammar to parse the C++ source code. I understand, however, that there
are some difficulties in using this approach, in particular in regard to
the context-sensitiveness of the C++ grammar. I would appreciate it if
someone can give me more explicit reasons why not to use this approach.


Furthermore, what are the other alternatives? For example, one approach
would be to make changes to cfront. But I have heard that the code for
cfront is quite difficult to understand/modify (any confirmations?). A
further disadvantage of this approach is that when a new version of cfront
comes out, then perhaps major changes would have to be made in our code.


I think that using/modifying G++ is not feasible because of copyright
restrictions.


Is there a good alternative? An existing system which allows one to read
the C++ code and extract the necessary information quickly and easily, yet
still easily accomodate future changes in the language?


Thanks very much in advance.


If the response is sufficiently large, I will summarize results to the net.


Michael Stal (stal@ztivax.siemens.com)
[So long as you're not trying to make a salable binary-only product, there
is no copyright reason to avoid G++. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.