Modifying the Control Flow Graph

The Control Flow graph can be customized using the Perl API.  Start by making a copy of the file scitools\conf\plugin\SciTools\Graph\flowchart.upl – make the copy in the scitools\conf\plugin\users\Graph directory so it doesn’t get overridden by the next upgrade.

That logical control flow structure is obtained by calling $entity->freetext(“CGraph”). That command returns a series of numbers representing the different nodes of the graph. Each node is delimited by a semicolon and the series of numbers inside of those semicolons describe the node. These numbers can be seen in the regular graph by right clicking on an empty area and enabling debug. Note that some of the nodes are hidden by default so disable the filter option to see them.

The numbers can be interpreted as follows: The first number is the node ID. The second line contains the serialized representation of the node: The Node Kind(see the array @names for a list of all of the kinds), Start Line, Start Column, End Line, End Column. The sixth number, if non-empty, is the End Structure Node. All remaining numbers are the successors (or children) of the node.

 

Normal Graph

Normal graph

Same nodes with debug options and unfiltered

Same graph with debug options and unfiltered