Skip to content

Commit 99a774c

Browse files
committed
gec: added command-line option --init to create ECF and Eiffel root class files if missing.
gec: added command-line option `--compile` to compile the Eiffel system. This is the default unless `--init` or `--run` is specified. gec: added command-line option `--run` to run Eiffel system. Do not compile unless the executable is not found. gec: if the input filename has no extension, the extension `.ecf` is assumed.
2 parents 58e90d1 + ebda23e commit 99a774c

4 files changed

Lines changed: 521 additions & 21 deletions

File tree

History.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
* Upgraded Zig toolchain to version 0.16.0.
88
* Upgraded Boehm GC to version 8.2.12.
9+
* Added command-line option `--init` to create ECF and Eiffel root
10+
class files if missing.
11+
* Added command-line option `--compile` to compile the Eiffel system.
12+
This is the default unless `--init` or `--run` is specified.
13+
* Added command-line option `--run` to run Eiffel system.
14+
Do not compile unless the executable is not found.
15+
* If the input filename has no extension, the extension `.ecf` is
16+
assumed.
917

1018
### Gobo Eiffel Tools Library
1119

tool/gec/doc/usage.html

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h2>Command-line options</h2>
2424
This will read the description of your program in the ECF file
2525
<font color="#800000"><i><tt>ecf_filename</tt></i></font>, compile it and invoke the
2626
back-end C compiler on the generated C code as explained
27-
below.
27+
below.
2828

2929
</p>
3030

@@ -36,6 +36,22 @@ <h2>Command-line options</h2>
3636
<font color="#800000"><i><tt>gec eiffel_filename</tt></i></font>
3737

3838
</blockquote>
39+
40+
</p>
41+
42+
<p>
43+
Note that if the input filename has no extension, the extension
44+
<font color="#800000"><i><tt>.ecf</tt></i></font> is assumed. These two instructions
45+
are equivalent:
46+
47+
<blockquote><pre>
48+
<font color="#800000"><i><tt>gec foo</tt></i></font>
49+
<font color="#800000"><i><tt>gec foo.ecf</tt></i></font>
50+
</pre></blockquote>
51+
52+
</p>
53+
54+
<p>
3955
Here is the list of options that can be
4056
used with <i>gec</i>:
4157

@@ -54,6 +70,34 @@ <h2>Command-line options</h2>
5470

5571
</dd>
5672

73+
<dt>
74+
<font color="#800000"><i><tt>--init</tt></i></font>
75+
76+
</dt>
77+
<dd>
78+
Initialize Eiffel system: create ECF and Eiffel root class files if missing.
79+
80+
</dd>
81+
82+
<dt>
83+
<font color="#800000"><i><tt>--compile</tt></i></font>
84+
85+
</dt>
86+
<dd>
87+
Compile Eiffel system.
88+
(default: true unless <font color="#800000"><i><tt>--init</tt></i></font> or <font color="#800000"><i><tt>--run</tt></i></font> is specified)
89+
90+
</dd>
91+
92+
<dt>
93+
<font color="#800000"><i><tt>--run</tt></i></font>
94+
95+
</dt>
96+
<dd>
97+
Run Eiffel system. Do not compile unless executable not found.
98+
99+
</dd>
100+
57101
<dt>
58102
<font color="#800000"><i><tt>--target=&lt;target_name&gt;</tt></i></font>
59103

@@ -407,6 +451,18 @@ <h2>ECF files</h2>
407451

408452
</p>
409453

454+
<p>
455+
Alternatively, this command can be used:
456+
457+
<blockquote>
458+
<font color="#800000"><i><tt>gec --init hello_world</tt></i></font>
459+
460+
</blockquote>
461+
to generate two files: <font color="#800000"><i><tt>hello_word.e</tt></i></font> containing a
462+
<font color="#008080"><i><tt>HELLO_WORLD</tt></i></font> Eiffel class text, and
463+
<font color="#800000"><i><tt>hello_word.ecf</tt></i></font> containing the associated ECF file.
464+
465+
</p>
410466

411467
</div>
412468
<div>
@@ -473,7 +529,7 @@ <h2>Back-end C compiler</h2>
473529
<table border="0" width="100%">
474530
<tr>
475531
<td>
476-
<address><font size="2"><b>Copyright © 2006-2025, Eric Bezault</b><br /><b>mailto:</b><a href="mailto:ericb@gobosoft.com">ericb@gobosoft.com</a><br /><b>https://</b><a href="https://www.gobosoft.com">www.gobosoft.com</a><br /><b>Last Updated: </b>6 December 2025</font></address>
532+
<address><font size="2"><b>Copyright © 2006-2026, Eric Bezault</b><br /><b>mailto:</b><a href="mailto:ericb@gobosoft.com">ericb@gobosoft.com</a><br /><b>https://</b><a href="https://www.gobosoft.com">www.gobosoft.com</a><br /><b>Last Updated: </b>10 May 2026</font></address>
477533
</td>
478534
<td align="right" valign="top"><a href="https://www.gobosoft.com"><img src="image/home.gif" alt="Home" border="0" /></a><a href="index.html"><img src="image/toc.gif" alt="Toc" border="0" /></a><a href="index.html"><img src="image/previous.gif" alt="Previous" border="0" /></a><a href="technology.html"><img src="image/next.gif" alt="Next" border="0" /></a></td>
479535
</tr>

tool/gec/doc/usage.xml

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66
"Using gec"
77
88
tool: "Gobo Eiffel Compiler"
9-
copyright: "Copyright (c) 2006-2025, Eric Bezault and others"
9+
copyright: "Copyright (c) 2006-2026, Eric Bezault and others"
1010
license: "MIT License"
1111
-->
1212

1313
<chapter xmlns="https://www.gobosoft.com/eiffel/gobo/documentation" id="gec/usage">
1414
<chapterinfo>
1515
<copyright>
16-
<year>2006-2025</year>
16+
<year>2006-2026</year>
1717
<holder>Eric Bezault</holder>
1818
</copyright>
1919
<author>
2020
<firstname>Eric</firstname><surname>Bezault</surname>
2121
</author>
2222
<email>ericb@gobosoft.com</email>
23-
<date>6 December 2025</date>
23+
<date>10 May 2026</date>
2424
</chapterinfo>
2525

2626
<title>Using gec</title>
@@ -34,14 +34,25 @@ The usual way to invoke <projectname>gec</projectname> is as follows:
3434
This will read the description of your program in the ECF file
3535
<filename>ecf_filename</filename>, compile it and invoke the
3636
back-end C compiler on the generated C code as explained
37-
below.
37+
below.
3838
</para>
3939
<para>
4040
For simple programs, one can just provide the Eiffel file containing
4141
the root class:
4242
<blockquote>
4343
<filename>gec eiffel_filename</filename>
4444
</blockquote>
45+
</para>
46+
<para>
47+
Note that if the input filename has no extension, the extension
48+
<filename>.ecf</filename> is assumed. These two instructions
49+
are equivalent:
50+
<blockquote><programlisting>
51+
<filename>gec foo</filename>
52+
<filename>gec foo.ecf</filename>
53+
</programlisting></blockquote>
54+
</para>
55+
<para>
4556
Here is the list of options that can be
4657
used with <projectname>gec</projectname>:
4758
<variablelist>
@@ -56,6 +67,31 @@ used with <projectname>gec</projectname>:
5667
Print a summary of the command-line options of <projectname>gec</projectname> and exit.
5768
</para></listitem>
5869
</varlistentry>
70+
<varlistentry>
71+
<term>
72+
<filename>--init</filename>
73+
</term>
74+
<listitem><para>
75+
Initialize Eiffel system: create ECF and Eiffel root class files if missing.
76+
</para></listitem>
77+
</varlistentry>
78+
<varlistentry>
79+
<term>
80+
<filename>--compile</filename>
81+
</term>
82+
<listitem><para>
83+
Compile Eiffel system.
84+
(default: true unless <filename>--init</filename> or <filename>--run</filename> is specified)
85+
</para></listitem>
86+
</varlistentry>
87+
<varlistentry>
88+
<term>
89+
<filename>--run</filename>
90+
</term>
91+
<listitem><para>
92+
Run Eiffel system. Do not compile unless executable not found.
93+
</para></listitem>
94+
</varlistentry>
5995
<varlistentry>
6096
<term>
6197
<filename>--target=&lt;target_name&gt;</filename>
@@ -364,7 +400,15 @@ You can give it a try using the <classname>HELLO_WORLD</classname> class provide
364400
An ECF file will be needed when you want to use classes from other libraries
365401
or if you want to override the default settings (e.g. console application, SCOOP mode).
366402
</para>
367-
403+
<para>
404+
Alternatively, this command can be used:
405+
<blockquote>
406+
<filename>gec --init hello_world</filename>
407+
</blockquote>
408+
to generate two files: <filename>hello_word.e</filename> containing a
409+
<classname>HELLO_WORLD</classname> Eiffel class text, and
410+
<filename>hello_word.ecf</filename> containing the associated ECF file.
411+
</para>
368412
</section>
369413

370414
<section><title>Back-end C compiler</title>

0 commit comments

Comments
 (0)