コード例 #1
0
ファイル: CFGViewerApp.cs プロジェクト: eknowledger/mcfromc
        private bool ReadFlowPoints(string filename, Guid id)
        {
            bool      rc = true;
            ArrayList arr = null;
            ArrayList mcNames, mcGraphTexts;

            FlowPoint = new Dictionary <string, VisualFlowPoint>();
            string graphText;
            string mcText;

            arr = CFGParser.GenerateCFG(filename, out graphText, out mcNames, out mcGraphTexts, out mcText);

            string err = CFGParser.GetLastError();

            if (arr != null && err == "")
            {
                foreach (VisualFlowPoint fp in arr)
                {
                    FlowPoint[fp.Name] = fp;
                }
            }
            else
            {
                rc = false;
            }


            if (rc && graphText != null)
            {
                OnMessage("Writing graph to file");
                WriteGraphToFile(DIGRAPH_FILE, graphText);
                rc = RunDot(id);
            }

            if (rc)
            {
                OnMessage("Writing MC graphs to file");
                for (int i = 0; i < mcNames.Count; ++i)
                {
                    WriteGraphToFile(DIGRAPH_FILE + ".MC_" + (mcNames[i] as string), mcGraphTexts[i] as string);
                }

                OnMCTextUpdated(mcText);
            }

            return(rc);
        }