1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
|
<!-- Title = the 'compile_to_jvm' command -->
<TABLE BORDER=0 CELLSPACING=5 CELLPADDING=5 COLS=1 WIDTH="100%" BGCOLOR="#3366FF" NOSAVE >
<TR NOSAVE>
<TD NOSAVE>
<CENTER><FONT COLOR="#FFFFFF" SIZE=+3><B>The <TT>compile_to_jvm</TT> Command</B></FONT></CENTER>
</TD>
</TR>
</TABLE>
<BR><BR><BR>
The <TT>compile_to_jvm</TT> command is the SmartEiffel Java byte code
generator for the Java Virtual Machine.
There are
two invocation modes: <I>traditional</I> and <I>ACE</I>. In traditional mode, a
variety of compiler options can be specified on the command line. In
ACE mode, these options are not permitted; it is presumed that the
required compiler options are listed in the ACE file.
<P><TABLE BORDER=0 COLS=1 WIDTH="100%" BGCOLOR="#3366FF" NOSAVE >
<TR NOSAVE>
<TD NOSAVE><FONT COLOR="#FFFFFF" SIZE="+2">Usage</FONT></TD>
</TR>
</TABLE>
<P>
<FONT COLOR="#FF00FF"><B>Traditional mode</B></FONT>
<BR>
<TT>compile_to_jvm [options] <RootClass> [<RootProcedure>]</TT>
<P>
<P>
<FONT COLOR="#FF00FF"><B>ACE mode</B></FONT>
<BR>
<TT>compile_to_jvm [general_options]
<ACEfile.ace></TT>
<P>
In traditional mode, the <TT>compile_to_jvm</TT> command must be given at
least one argument to indicate
the starting execution point of the system.
Thus your program will start in <I><RootProcedure></I> of <I><RootClass></I>.
The default <I><RootProcedure></I> is <I>make</I>.
</P><P>
In ACE mode, the name of the ACE file must end with the <TT>.ace</TT>
suffix. For examples of how to use ACE files, have a look in the
<TT>SmartEiffel/tutorial/ace</TT> directory.
</P>
<TABLE BORDER=0 COLS=1 WIDTH="100%" BGCOLOR="#3366FF" NOSAVE >
<TR NOSAVE>
<TD NOSAVE><FONT COLOR="#FFFFFF" SIZE="+2">Load Path for Eiffel Source Files</FONT></TD>
</TR>
</TABLE>
<P>
<TT>compile_to_jvm</TT> uses the technique described in the
documentation for the
<A HREF="finder.html"><TT>finder</TT></A> command to locate the Eiffel source files it
tries to compile. Note that what actually happens depends on the
invocation mode (traditional or ACE).
</P>
<TABLE BORDER=0 COLS=1 WIDTH="100%" BGCOLOR="#3366FF" NOSAVE >
<TR NOSAVE>
<TD NOSAVE><FONT COLOR="#FFFFFF" SIZE="+2">General Options</FONT></TD>
</TR>
</TABLE>
<P>
<DL COMPACT>
<DT>
<I>-help</I>:<BR>
<DD>
Display a brief summary of the command-line syntax and a complete
list of compiler options.
<BR><BR>
<DT>
<I>-verbose</I>:<BR><DD>
Print system information during the compilation (full path of
files loaded, type inference score, removed files, etc.).
<BR><BR>
<DT>
<I>-version</I>:<BR><DD>
Display the version number of the SmartEiffel release you're using.
</DL>
<BR><BR>
<DT>
<I>-loadpath <loadpath_file></I>:<BR><DD>
Adds a loadpath file for class lookup. See details
in the <A HREF="finder.html"><TT>finder man page</TT></A>.
</P>
<TABLE BORDER=0 COLS=1 WIDTH="100%" BGCOLOR="#3366FF" NOSAVE >
<TR NOSAVE>
<TD NOSAVE><FONT COLOR="#FFFFFF" SIZE="+2">Options to Select Eiffel
Compilation Modes (traditional mode only)</FONT></TD>
</TR>
</TABLE>
<P>
As with the <TT>compile_to_c</TT> command, there are 8 different compilation
modes: <I>-boost</I>, <I>-no_check</I>, <I>-require_check</I>,
<I>-ensure_check</I>, <I>-invariant_check</I>, <I>-loop_check</I>,
<I>-all_check</I> and <I>-debug_check</I>.<BR>
These options have the same meaning as with <TT>compile_to_c</TT>. See
the <A HREF="compile_to_c.html">compile_to_c</A>
documentation for details.
</P>
<TABLE BORDER=0 COLS=1 WIDTH="100%" BGCOLOR="#3366FF" NOSAVE >
<TR NOSAVE>
<TD NOSAVE><FONT COLOR="#FFFFFF" SIZE="+2">Other Options (traditional
mode only)</FONT></TD>
</TR>
</TABLE>
<P>
<DL COMPACT><DT>
<I>-o <output_name></I>:<BR>
<DD>
Place the main output in <I><output_name></I>.class
and other class files in the directory <I><output_name></I>.
When this option is absent, the default is <I><Root-Class></I>.
<BR><BR>
<DT>
<I>-no_style_warning</I>:<BR><DD>
Suppress output for warning messages related to the non-respecting of standard Eiffel
style guidelines (for example, <CODE>ItEm</CODE> will not trigger a warning).
<BR><BR>
<DT>
<I>-case_insensitive</I>:<BR><DD>
Switch case-insensitive mode on.
<BR>
For example,
when this mode is selected, the Eiffel parser considers that the
following identifiers refer to the same feature: <CODE>item</CODE>, <CODE>ITEM</CODE>,
<CODE>ItEm</CODE>, ...
<BR><BR>
<DT>
<I>-no_warning</I>:<BR>
<DD>
Suppress output for all warning messages. (Error messages
are still printed.)
<BR><BR>
<!-- <DT>
<I>-cecil <cecil_file></I>:<BR><DD>
Allow some Eiffel features to be called
from Java (see the
<A HREF="cecil.html"><code>cecil</code></A>
file for details). To call Java functions/macros
from Eiffel see the
<A HREF="external.html"><code>external</code></A>
file.
<BR><BR>
-->
</DL>
</P>
<TABLE BORDER=0 COLS=1 WIDTH="100%" BGCOLOR="#3366FF" NOSAVE >
<TR NOSAVE>
<TD NOSAVE><FONT COLOR="#FFFFFF" SIZE="+2">The <code>SmartEiffelRuntime.java</code> class</FONT></TD>
</TR>
</TABLE>
<P>
The <code>SmartEiffelRuntime.java</code> class implements some low-level
external features.
This file is in the directory <code>SmartEiffel/sys/runtime</code>.
The file <code>SmartEiffelRuntime.class</code> must be present to execute
the Java byte-code generated by the <TT>compile_to_jvm</TT> command.
Don't forget to add this class to your Java <TT>CLASSPATH</TT> system
environment variable.
You can also copy the file <code>SmartEiffelRuntime.class</code> to some
appropriate directory.
</P>
<TABLE BORDER=0 COLS=1 WIDTH="100%" BGCOLOR="#3366FF" NOSAVE >
<TR NOSAVE>
<TD NOSAVE><FONT COLOR="#FFFFFF" SIZE="+2">Examples</FONT></TD>
</TR>
</TABLE>
<P>
<FONT COLOR="#FF00FF"><B>Example 1</B></FONT>
<BR>
When SmartEiffel is correctly installed, you can type
the following command to test the hello world program :
<DL COMPACT><DT><DD><TT>
compile_to_jvm hello_world
</TT></DL>
Then, in order to execute the Java byte code produced, you can
use the command:
<DL COMPACT><DT><DD><TT>
java hello_world
</TT></DL>
</P><P>
<FONT COLOR="#FF00FF"><B>Example 2</B></FONT>
<BR>
As for the <TT>compile_to_c</TT> command you can add the option <I>-boost</I> to omit
all assertion checking:
<DL COMPACT><DT><DD><TT>
compile_to_jvm -boost hello_world
</TT></DL>
</P><P>
<FONT COLOR="#FF00FF"><B>Example 3</B></FONT>
<BR>
To change the name of the generated main class, you have to add the
-o option:
<DL COMPACT><DT><DD><TT>
compile_to_jvm -boost -o out hello_world
</TT></DL>
Then, you can run the Java byte code with:
<DL COMPACT><DT><DD><TT>
java out
</TT></DL>
Note that the name used for the class files directory is also
changed (this directory is also named <TT>out</TT>).
</P><P>
<FONT COLOR="#FF00FF"><B>Example 4</B></FONT>
<BR>
Finally, the <I>-verbose</I> option may be useful to check which files
are loaded, which files are created, or to fix some installation
problem:
<DL COMPACT><DT><DD><TT>
compile_to_jvm -verbose hello_world
</TT></DL>
</P>
<!-- BL START -->
<!-- BL1 START -->
<CENTER>
<IMG SRC="se-line.gif" ALT="[Line]">
<BR>
<FONT SIZE="-1"><I>
Copyright © Dominique COLNET and Suzanne COLLIN -
<A HREF="mailto:SmartEiffel@loria.fr"><SmartEiffel@loria.fr></A>
<BR>
<!-- hhmts start -->
Last modified: Tue Feb 11 12:14:05 CET 2003
<!-- hhmts end -->
<BR>
</I></FONT><BR></CENTER>
|