2 // CompilerOptions.cs: The compiler command line options processor.
4 // Author: Rafael Teixeira (rafaelteixeirabr@hotmail.com)
5 // Based on mcs by : Miguel de Icaza (miguel@gnu.org)
7 // Licensed under the terms of the GNU GPL
9 // (C) 2002, 2003, 2004 Rafael Teixeira
12 namespace Mono.MonoBASIC {
15 using System.Collections;
16 using System.Reflection;
17 using System.Reflection.Emit;
20 using Mono.GetOptions;
21 using Mono.GetOptions.Useful;
23 public enum OptionCompare {
28 /// The compiler command line options processor.
30 public class CompilerOptions : CommonCompilerOptions {
32 public override string [] AssembliesToReferenceSoftly {
35 // For now the "default config" is hardcoded into the compiler
36 // we can move this outside later
38 return new string [] {
42 "Microsoft.VisualBasic"
43 #if EXTRA_DEFAULT_REFS
45 // Is it worth pre-loading all this stuff?
49 "System.Configuration.Install",
51 "System.DirectoryServices",
52 "System.Drawing.Design",
54 "System.EnterpriseServices",
57 "System.Runtime.Remoting",
58 "System.Runtime.Serialization.Formatters.Soap",
60 "System.ServiceProcess",
62 "System.Web.RegularExpressions",
63 "System.Web.Services" ,
64 "System.Windows.Forms"
70 public CompilerOptions(string [] args, ErrorReporter ReportError) : base(args, ReportError) {}
72 protected override void InitializeOtherDefaults()
74 DefineSymbol = "__MonoBASIC__";
75 ImportNamespaces = "Microsoft.VisualBasic";
78 // TODO: remove next lines when the compler has matured enough
79 public override string AdditionalBannerInfo { get { return "--------\nTHIS IS AN ALPHA SOFTWARE.\n--------"; } }
82 //------------------------------------------------------------------
83 [Option("[IGNORED] Only parses the source file (for debugging the tokenizer)", "parse", SecondLevelHelp = true)]
84 public bool OnlyParse = false;
86 [Option("[IGNORED] Only tokenizes source files", "tokenize", SecondLevelHelp = true)]
87 public bool Tokenize = false;
89 [Option("Shows stack trace at Error location", "stacktrace", SecondLevelHelp = true)]
90 public bool Stacktrace = false;
92 [Option("Makes errors fatal", "fatal", SecondLevelHelp = true)]
93 public bool MakeErrorsFatal = false;
95 // redefining some inherited options
96 //------------------------------------------------------------------
97 [Option("About the MonoBASIC compiler", "about")]
98 public override WhatToDoNext DoAbout() { return base.DoAbout(); }
101 public override WhatToDoNext DoUsage() { return WhatToDoNext.GoAhead; }
104 //------------------------------------------------------------------
106 [Option("Require explicit declaration of variables", "optionexplicit", VBCStyleBoolean = true)]
107 public bool OptionExplicit = false;
109 [Option("Enforce strict language semantics", "optionstrict", VBCStyleBoolean = true)]
110 public bool OptionStrict = false;
112 [Option("Specifies binary-style string comparisons. This is the default", "optioncompare:binary")]
113 public bool OptionCompareBinary = true;
115 [Option("Specifies text-style string comparisons.", "optioncompare:text")]
116 public bool OptionCompareText { set { OptionCompareBinary = false; } }