From: Stefan S. <se...@sy...> - 2005-05-25 12:41:00
|
zhaoqinglan wrote: > Hello! > Thank you for your time ! > I have studied your Open C++ for a long time ,and is surprised by its > powerful function.It is so recondite that I have some difficulties in > using it. > I want to use it to get the control-flow graph of the program . Usually > the control-flow graph can be got by analyzing the abstract syntax > tree(AST).Is it feasible to get it through analyzing the parse tree in > Open C++? You may want to look at the Walker class to see how to traverse the parse tree. You should write your own Walker subclass and reimplement those methods you are interested in (i.e. for PTreeIfStatement, PTreeSwitchStatement, etc.) to generate a control graph from the parse tree. Regards, Stefan |