+ bool ParseArguments (string[] args)
+ {
+ references = new ArrayList ();
+ external_aliases = new Hashtable ();
+ soft_references = new ArrayList ();
+ modules = new ArrayList (2);
+ link_paths = new ArrayList ();
+
+ ArrayList response_file_list = null;
+ bool parsing_options = true;
+
+ for (int i = 0; i < args.Length; i++) {
+ string arg = args [i];
+ if (arg.Length == 0)
+ continue;
+
+ if (arg.StartsWith ("@")) {
+ string [] extra_args;
+ string response_file = arg.Substring (1);
+
+ if (response_file_list == null)
+ response_file_list = new ArrayList ();
+
+ if (response_file_list.Contains (response_file)) {
+ Report.Error (
+ 1515, "Response file `" + response_file +
+ "' specified multiple times");
+ return false;
+ }
+
+ response_file_list.Add (response_file);
+
+ extra_args = LoadArgs (response_file);
+ if (extra_args == null) {
+ Report.Error (2011, "Unable to open response file: " +
+ response_file);
+ return false;
+ }
+
+ args = AddArgs (args, extra_args);
+ continue;
+ }
+
+ if (parsing_options) {
+ if (arg == "--") {
+ parsing_options = false;
+ continue;
+ }
+
+ if (arg.StartsWith ("-")) {
+ if (UnixParseOption (arg, ref args, ref i))
+ continue;
+
+ // Try a -CSCOPTION
+ string csc_opt = "/" + arg.Substring (1);
+ if (CSCParseOption (csc_opt, ref args, ref i))
+ continue;
+
+ Error_WrongOption (arg);
+ return false;
+ }
+ if (arg [0] == '/') {
+ if (CSCParseOption (arg, ref args, ref i))
+ continue;
+
+ // Need to skip `/home/test.cs' however /test.cs is considered as error
+ if (arg.Length < 2 || arg.IndexOf ('/', 2) == -1) {
+ Error_WrongOption (arg);
+ return false;
+ }
+ }
+ }
+
+ ProcessSourceFiles (arg, false);
+ }
+
+ //
+ // If we are an exe, require a source file for the entry point
+ //
+ if (RootContext.Target == Target.Exe || RootContext.Target == Target.WinExe || RootContext.Target == Target.Module) {
+ if (first_source == null) {
+ Report.Error (2008, "No files to compile were specified");
+ return false;
+ }
+
+ }
+
+ //
+ // If there is nothing to put in the assembly, and we are not a library
+ //
+ if (first_source == null && embedded_resources == null) {
+ Report.Error (2008, "No files to compile were specified");
+ return false;
+ }
+
+ return true;
+ }
+
+ public void Parse ()