From: Mark Probert Date: 2003-05-07T04:51:12+09:00 Subject: Re: Parsing C++ with Ruby Hi, Simon. Simon Vandemoortele did say ... > > It seems to me the easiest way to attain my goal is to generate a dot > file and have www.graphviz.org do the rest. > I know nothing about GraphViz, just looked at the site. It would seem that there is a "companion" system, DOxygen http://www.stack.nl/~dimitri/doxygen/index.html that seems to parse C++ and produce output for GraphViz. Have you tried it out? > > ... parsing C++ (yuck!).How do I go about doing that ? > Yuk indeed. You are only going to look for certain patterns in the C++ code, right? That is not so bad with a suitable parser/lexer combination. You will have to write a grammar that can handle the concepts you want to extract. I can suggest the LL(1) Ruby scanner/generator that I have written called CocoRb. http://raa.ruby-lang.org/list.rhtml?name=coco-rb You won't be able to parse the complete C++ tree, though you should be able to extract wht you want. And it is pretty easy to use. There are some sample of scanning C code and processing it that may be of interest. Regards, -- -mark. ---------------------------------------------------- Mark Probert probertm@NOSPAM_nortelnetworks.com Nortel Networks ph. (613) 768-1082 ---------------------------------------------------- All opinions expressed are my own and do not reflect in any way those of Nortel Networks.