예제 #1
0
        public override int VisitCompileUnit(CASTCompileUnit node)
        {
            m_ostream.WriteLine("digraph {");

            ExtractSubgraphs(node, contextType.CT_COMPILEUNIT_EXPRESSIONS);

            base.VisitCompileUnit(node);

            m_ostream.WriteLine("}");
            m_ostream.Close();

            // Prepare the process to run
            ProcessStartInfo start = new ProcessStartInfo();

            // Enter in the command line arguments, everything you would enter after the executable name itself
            start.Arguments = "-Tgif " + m_dotName + " -o" + m_dotName + ".gif";
            // Enter the executable to run, including the complete path
            start.FileName = "dot";
            // Do you want to show a console window?
            start.WindowStyle    = ProcessWindowStyle.Hidden;
            start.CreateNoWindow = true;
            int exitCode;


            // Run the external process & wait for it to finish
            using (Process proc = Process.Start(start)) {
                proc.WaitForExit();

                // Retrieve the app's exit code
                exitCode = proc.ExitCode;
            }

            return(0);
        }
예제 #2
0
        public override int VisitCompileUnit(firstParser.CompileUnitContext context)
        {
            CASTCompileUnit newnode = new CASTCompileUnit(context.GetText(), nodeType.NT_COMPILEUNIT, null, 1);

            m_root = newnode;
            m_parents.Push(newnode);

            this.VisitElementsInContext(context.expr(), m_parentContext, contextType.CT_COMPILEUNIT_EXPRESSIONS);

            m_parents.Pop();
            return(0);
        }
 public virtual T VisitCompileUnit(CASTCompileUnit node)
 {
     VisitChildren(node);
     return(default(T));
 }