Exemple #1
0
 /// <summary>
 /// Using the phalanger parser generates ControlFlowGraph for a given file.
 /// </summary>
 /// <param name="fileName">Name of the file with php source.</param>
 /// <returns></returns>
 static Weverca.ControlFlowGraph.ControlFlowGraph GenerateCFG(string fileName)
 {
     try
     {
         var file = new FileInfo(fileName);
         return(ControlFlowGraph.FromFile(file));
     }
     catch (Weverca.ControlFlowGraph.ControlFlowException e)
     {
         Console.WriteLine(e.Message);
     }
     catch (ArgumentException e)
     {
         Console.WriteLine(e.Message);
     }
     return(null);
 }