Error reporter for tools.
Error reporter for tools. Currently used by both the shell and the compiler.
Inheritance: ErrorReporter
Esempio n. 1
0
		public Program()
		{
			reporter = new ToolErrorReporter(true);
			compilerEnv = new CompilerEnvirons();
			compilerEnv.SetErrorReporter(reporter);
			compiler = new ClassCompiler(compilerEnv);
		}
Esempio n. 2
0
		public virtual void SetReporter(ToolErrorReporter value)
		{
			R = value;
		}
Esempio n. 3
0
		private int Exec(string[] args)
		{
			R = new ToolErrorReporter(true, System.Console.Error);
			int arg_count = Process_options(args);
			if (arg_count == 0)
			{
				Option_error(ToolErrorReporter.GetMessage("msg.idswitch.no_file_argument"));
				return -1;
			}
			if (arg_count > 1)
			{
				Option_error(ToolErrorReporter.GetMessage("msg.idswitch.too_many_arguments"));
				return -1;
			}
			P = new CodePrinter();
			P.SetIndentStep(4);
			P.SetIndentTabSize(0);
			try
			{
				Process_file(args[0]);
			}
			catch (IOException ex)
			{
				Print_error(ToolErrorReporter.GetMessage("msg.idswitch.io_error", ex.ToString()));
				return -1;
			}
			catch (EvaluatorException)
			{
				return -1;
			}
			return 0;
		}