Well, that didn’t take long.
Vertices in the code flow graph are now grouped according to these rules:
- Only consecutive instructions may be grouped.
- If there is a jump, it must be the last instruction in the group.
- If there is a jump to an instruction, that instruction must be the first instruction in the group.
- Once the stack becomes balanced, the group ends with the instruction that balanced the stack.
Here are the scripts from the last post, but now with grouping:
And finally, as an example of a really big graph:
This concludes the third milestone. The next step is to analyze the graph to detect loops and conditionals.