public static CompilerArguments BuildFrom(IEnumerable<string> args)
 {
     var ret = new CompilerArgumentsInternal();
     var pieces = new Queue<string>(args);
     while(pieces.Count > 0)
     {
         var current = pieces.Dequeue() ?? "";
         var lower = current.ToLower();
         if(lower.StartsWith(REFERENCEARG))
         {
             ret.AddReference(GetPossiblyQuotedString(current, pieces, REFERENCEARG));
         }
         else if (lower.StartsWith(RESOURCEARG))
         {
             ret.AddResource(GetPossiblyQuotedString(current, pieces, RESOURCEARG));
         }
         else if (lower.StartsWith(DEFINEARG))
         {
             ret.AddDefine(GetPossiblyQuotedString(current, pieces, DEFINEARG));
         }
         else if (lower.StartsWith(OUTPUTARG))
         {
             ret.Output = GetPossiblyQuotedString(current, pieces, OUTPUTARG);
         }
         else if (lower.StartsWith(PDBARG))
         {
             ret.PdbOutput = GetPossiblyQuotedString(current, pieces, PDBARG);
         }
         else if (lower.StartsWith(ALIGNARG))
         {
             int align = 0;
             if(!int.TryParse(GetPossiblyQuotedString(current, pieces, ALIGNARG), out align))
             {
                 ret.AddError(new ParsingError("Alignment must be a numeric value"));
             }
             ret.Alignment = align;
         }
         else if (lower.StartsWith(TARGETARG))
         {
             ret.Target = GetPossiblyQuotedString(current, pieces, TARGETARG);
         }
         else if (lower.StartsWith(WIN32ICONARG))
         {
             ret.Win32Icon = GetPossiblyQuotedString(current, pieces, WIN32ICONARG);
         }
         else if (lower.StartsWith(WIN32RESOURCEARG))
         {
             ret.Win32Resource = GetPossiblyQuotedString(current, pieces, WIN32RESOURCEARG);
         }
         else
         {
             ret.AddFile(GetPossiblyQuotedString(current, pieces, NOARG));
         }
     }
     return ret.ToCompilerArguments();
 }
 public static CompilerArguments BuildFrom(IEnumerable<string> args)
 {
     var ret = new CompilerArgumentsInternal();
     var pieces = new Queue<string>(args);
     while(pieces.Count > 0)
     {
         var current = pieces.Dequeue() ?? "";
         var lower = current.ToLower();
         if(lower.StartsWith(REFERENCEARG) || lower.StartsWith(REFERENCEARGSHORT))
         {
             ret.AddReference(GetPossiblyQuotedString(current, pieces));
         }
         else if (lower.StartsWith(RESOURCEARG) || lower.StartsWith(RESOURCEARGSHORT))
         {
             ret.AddResource(GetPossiblyQuotedString(current, pieces));
         }
         else if (lower.StartsWith(DEFINEARG) || lower.StartsWith(DEFINEARGSHORT))
         {
             ret.AddDefine(GetPossiblyQuotedString(current, pieces));
         }
         else if (lower.StartsWith(OUTPUTARG))
         {
             ret.Output = GetPossiblyQuotedString(current, pieces);
         }
         else if (lower.StartsWith(PDBARG))
         {
             ret.PdbOutput = GetPossiblyQuotedString(current, pieces);
         }
         else if (lower.StartsWith(ALIGNARG))
         {
             int align = 0;
             if(!int.TryParse(GetPossiblyQuotedString(current, pieces), out align))
             {
                 ret.AddError(new ParsingError("Alignment must be a numeric value"));
             }
             ret.Alignment = align;
         }
         else if (lower.StartsWith(WARNLEVELARG))
         {
             int level = 0;
             if(!int.TryParse(GetPossiblyQuotedString(current, pieces), out level))
             {
                 ret.AddError(new ParsingError("Warning Level must be a numeric value"));
             }
             ret.WarningLevel = level;
         }
         else if (lower.StartsWith(TARGETARG))
         {
             ret.Target = GetPossiblyQuotedString(current, pieces);
         }
         else if (lower.StartsWith(WIN32ICONARG))
         {
             ret.Win32Icon = GetPossiblyQuotedString(current, pieces);
         }
         else if (lower.StartsWith(WIN32RESOURCEARG))
         {
             ret.Win32Resource = GetPossiblyQuotedString(current, pieces);
         }
         else if (lower.StartsWith(MAINARG))
         {
             ret.Main = GetPossiblyQuotedString(current, pieces);
         }
         else if (lower.StartsWith(PLATFORMARG))
         {
             ret.Platform = GetPossiblyQuotedString(current, pieces);
         }
         else if(lower.StartsWith(OPTIMIZEARG))
         {
             ret.Optimize = lower.Contains("+") || lower.Equals(OPTIMIZEARG);
         }
         else if (lower.StartsWith(CHECKEDARG))
         {
             ret.IsChecked = lower.Contains("+") || lower.Equals(CHECKEDARG);
         }
         else if (lower.StartsWith(NOWARNARG))
         {
             ret.AddWarningFilter(GetPossiblyQuotedString(current, pieces).Split(',', ';'));
         }
         else if (lower.StartsWith(NOSTDLIBARG))
         {
             ret.NoStdLib = lower.Contains("+") || lower.Equals(NOSTDLIBARG);
         }
         else if (lower.StartsWith(NOCONFIGARG))
         {
             ret.NoConfig = true;
         }
         else if (lower.StartsWith(DEBUGARG))
         {
             if (lower.Contains("+") || lower.Equals(DEBUGARG))
             {
                 ret.DebugLevel = "FULL";
             }
             else if (lower.Equals(DEBUGARG + "-"))
             {
                 ret.DebugLevel = "NONE";
             } else if(lower.Contains(":"))
             {
                 ret.DebugLevel = GetPossiblyQuotedString(current, pieces).ToUpper();
             }
         }
         else
         {
             ret.AddFile(GetPossiblyQuotedString(current, pieces));
         }
     }
     return ret.ToCompilerArguments();
 }