Пример #1
0
 /// <summary>
 /// Extracts the outcome of one of the steps of the Thompson algorithm to a file
 /// </summary>
 public void ExctractThompsonStep(FA NFA, string filename, object key, bool overrideEnableLoggingSwitch = false)
 {
     if (mb_enableLogging || overrideEnableLoggingSwitch)
     {
         ThompsonGraphVizPrinter gp =
             new ThompsonGraphVizPrinter(NFA, new UOPCore.Options <ThompsonOptions>(), key);
         NFA.RegisterGraphPrinter(gp);
         NFA.Generate(filename, true);
     }
 }
Пример #2
0
        /// <summary>
        /// Add an intermediate NFA to the list of NFA produced during the
        /// execution of the algorithm
        /// </summary>
        /// <param name="NFA"></param>
        /// <param name="infokey"></param>
        /// <param name="generateReport"></param>
        public void AddThompsonStepToReporting(FA NFA, object infokey, bool generateReport = false)
        {
            ThompsonGraphVizPrinter gp1 = new ThompsonGraphVizPrinter(NFA, new UOPCore.Options <ThompsonOptions>(ThompsonOptions.TO_COMBINEGRAPHS), infokey);

            m_ThomsonStepsPrinter.Add(gp1);
            if (generateReport)
            {
                m_ThomsonStepsPrinter.Generate();
            }
        }
Пример #3
0
        public ThompsonReporting(UOPCore.Options <ThompsonOptions> options)
        {
            m_options = options;

            // Initialize m_ThomsonStepsPrinter field
            m_ThomsonStepsPrinter                       = new ThomsonMultiGraphGraphVizPrinter("ThompsonSteps.dot");
            m_ThomsonStepsPrinter.e_prelude            += new Func <object, string>(p => "digraph Total { ");
            m_ThomsonStepsPrinter.e_epilogue           += new Func <object, string>(p => "} ");
            m_ThomsonStepsPrinter.e_intermediate_after += new Func <object, string>(p => {
                ThompsonGraphVizPrinter pp = p as ThompsonGraphVizPrinter;
                return("//" + pp.M_Graph.M_Label);
            });
        }