Content-type: text/html; charset=UTF-8
X11-Basic is a dialect of the BASIC programming language with graphics.
xbc can be used to make stand-alone-binaries out of *.bas script files.
For a desciption of the X11-Basic language and usage of the interpreter see xbasic(1).
xbc process input files through one or more of three stages: preprocessing, compilation, translation and linking. Source filename suffixes identify the source language.
Suffixes of source file names indicate the kind of processing to be done:
.bas Basic source; preprocess, compile, link .b bytecode file; translate to C, then compile to native code .o Object file; link
Linking is always the last stage unless you use one of the -c , -b or -l options to avoid it (or unless compilation errors stop the whole process).
By default, xbc makes the *.c file name for a source file by replacing
the suffix `.bas
with
.o'. Use
-o to select another name.
By default, xbc makes the object file name for a source file by replacing
the suffix `.bas
with `.o'. Use
-o to select another name.
By default, xbc makes the object file name for a source file by replacing
the suffix `.bas
with `.o'. Use
-o to select another name.
Since only one output file can be specified, it does not make sense to use `-o' when compiling more than one input file, unless you are producing an executable file as output.
If you do not specify `-o', the default is to put an executable file in `b.out', the object file for `source.suffix' in `source.o', and its *.c file in `source.c
For detailed help and description of the implemented basic commands take a look at the README file.
xbc testme.bas produces an excecutable file b.out xbc testme.bas -o testme --dynamic produces an excecutable file testme xbc testme.bas -c produces testme.o xbc testme.bas -b produces testme.c or 11.c or b.b xbc testme.bas -virtualm --dynamic -o b.out produces b.out, which excecutes really fast!
You can find additional sample programs in /usr/share/doc/packages/X11Basic/examples.
Actually xbc is a real compiler, if used with the -virtualm option. However, the default behaviour is such, that the source code is still interpreted on runtime. But the source code is linked to the X11-Basic library so there results one independant executable. Another advantage is that it is quite hard to extract a full running *.bas file from this binary since the code is compressd in a way.
Why is this the default? Well the compiler can pseudo-compile all BASIC programs, which run in the interpreter. The real compiler has some restrictions on the BASIC code, because it cannot compile every constructs (e.g. jumps/GOTO out of a procedure).
If you find a bug in the X11-Basic compiler xbc, you should report it. But first, you should make sure that it really is a bug, and that it appears in the latest version of the X11-Basic package that you have.
Once you have determined that a bug actually exists, mail a bug report to kollo@users.sourceforge.net. If you have a fix, you are welcome to mail that as well! Suggestions may be mailed to the bug tracking system.
Comments and bug reports concerning this manual page should be directed to kollo@users.sourceforge.net.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.