private static string ToString(Block[] blockList, Node[] statementNodes) { return null; StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); pw.WriteLine(blockList.Length + " Blocks"); for (int i = 0; i < blockList.Length; i++) { Block b = blockList[i]; pw.WriteLine("#" + b.itsBlockID); pw.WriteLine("from " + b.itsStartNodeIndex + " " + statementNodes[b.itsStartNodeIndex].ToString()); pw.WriteLine("thru " + b.itsEndNodeIndex + " " + statementNodes[b.itsEndNodeIndex].ToString()); pw.Write("Predecessors "); if (b.itsPredecessors != null) { for (int j = 0; j < b.itsPredecessors.Length; j++) { pw.Write(b.itsPredecessors[j].itsBlockID + " "); } pw.WriteLine(); } else { pw.WriteLine("none"); } pw.Write("Successors "); if (b.itsSuccessors != null) { for (int j = 0; j < b.itsSuccessors.Length; j++) { pw.Write(b.itsSuccessors[j].itsBlockID + " "); } pw.WriteLine(); } else { pw.WriteLine("none"); } } return sw.ToString(); }
public static void ReportWarning(string message, Exception t) { int[] linep = new int[] { 0 }; string filename = GetSourcePositionFromStack(linep); TextWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); pw.WriteLine(message); Sharpen.Runtime.PrintStackTrace(t, pw); pw.Flush(); Rhino.Context.ReportWarning(sw.ToString(), filename, linep[0], null, 0); }