예제 #1
0
        public void ReversePostOrderAlgorithm1()
        {
            string phpCode = @"<?php
            $i = 0;

            if (true) {
            $x;
            } else if (true) {
            $y;
            } else {
            $sdf;
            }
            echo $x;";
            var cfg = PHPParseUtils.ParseAndIterate<CFGCreator>(phpCode, Config.PHPSettings.PHPParserPath).Graph;
            new CFGPruner().Prune(cfg);

            //cfg.VisualizeGraph("cfg", Config.GraphSettings);

            var postOrder = new ReversePostOrderAlgorithm(cfg).CalculateReversePostOrder();
        }
예제 #2
0
        public void ReversePostOrderAlgorithm1()
        {
            string phpCode = @"<?php 
$i = 0; 

if (true) {
$x;
} else if (true) {
$y;
} else {
$sdf;
}
echo $x;";
            var    cfg     = PHPParseUtils.ParseAndIterate <CFGCreator>(phpCode, Config.PHPSettings.PHPParserPath).Graph;

            new CFGPruner().Prune(cfg);

            //cfg.VisualizeGraph("cfg", Config.GraphSettings);

            var postOrder = new ReversePostOrderAlgorithm(cfg).CalculateReversePostOrder();
        }