- int i;
- bool parsing_options = true;
-
- encoding = Encoding.Default;
-
- references = new ArrayList ();
- external_aliases = new Hashtable ();
- soft_references = new ArrayList ();
- modules = new ArrayList ();
- link_paths = new ArrayList ();
-
- SetupDefaultDefines ();
-
- //
- // Setup defaults
- //
- // This is not required because Assembly.Load knows about this
- // path.
- //
-
- Hashtable response_file_list = null;
-
- for (i = 0; i < args.Length; i++){
- string arg = args [i];
- if (arg == "")
- continue;
-
- if (arg.StartsWith ("@")){
- string [] extra_args;
- string response_file = arg.Substring (1);
-
- if (response_file_list == null)
- response_file_list = new Hashtable ();
-
- if (response_file_list.Contains (response_file)){
- Report.Error (
- 1515, "Response file `" + response_file +
- "' specified multiple times");
- Environment.Exit (1);
- }
-
- response_file_list.Add (response_file, 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;
- } else {
- 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;
- }
- }
- }
- }
-
- CompileFiles (arg, false);
- }
-
- ProcessFiles ();
-
- if (tokenize)
- return true;
-
- //
- // This will point to the NamespaceEntry of the last file that was parsed, and may
- // not be meaningful when resolving classes from other files. So, reset it to prevent
- // silent bugs.
- //
- RootContext.Tree.Types.NamespaceEntry = null;
-
- //
- // 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;
- }
-