Top
compile
compile_to_jvm
SmallEiffel Tools: compile_to_c
Syntax
compile_to_c [options] Root-Class [Root-Procedure] [*.c] [*.o] [-l*]
Compile_to_c is the SmallEiffel ANSI C code generator.
Usually this command is automatically called by compile
but you can use it separately to produce C code.
Compile_to_c must have at least one argument to indicate
the starting execution point of the system.
Thus, execution will start in Root-Procedure of Root-Class.
The default Root-Procedure is make.
Compile_to_c generates all necessary C files and also produces
one command script file. The name of this script file changes with
the operating system used (*.make on Unix or *.BAT on DOS for
example).
Options to select Eiffel compilation mode
There are 8 modes of compilation given by the following
options: -debug_check, -all_check, -loop_check, -invariant_check,
-ensure_check, -require_check, -no_check and -boost.
Only one mode can be selected;
-all_check is the default.
-boost
Compilation mode which includes all optimization. There is
no target's existence test, no system-level validity checking.
Some routines are inlined. No code is generated to get an execution
trace in case of failure. There is no assertion check.
-no_check
Compilation mode in which no Eiffel assertion is checked.
The target's existence test is performed. Some code is generated
for the system-level validity checking, and to produce an execution
trace (an execution stack is managed).
There is no inlining and no assertion check.
-require_check
Compilation mode in which Eiffel preconditions
are checked. The generated code is similar to the previous one,
but also includes code to test preconditions (require).
-ensure_check
The generated code is similar to the previous one,
but also includes code to test postconditions (ensure).
-invariant_check
The generated code is similar to the previous one,
but also includes code to test class invariant.
-loop_check
The generated code is similar to the previous one,
but also includes code to test loop variant and loop invariant.
-all_check
The default mode. The generated code is similar to the
previous one, but also includes code for the check instruction.
-debug_check
The generated code is similar to the previous one,
but also includes code for the debug instruction.
All debug are checked regardless of the string optional key.
Other options
-trace
This option may be useful to debug your program or to do
some profiling.
When selected, this option add some more C code to
produce at run time the file "trace.se" (file "trace.se" is not
produced at compile time). When running a traced program, you get
a (usually huge) file "trace.se" in the launching directory. File
"trace.se" tells you where your program has gone: which line,
which column in which Eiffel source file.
Because all classes are
traced, file "trace.se" is a huge file even for a small program.
The feature GENERAL.trace_switch allows dynamic turning on/off
of the printed trace. At run time, when the argument of trace_switch is
true, trace printing is switched on (conversely, false is to switch
off trace printing). When option -trace is not selected, calls to
trace_switch are ignored by compile_to_c (no C code
is produced). The -trace mode is not available with mode -boost.
Using -trace at the same time as -boost has the same effect as
using -trace with -no_check. You should also bear in mind that very simple
instructions (like "i := i + 1;", for example) may not be traced.
-cc c_compiler
Call c_compiler instead of the default C compiler.
See READ_ME of directory `sys' to see how to set the default C compiler
as well as the default linker.
-no_split
produce only one C file for the whole Eiffel system.
Thus, the C compiler may inline more functions calls. This option
is useful only to finalize an application (the incremental C
compiling mode is switched off with -no_split).
-no_strip
Do not produce a strip in the command file.
-o output_name
Same meaning as -o option of the C compiler. The
output_name is the name of the produced executable file.
-cecil cecil_file
To allow some Eiffel features to be called
from C (see cecil for details). (To call C functions or macros
from Eiffel see external.)
-verbose
to see additional information during the compilation (the full path of
loaded files is printed, type inference score, removed files, etc).
Options passed to the C compiler
Remaining options, *.c files, *.o files, library -l* are passed
to the C compiler/linker.
Environment variable
The environment variable SmallEiffel is used to indicate
the location of the SmallEiffel directory on the disk.
This variable also indicates what kind of system is being used. When the SmallEiffel
value contains a forward-slash character ('/'), the compiler assumes it is a
UNIX-like system.
Top
compile
compile_to_jvm
This page was last changed by Oliver Elphick on 3rd August 1997.