From: Simon Vandemoortele Date: 2003-04-26T03:01:58+09:00 Subject: Parsing C++ with Ruby _Context:_ My company uses a Directed Acyclic Graphs implementation of the Observer/Notifier pattern. I would love to see automatic generation of diagrams representing those relationships. _Challenge:_ 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 imagine the dot-file would have to be generated by parsing C++ (yuck!). How do I go about doing that ? Do I simply parse the code looking for a multi-line patterns ? (See example below.) Or do I use existent parsers to generate a full-blown semantic tree ? (And then what ?) Looking forward to your experiences/ideas, Simon _Sample code:_ The code I want to transform in dot edges looks like: .... singleDirection ( componentA->port("out"), componentB->port("input") ); doubleDirection ( componentB->port("setting1"), componentD->port("setting1")); .... -- There are 10 types of people in the world... those who understand binary and those who don't.