2006-03-05 Senganal T <tsenganal@novell.com>
[mono.git] / man / mbas.1
1 .TH mbas 1 "21 February 2006"
2 .SH NAME 
3 mbas \- Mono Basic Compiler.
4 .SH SYNOPSIS
5 .B mbas
6 [option] [source-files]
7 .SH DESCRIPTION
8 .PP
9 .I MonoBASIC (mbas) 
10 is a CIL compiler for the VisualBasic.NET language, an
11 extended version of Visual Basic.
12 .PP
13 Applications developed on Windows with vbc can execute on Mono and applications
14 compiled with 'mbas' can be executed on .NET runtime.
15 .PP
16 The Mono Basic compiler accepts the same options as  
17 the Microsoft VB.NET compiler. Those options can start with a slash or a 
18 dash (/checked is the same as -checked).  Additionally to this, the
19 GNU-like options are supported, those begin with "--".  All
20 -specific flags which are not available in the Microsoft VB.NET
21 compiler are available only with the GNU-style options. 
22 .PP
23 Visual Basic.NET source files must end with a ".vb" extension.  Compilation of 
24 VB.NET source code requires all the files that make up a library, module or
25 executable to be provided on the command line.  There is no support
26 for partial compilation.  To achieve the benefits of partial
27 compilation, you should compile programs into their own assemblies,
28 and later reference them with the "-r" flag.
29 .PP
30 The Mono Basic compiler generates images (.exe files) that contain 
31 CIL byte code that can be executed by any system that implements a Common
32 Language Infrastructure virtual machine such as the Microsoft .NET
33 runtime engine on Windows or the Mono runtime engine on Unix systems.
34 Executables are not bound to a specific CPU or operating system.
35 .PP
36 The Mono Basic compiler by default only references three assemblies:
37 mscorlib.dll, System.dll and System.Xml.dll.   If you want to
38 reference extra libraries you must manually specify them using the
39 -pkg: command line option or the -r: command line option.
40 Alternatively if you want to get all of the System libraries, you can
41 use the -pkg:dotnet command line option.
42 .PP
43 .SH OPTIONS
44 .TP
45 .I \-\-about
46 Displays information about the Mono Basic compiler
47 .TP
48 .I \-\-addmodule:MODULE1[,MODULE2]
49 Includes the specified modules in the resulting assembly.  
50 .TP
51 .I -codepage:ID
52 Specifies the code page used to process the input files from the
53 point it is specified on.  By default files will be processed in the
54 Latin-1 code page.  The compiler will also automatically detect
55 Unicode files that have an embedded byte mark at the beginning.   
56 .TP
57 Other popular encodings are 28591 (Latin1), 1252 (iso-8859-1) and 65001 (UTF-8).
58 .TP 
59 Mono Basic supports a couple of shorthands: "utf8" can be used to specify utf-8 instead
60 of using the cryptic 65001 and "reset" restores the automatic handling of
61 code pages.  These shorthands are not available on the Microsoft compiler.
62 .TP
63 .I \-define:SYMLIST, -d:SYMLIST
64 Defines the symbol listed by the semi-colon separeted list SYMLIST
65 SYMBOL.  This can be tested in the source code by the pre-processor,
66 or can be used by methods that have been tagged with the Conditional
67 attribute. 
68 .TP
69 .I \-debug-args:arguments
70 Debugger arguments.
71 .TP
72 .I \-debug:AMOUNT
73 Specify the amount of debugging information to emit. Possible values for 
74 AMOUNT are "full" and "pdbonly".
75 .TP
76 .I \-~, \-debugoptions
77 Show debugging info while processing options.
78 .TP
79 .I \-\-fatal 
80 This is used for debugging the compiler.  This makes the error emission
81 generate an exception that can be caught by a debugger.
82 .TP
83 .I \-imports:import-list
84 Declare global Imports for listed namespaces. 
85 .TP
86 .I \-ignorewarn:XXXX
87 Ignores warning number XXXX.
88 .TP
89 .I -lib:PATHLIST, -libpath:PATHLIST
90 Each path specified in the comma-separated list will direct the
91 compiler to look for libraries in that specified path.
92 .TP
93 .I \-L PATH
94 Directs the compiler to look for libraries in the specified path.
95 Multiple paths can be provided by using the option multiple times.
96 .TP
97 .I \-main:CLASS
98 Tells the compiler which CLASS or MODULE contains the entry point. Useful when
99 you are compiling several classes with a Main method.
100 .TP
101 .I \-nologo
102 Suppress printing copyright information on startup.
103 .TP
104 .I \-nostdlib, -nostdlib+
105 Use this flag if you want to compile the core library.  This makes the
106 compiler load its internal types from the assembly being compiled.
107 .TP
108 .I \-noconfig, \-noconfig+
109 Disables the default compiler configuration to be loaded.  The
110 compiler by default has references to the system assemblies. 
111 .TP
112 .I \-nowarn
113 Makes the compiler ignore warnings.
114 .TP
115 .I \-optioncompare:binary, \-optioncompare:text 
116 Select between binary and text string comparisons. The default is binary 
117 string comparisons.
118 .TP
119 .I \-optionexplicit[+|-]
120 Require explicit declaration of variables
121 .TP
122 .I \-optionstrict[+|-]
123 Enforce strict language semantics
124 .TP
125 .I \-out:FNAME, -o FNAME
126 Names the output file to be generated.
127 .TP
128 .I \-\-parse
129 Used for benchmarking.  The compiler will only parse its input files. 
130 Currently ignored.
131 .TP
132 .I \-pkg:package1[,packageN]
133 The compiler will invoke pkg-config --libs on the set of packages
134 specified on the command line to obtain libraries and directories to
135 compile the code.
136 .PP
137 This is typically used with third party components, like this:
138 .nf
139                 $ mbas -pkg:gtk-sharp demo.vb
140 .fi
141 .TP
142 .TP
143 .I \-pkg:dotnet
144 This will instruct the compiler to reference the System.* libraries
145 available on a typical dotnet framework installation, notice that this
146 does not include all of the Mono libraies, only the System.* ones.  This
147 is a convenient shortcut for those porting code.
148 .TP
149 .I -q -quiet
150 Commands the compiler to show only error messages for syntax-related errors 
151 and warnings.
152 .TP
153 .I -resource:RESOURCE[,ID]
154 Embeds to the given resource file.  The optional ID can be used to
155 give a different name to the resource.  If not specified, the resource
156 name will be the file name.
157 .TP
158 .I -linkresource:RESOURCE[,ID]
159 Links to the specified RESOURCE.  The optional ID can be used to give
160 a name to the linked resource.
161 .TP
162 .I -r:ASSEMBLY1[,ASSEMBLY2], \-r ASSEMBLY1[,ASSEMBLY2]
163 Reference the named assemblies.  Use this to use classes from the named
164 assembly in your program.  The assembly will be loaded from either the
165 system directory where all the assemblies live, or from the path
166 explicitly given with the -L option.
167 .PP
168 You can also use a semicolon to separate the assemblies instead of a
169 comma. 
170 .TP
171 .I \-removeintchecks[+|-]
172 Remove integer checks. Default off.
173 .TP
174 .I \-rootnamespace:namespace
175 Specifies the root namespace for all type declarations
176 .TP
177 .I \-\-stacktrace
178 Generates a stack trace at the time the error is reported, useful for
179 debugging the compiler.
180 .TP
181 .I \-target:KIND, \-t:KIND
182 Used to specify the desired target.  The possible values are: exe
183 (plain executable), winexe (Windows.Forms executable), library
184 (component libraries) and module (partial library).
185 .TP
186 .I \-\-timestamp
187 Another debugging flag.  Used to display the times at various points
188 in the compilation process.
189 .TP
190 .I \-tokenize
191 Only tokenizes source files. Currently ignored.
192 .TP
193 .I \-unsafe, -unsafe+
194 Enables compilation of unsafe code.
195 .TP
196 .I \-utf8output[+|-]
197 Emit compiler output in UTF8 character encoding. Currently ignored.
198 .TP
199 .I \-v 
200 Debugging. Turns on verbose yacc parsing.
201 .TP
202 .I -. -verbosegetoptions
203 Show verbose parsing of options
204 .TP
205 .I \-\-version
206 Shows the compiler version.
207 .TP
208 .I \-warnaserror, \-warnaserror+
209 Treat warnings as errors.
210 .TP
211 .I \-wlevel:LEVEL
212 Sets the warning level.  0 is the lowest warning level, and 4 is the
213 highest.  The default is 2.
214 .TP
215 .I \-\-
216 Use this to stop option parsing, and allow option-looking parameters
217 to be passed on the command line.
218 .SH STABILITY
219 As of early 2006, the Mono Basic compiler is still considered alpha software.
220 Several language constructions that are accepted by the Microsoft Visual 
221 Basic.NET compiler are refused by the Mono Basic compiler. Occassional 
222 crashes also still occur.
223 .PP
224 .SH AUTHORS
225 See the ChangeLog for authors
226 .PP
227 .SH LICENSE
228 The Mono Basic compiler is released under the terms of the GNU GPL.
229 Please read the accompanying `COPYING' file for details.  Alternative
230 licenses are available from Ximian.
231 .PP
232 .SH SEE ALSO
233 mcs(1), mono(1), mint(1), sn(1)
234 .PP
235 .SH BUGS
236 To report bugs in the compiler, you can use `bug-buddy', or you can
237 file bug reports in our bug tracking system:
238 http://bugzilla.ximian.com.
239 .SH MAILING LIST
240 The Mono Basic Mailing List is available at: mono-vb-list-request@ximian.com