Пример #1
0
        public static void RunWithCommandLineArguments(string[] args)
        {
            FSM2DotCmdLineParams cmd = new FSM2DotCmdLineParams();

            try
            {
                if (!Parser.ParseArgumentsWithUsage(args, cmd))
                {
                    return;
                }
                StreamReader  fsm = new StreamReader(cmd.fsmFileName);
                StringBuilder dot = FSM2Dot(cmd.fsmName, fsm.ReadToEnd());
                fsm.Close();
                if (cmd.dotFileName == null)
                {
                    cmd.dotFileName = cmd.fsmFileName + ".dot";
                }
                StreamWriter dotStream = new StreamWriter(cmd.dotFileName);
                dotStream.Write(dot.ToString());
                dotStream.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine("Invocation of 'FSM2Dot' failed: " + e.ToString());
            }
        }
Пример #2
0
 public static void RunWithCommandLineArguments(string[] args)
 {
     FSM2DotCmdLineParams cmd = new FSM2DotCmdLineParams();
     try
     {
         if (!Parser.ParseArgumentsWithUsage(args, cmd))
             return;
         StreamReader fsm = new StreamReader(cmd.fsmFileName);
         StringBuilder dot = FSM2Dot(cmd.fsmName, fsm.ReadToEnd());
         fsm.Close();
         if (cmd.dotFileName == null)
             cmd.dotFileName = cmd.fsmFileName + ".dot";
         StreamWriter dotStream = new StreamWriter(cmd.dotFileName);
         dotStream.Write(dot.ToString());
         dotStream.Close();
     }
     catch (Exception e)
     {
         Console.WriteLine("Invocation of 'FSM2Dot' failed: " + e.ToString());
     }
 }