public void Run(string[] args)
        {
            CommandLine commandLine = new CommandLine();
            commandLine.AddOption("Verbose", false, "-verbose");

            commandLine.Parse(args);

            if ((bool)commandLine.GetOption("-h"))
            {
                commandLine.Help("Katahdin Interpreter");
                return;
            }

            Runtime runtime = new Runtime(true, false, false, false,
                (bool)commandLine.GetOption("-verbose"));

            //new ConsoleParseTrace(runtime);

            runtime.SetUp(commandLine.Args);

            if (!((bool)commandLine.GetOption("-nostd")))
                runtime.ImportStandard();

            foreach (string file in commandLine.Files)
                runtime.Import(file);
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            try
            {
                CommandLine commandLine = new CommandLine();
                commandLine.AddOption("Verbose", false, "-verbose");
                
                commandLine.Parse(args);
            
                if ((bool) commandLine.GetOption("-h"))
                {
                    commandLine.Help("Katahdin Interpreter");
                    return;
                }
                
                Runtime runtime = new Runtime(true, false, false, false,
                    (bool) commandLine.GetOption("-verbose"));
                
                //new ConsoleParseTrace(runtime);
                
                runtime.SetUp(commandLine.Args);
                
                if (!((bool) commandLine.GetOption("-nostd")))
                    runtime.ImportStandard();
                
                foreach (string file in commandLine.Files)
                    runtime.Import(file);
            }
            catch (Exception e)
            {
                /*while (true)
                {
                    TargetInvocationException wrapper
                        = e as TargetInvocationException;

                    if (wrapper == null)
                        break;

                    e = wrapper.InnerException;
                }*/
                
                Console.Error.WriteLine(e);
            }
        }
 public NewSessionDialog(Window parent, CommandLine commandLine)
     : base("New Katahdin Debugger Session", parent, DialogFlags.Modal
         | DialogFlags.DestroyWithParent)
 {
     WindowPosition = WindowPosition.CenterOnParent;
     
     AddActionWidget(new Button(Stock.Cancel), ResponseType.Cancel);
     AddActionWidget(new Button(Stock.Ok), ResponseType.Ok);
     
     VBox v = new VBox();
     v.BorderWidth = 5;
     VBox.PackStart(v, true, true, 0);
     
     ScrolledWindow fileScroller = new ScrolledWindow();
     fileScroller.BorderWidth = 5;
     fileScroller.ShadowType = ShadowType.In;
     v.PackStart(fileScroller, true, true, 0);
     
     fileStore = new ListStore(typeof(string));
     
     TreeView fileView = new TreeView(fileStore);
     fileView.AppendColumn("Input files", new CellRendererText(), "text", 0);
     fileScroller.Add(fileView);
     
     foreach (string file in commandLine.Files)
         fileStore.AppendValues(file);
     
     importStandard = new CheckButton("Import standard library");
     v.PackStart(importStandard, false, true, 0);
     
     importStandard.Active = ! (bool) commandLine.GetOption("-nostd");
     
     compileParser = new CheckButton("Compile parser");
     compileParser.Active = true;
     v.PackStart(compileParser, false, true, 0);
     
     debugGrammar = new CheckButton("Debug grammar");
     v.PackStart(debugGrammar, false, true, 0);
     
     debugParser = new CheckButton("Debug parser");
     v.PackStart(debugParser, false, true, 0);
     
     debugParseTrees = new CheckButton("Debug parse trees");
     v.PackStart(debugParseTrees, false, true, 0);
     
     ShowAll();
 }
Exemple #4
0
        public static void Main(string[] args)
		{
            CommandLine commandLine = new CommandLine();
            commandLine.Parse(args);
            
            if ((bool) commandLine.GetOption("-h"))
            {
                commandLine.Help("Katahdin Graphical Debugger");
                return;
            }
            
	        Application.Init();
			
			MainWindow mainWindow = new MainWindow();
			mainWindow.ShowAll();
			
			if (mainWindow.NewSession(commandLine))
			    Application.Run();
			
			mainWindow.Destroy();
		}