996
|
1 #!/usr/bin/perl -w
|
|
2
|
|
3 eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
|
|
4 if 0; # not running under some shell
|
|
5
|
|
6 # Compiler/user interface/whatnot for CLC-INTERCAL
|
|
7
|
|
8 # This file is part of CLC-INTERCAL
|
|
9
|
|
10 # Copyright (c) 2006-2008 Claudio Calvelli, all rights reserved.
|
|
11
|
|
12 # CLC-INTERCAL is copyrighted software. However, permission to use, modify,
|
|
13 # and distribute it is granted provided that the conditions set out in the
|
|
14 # licence agreement are met. See files README and COPYING in the distribution.
|
|
15
|
|
16 require 5.005;
|
|
17
|
|
18 my $initial_times;
|
|
19 BEGIN { $initial_times = [time, times] }
|
|
20
|
|
21 use strict;
|
|
22 use Getopt::Long;
|
|
23
|
|
24 use vars qw($VERSION $PERVERSION);
|
|
25 ($VERSION) = ($PERVERSION = "CLC-INTERCAL/Base bin/sick 1.-94.-2") =~ /\s(\S+)$/;
|
|
26
|
|
27 use Language::INTERCAL::Sick '1.-94.-2';
|
|
28 use Language::INTERCAL::GenericIO '1.-94.-2', qw($stdsplat);
|
|
29 use Language::INTERCAL::Rcfile '1.-94.-2';
|
|
30 use Language::INTERCAL::Interface '1.-94.-2';
|
|
31
|
|
32 $| = 1;
|
|
33
|
|
34 my $user_interface = '';
|
|
35 my $rclist = 0;
|
|
36 my $timehandle = 0;
|
|
37 my $rcfile = new Language::INTERCAL::Rcfile;
|
|
38 my $compiler = new Language::INTERCAL::Sick($rcfile);
|
|
39
|
|
40 if (defined &Getopt::Long::Configure) {
|
|
41 Getopt::Long::Configure qw(no_ignore_case auto_abbrev permute bundling);
|
|
42 } else {
|
|
43 $Getopt::Long::ignorecase = 0;
|
|
44 $Getopt::Long::autoabbrev = 1;
|
|
45 $Getopt::Long::order = $Getopt::Long::PERMUTE;
|
|
46 $Getopt::Long::bundling = 1;
|
|
47 }
|
|
48
|
|
49 my $setoption = sub { $compiler->setoption(@_) };
|
|
50
|
|
51 GetOptions(
|
|
52 # User Interface Options
|
|
53 'graphic|X' => sub { $user_interface = 'X' },
|
|
54 'curses|c' => sub { $user_interface = 'Curses' },
|
|
55 'line' => sub { $user_interface = 'Line' },
|
|
56 'batch' => sub { $user_interface = 'None' },
|
|
57 'interface|i=s' => \$user_interface,
|
|
58 # source character set options
|
|
59 'ascii|a' => sub { $compiler->setoption('charset', 'ASCII') },
|
|
60 'baudot|b' => sub { $compiler->setoption('charset', 'Baudot') },
|
|
61 'ebcdic|e' => sub { $compiler->setoption('charset', 'EBCDIC') },
|
|
62 'hollerith|h' => sub { $compiler->setoption('charset', 'Hollerith') },
|
|
63 'guess|g' => sub { $compiler->setoption('charset', '') },
|
|
64 'charset=s' => $setoption,
|
|
65 # code generation options
|
|
66 'optimise|O' => $setoption,
|
|
67 'nooptimise' => sub { $compiler->setoption('optimise', 0) },
|
|
68 'backend|l=s' => $setoption,
|
|
69 'bug=i' => $setoption,
|
|
70 'ubug=i' => $setoption,
|
|
71 'output|o=s' => $setoption,
|
|
72 'name|n=s' => $setoption,
|
|
73 'include|I=s' => sub { $rcfile->setoption(@_) },
|
|
74 'preload|p=s' => $setoption,
|
|
75 'nopreload' => sub { $compiler->clearoption('preload') },
|
|
76 'suffix=s' => $setoption,
|
|
77 # misc options
|
|
78 'nouserrc' => sub { $rcfile->setoption('nouserrc', 1) },
|
|
79 'rcfile|r=s' => sub { $rcfile->setoption(@_) },
|
|
80 'stdverb=s' => sub {
|
|
81 my ($opt, $file) = @_;
|
|
82 my $mode = $file =~ s/^([ra]),// ? lc($1) : 'r';
|
|
83 my $vh =
|
|
84 new Language::INTERCAL::GenericIO
|
|
85 ('FILE', $mode, $file);
|
|
86 $compiler->setoption('verbose', $vh);
|
|
87 },
|
|
88 'verbose|v' => sub { $compiler->setoption('verbose', $stdsplat) },
|
|
89 'quiet|q' => sub { $compiler->setoption('verbose', 0) },
|
|
90 'rclist' => \$rclist,
|
|
91 'times' => sub { $timehandle = $stdsplat },
|
|
92 'notimes' => sub { $timehandle = 0 },
|
|
93 'stdtrace=s' => sub {
|
|
94 my ($opt, $file) = @_;
|
|
95 my $mode = $file =~ s/^([ra]),//i ? lc($1) : 'r';
|
|
96 my $th =
|
|
97 new Language::INTERCAL::GenericIO('FILE',
|
|
98 $mode,
|
|
99 $file);
|
|
100 $compiler->setoption('trace_fh', $th);
|
|
101 $compiler->setoption('trace', 1);
|
|
102 },
|
|
103 'trace' => sub { $compiler->setoption('trace', 1) },
|
|
104 'notrace' => sub { $compiler->setoption('trace', 0) },
|
|
105 # compile program
|
|
106 '<>' => sub { $compiler->source($_[0]); },
|
|
107 ) or usage();
|
|
108
|
|
109 set_options();
|
|
110 my $server = Language::INTERCAL::Server->new();
|
|
111 $compiler->server($server);
|
|
112 my $now = printtimes($initial_times, "Time to start up");
|
|
113 $compiler->load_objects();
|
|
114 $now = printtimes($now, "Time to load objects");
|
|
115
|
|
116 if ($rclist) {
|
|
117 $compiler->save_objects(0);
|
|
118 printtimes($now, "Time to save objects");
|
|
119 printtimes($initial_times, "Total execution time");
|
|
120 print map { "$_\n" } @{$rcfile->getoption('rcfiles')};
|
|
121 exit 0;
|
|
122 }
|
|
123
|
|
124 # XXX sick has not yet been updated to work with interactive interfaces
|
|
125 #my $ui_obj = Language::INTERCAL::Interface->new($server,
|
|
126 # $user_interface,
|
|
127 # $rcfile->getitem('SPEAK'));
|
|
128 my $ui_obj = Language::INTERCAL::Interface->new(undef, 'None');
|
|
129 if (! $ui_obj->has_window) {
|
|
130 $compiler->save_objects(0);
|
|
131 printtimes($now, "Time to save objects");
|
|
132 printtimes($initial_times, "Total execution time");
|
|
133 exit 0;
|
|
134 }
|
|
135
|
|
136 $rcfile->run($ui_obj);
|
|
137 printtimes($now, "Time to set up rcfiles");
|
|
138
|
|
139 $ui_obj->run($compiler);
|
|
140 printtimes($initial_times, "Total execution time");
|
|
141
|
|
142 sub set_options {
|
|
143 $rcfile->load;
|
|
144 my $db = $rcfile->getitem('PRODUCE');
|
|
145 $compiler->setoption('default_backend', $db) if $db ne '';
|
|
146 $compiler->setoption('default_charset', $_)
|
|
147 for $rcfile->getitem('WRITE');
|
|
148 $compiler->setoption('default_suffix', $_)
|
|
149 for $rcfile->getitem('UNDERSTAND');
|
|
150 $compiler->setoption('default_extra', $_)
|
|
151 for $rcfile->getitem('UNDERSTAND ANYWHERE');
|
|
152 }
|
|
153
|
|
154 sub usage {
|
|
155 (my $p = $0) =~ s#^.*/##;
|
|
156 die "Usage: $p [-alphabet] files...\n";
|
|
157 }
|
|
158
|
|
159 sub printtimes {
|
|
160 return 0 unless $timehandle;
|
|
161 my ($prev, $title) = @_;
|
|
162 my @now = (time, times);
|
|
163 my $wall = $now[0] - $prev->[0];
|
|
164 my $user = $now[1] - $prev->[1];
|
|
165 my $system = $now[2] - $prev->[2];
|
|
166 for ($wall, $user, $system) {
|
|
167 if ($_ > 60) {
|
|
168 $_ = sprintf "%d:%05.2f", int($_ / 60), $_ - 60 * int($_ / 60)
|
|
169 } else {
|
|
170 $_ = sprintf "%.2f", $_;
|
|
171 }
|
|
172 }
|
|
173 $wall =~ s/\.00$//;
|
|
174 $timehandle->read_text("$title\: $wall (${user}u ${system}s)\n");
|
|
175 \@now;
|
|
176 }
|
|
177 __END__
|
|
178
|
|
179 =pod
|
|
180
|
|
181 =head1 NAME
|
|
182
|
|
183 sick - Compiler for CLC-INTERCAL
|
|
184
|
|
185 =head1 SYNOPSIS
|
|
186
|
|
187 B<sick> [options] B<files>...
|
|
188
|
|
189 =head1 DESCRIPTION
|
|
190
|
|
191 B<sick> is the main development environment for CLC-INTERCAL. If
|
|
192 files are specified, these will be compiled using the options in
|
|
193 effect at the point where they appear on the command line, and
|
|
194 they are compiled to objects (if they are not already object).
|
|
195 After all the options have been processed, the program enters
|
|
196 interactive mode, unless otherwise specified.
|
|
197
|
|
198 The program will be compiled using a compiler selected using command
|
|
199 line options; if nothing is selected, the compiler depends on the file
|
|
200 suffix:
|
|
201
|
|
202 =over 4
|
|
203
|
|
204 =item CLC-INTERCAL program source
|
|
205
|
|
206 These files must have suffix B<.i> or B<.clci>. These will be prefixed,
|
|
207 by default, with the compiler object I<sick.io>.
|
|
208
|
|
209 =item CLC-INTERCAL compiler source
|
|
210
|
|
211 These files must have suffix B<.iacc>. These will be prefixed, by default,
|
|
212 with the compiler object I<iacc.io> and produce a compiler object (which
|
|
213 can be executed as a program, but will do nothing - it's only useful as a
|
|
214 preload before compiling from source).
|
|
215
|
|
216 =item C-INTERCAL program source
|
|
217
|
|
218 These have suffix B<.ci> and will be prefixed with the compiler object
|
|
219 I<ick.io>.
|
|
220
|
|
221 =item CLC-INTERCAL assembler source
|
|
222
|
|
223 These have suffix B<.iasm> and will be prefixed with the compiler object
|
|
224 I<asm.io>.
|
|
225
|
|
226 =item Traditional INTERCAL program source
|
|
227
|
|
228 These will have suffix B<.1972> and will be prefixed with the compiler
|
|
229 object I<1972.io>
|
|
230
|
|
231 =item Compiler extensions
|
|
232
|
|
233 Suffixes B<.i>, B<.ci>, B<.clci> and B<.iasm> can contain a list of letters
|
|
234 and numbers between the spot (B<.>) and the rest of the suffix; these
|
|
235 select compiler extensions to be added.
|
|
236
|
|
237 =over 8
|
|
238
|
|
239 =item Base
|
|
240
|
|
241 Numbers between B<2> and B<7> change the default base by loading compiler
|
|
242 objects B<2.io> to B<7.io>.
|
|
243
|
|
244 =item Bitwise Divide
|
|
245
|
|
246 Letter B<d> in the suffix adds the compiler object I<bitwise-divide.io>,
|
|
247 which changes the normal unary divide operation to use bitwise, rather
|
|
248 than arithmetic, shifts. It can be used with I<sick> or I<iasm> but
|
|
249 not with I<ick>.
|
|
250
|
|
251 =item COME FROM gerund
|
|
252
|
|
253 Letter B<g> in the suffix adds the compiler object I<come-from-gerund.io>,
|
|
254 which enables the COME FROM gerund statements; since I<ick> does not parse
|
|
255 such statements, this letter can only be used with I<sick> or I<iasm>.
|
|
256
|
|
257 =item Computed labels
|
|
258
|
|
259 Letter B<l> in the suffix adds the compiler object I<computed-labels.io>,
|
|
260 which adds grammar rules to parse computed statement labels; this can
|
|
261 be used only with I<sick>.
|
|
262
|
|
263 =item NEXT
|
|
264
|
|
265 Letter B<n> in the suffix adds the compiler object I<next.io>,
|
|
266 which enables the NEXT statement in I<sick>; since I<ick> enables this
|
|
267 by default, this letter can only be used with I<sick>.
|
|
268
|
|
269 =item INTERcal NETworking
|
|
270
|
|
271 Letter B<r> in the suffix adds the compiler object I<internet.io>,
|
|
272 which adds syntax for the I<STEAL>, I<SMUGGLE> and I<CASE> statements;
|
|
273 it can be used with I<ick> or I<sick>.
|
|
274
|
|
275 =item System call
|
|
276
|
|
277 Letter B<s> in the suffix adds the compiler object I<syscall.io>, which hides
|
|
278 a "PLEASE NEXT FROM (666)" in a dark corner of your operating system.
|
|
279
|
|
280 =item Threaded program
|
|
281
|
|
282 Letter B<t> in the suffix selects threaded mode by loading compiler object
|
|
283 I<thick.io>. This also changes the default compiler to I<ick> if the suffix
|
|
284 is B<.i>: to use I<sick> one would use I<.tclci>.
|
|
285
|
|
286 =item Wimp mode
|
|
287
|
|
288 Letter B<w> in the suffix adds the compiler object I<wimp.io>, which causes
|
|
289 the program to start in wimp mode when it is executed. An equivalent result
|
|
290 can be obtained by passing the B<--wimp> option to the executable program.
|
|
291
|
|
292 =back
|
|
293
|
|
294 =back
|
|
295
|
|
296 The actual list of suffixes recognised can be changed by editing the file
|
|
297 F<system,sickrc> or F<.sickrc>. See the option B<--rcfile> for a discussion
|
|
298 on how and where B<sick> finds these files, and L<sickrc> for a description
|
|
299 of the file format.
|
|
300
|
|
301 If a preload file is specified on the command line, the defaults derived
|
|
302 from the suffix are not used. It is also possible to use default preloads
|
|
303 from a different file suffix by explicitely saying B<-suffix>=I<S> - in
|
|
304 this case, the compiler acts as if the file had name I<name.S>
|
|
305
|
|
306 In addition, compiler objects are always recognised, with whatever suffix.
|
|
307 These bypass the first compiler pass and jump directly to the runtime
|
|
308 (just-too-late) compiler. However, if the optimiser has been selected
|
|
309 when these objects were compiled, and there are no postprocessor statements,
|
|
310 the just-too-late compiler will be automatically replaced by a more
|
|
311 traditional "compile-time" compiler. If this is confusing, wait until
|
|
312 you see the rest.
|
|
313
|
|
314 If a file is specified without suffix, and there is a compiler object in the
|
|
315 include path with the same name and suffix B<.io>, the suffix is automatically
|
|
316 added, whether you wanted it or now.
|
|
317
|
|
318 As soon as each program is written into B<sick>, a pre-compiler will
|
|
319 produce an internal compiler object. If B<sick> enters interactive mode,
|
|
320 these objects will be available in memory for single-stepping, running,
|
|
321 or just ignoring completely and getting on with the real work.
|
|
322
|
|
323 If B<sick> loads all the required programs and objects successfully, but
|
|
324 does not enter interactive mode, any program source is read back out to
|
|
325 disk in object format, using the same file name with the suffix replaced
|
|
326 by B<.io> if no output file is specified. If a backend is specified in
|
|
327 the command line before a program is loaded, B<sick> will produce an
|
|
328 executable via that backend instead of an object.
|
|
329
|
|
330 The compiler accepts several options, some of which are documented here.
|
|
331 Options and files can be mixed in any order, each file is loaded and
|
|
332 compiled using whatever options precedes it on the command line. For
|
|
333 example:
|
|
334
|
|
335 sick --verbose --optimise prog1.i --quiet prog2.i --batch
|
|
336
|
|
337 will tell you everything about compiling I<prog1.i> but not about I<prog2.i>.
|
|
338 Both programs will be optimised. On the other hand:
|
|
339
|
|
340 sick --optimise prog1.i --nooptimise prog2.i --batch
|
|
341
|
|
342 will optimise I<prog1.i> but not I<prog2.i>.
|
|
343
|
|
344 All options can be "undone" (sometimes it's even clear how) except
|
|
345 B<--include> which applies to all objects loaded after it, and
|
|
346 B<--rcfile> which applies to all objects, even the ones loaded before
|
|
347 it (just to be different).
|
|
348
|
|
349 =head2 User Interface Options
|
|
350
|
|
351 =over 4
|
|
352
|
|
353 =item B<-X> / B<--graphic>
|
|
354
|
|
355 Enters X-based graphical user interface. Requires Perl-GTK. This is the
|
|
356 default if Perl-GTK is installed, the environment variable I<$DISPLAY> is
|
|
357 set and the opening of the X display succeeds.
|
|
358
|
|
359 =item B<-c> / B<--curses>
|
|
360
|
|
361 Enters full screen, curses-based interface. This is the default if the
|
|
362 X based interface cannot be started, the environment variable I<$TERM>
|
|
363 is set and the terminal name is known.
|
|
364
|
|
365 =item B<--line>
|
|
366
|
|
367 Enters the line-mode user interface. This is the default if the X based
|
|
368 and the curses based interfaces do not work.
|
|
369
|
|
370 =item B<--batch>
|
|
371
|
|
372 Avoids entering interactive mode. This is the default if the standard
|
|
373 input and output are not connected to a terminal and the X based interface
|
|
374 cannot be started.
|
|
375
|
|
376 =item B<-i>I<type> / B<--interface>=I<type>
|
|
377
|
|
378 Selects the user interface I<type>. Currently, only I<X>, I<Curses>,
|
|
379 I<Line> and I<None> are defined, but more can be installed as compiler
|
|
380 plug-ins. If the interface selected is I<None>, B<sick> will work in
|
|
381 batch mode. In addition, an empty string will reinstate the default
|
|
382 behaviour.
|
|
383
|
|
384 =back
|
|
385
|
|
386 =head2 Source Character Set Options
|
|
387
|
|
388 =over 4
|
|
389
|
|
390 =item B<-a> / B<--ascii>
|
|
391
|
|
392 Assumes that program source is in ASCII.
|
|
393
|
|
394 =item B<-b> / B<--baudot>
|
|
395
|
|
396 Assumes that program source is in Baudot.
|
|
397
|
|
398 =item B<-e> / B<--ebcdic>
|
|
399
|
|
400 Assumes that program source is in EBCDIC.
|
|
401
|
|
402 =item B<-h> / B<--hollerith>
|
|
403
|
|
404 Assumes that program source is in Hollerith.
|
|
405
|
|
406 =item B<-g> / B<--guess>
|
|
407
|
|
408 Does not make assumptions about the source character set. If the character
|
|
409 set cannot be guessed, will produce an error. This is the default.
|
|
410
|
|
411 =item B<--charset>=I<name>
|
|
412
|
|
413 Assumes that program source is in the given character sets. Valid values are
|
|
414 currently I<ASCII>, I<Baudot>, I<EBCDIC>, I<Hollerith>; an empty I<name> is
|
|
415 equivalent to specifying option B<--guess>).
|
|
416
|
|
417 =back
|
|
418
|
|
419 =head2 Code Generation Options
|
|
420
|
|
421 =over 4
|
|
422
|
|
423 =item B<-O> / B<--optimise>
|
|
424
|
|
425 Invokes the optimiser. This is a letter o, not a zero. This will cause the
|
|
426 extra object I<optimise.io> to be prefixed after the last compiler and
|
|
427 before the real program. The program is then executed: when the optimiser
|
|
428 takes control, it will force compilation of the rest of the program (thereby
|
|
429 executing the compiler at compile-time, instead of runtime as it normally
|
|
430 does), and the resulting object is checkpointed, so the next time it will
|
|
431 automatically skip the initialisation and compilation stages. In addition,
|
|
432 the "optimise" register is set, instructing the compiler to invoke the
|
|
433 optimiser when it runs.
|
|
434
|
|
435 If you specify B<-O> and B<-poptimise> (see below), you are asking for
|
|
436 trouble, so don't do that.
|
|
437
|
|
438 =item B<--nooptimise>
|
|
439
|
|
440 Disables automatic preloading and execution of I<optimise.io>.
|
|
441
|
|
442 =item B<-o>I<name> / B<--output>=I<name>
|
|
443
|
|
444 Selects a name for the output file. Some character sequences are recognised
|
|
445 inside I<name>: I<%p> will be replaced by the source program's basename;
|
|
446 I<%s> will be replaced by the appropriate suffix for the selected backend,
|
|
447 I<%o> will provide the original file name specified on the command line,
|
|
448 without suffix (this can differ from I<%s> because I<%s> can be prefixed
|
|
449 with a directory from the search path) and I<%%> will produce a single I<%>.
|
|
450
|
|
451 The default is I<%p.%s>, which produces the object name described at the
|
|
452 beginning of this document. A suffix is not automatically added if the
|
|
453 output name does not contain I<%s>; this might be useful in ocnjunction
|
|
454 with the I<Perl> backend to produce a file without a suffix, for example:
|
|
455
|
|
456 sick --output=%p --backend=Perl sourcefile.i
|
|
457
|
|
458 will compile I<sourcefile.i> and produce perl script I<sourcefile>.
|
|
459
|
|
460 If the output file is specified as an empty string, the code generation step
|
|
461 will never be done.
|
|
462
|
|
463 =item B<-n>I<name> / B<--name>=I<name>
|
|
464
|
|
465 Sets the program's I<name>, if the code generator requires it (currently,
|
|
466 no backends use a name, but some of the planned ones will). The default is
|
|
467 I<%o>. The same %-escapes as defined for the output file name are defined.
|
|
468
|
|
469 =item B<-l>I<name> / B<--backend>=I<name>
|
|
470
|
|
471 Selects a different compiler back end. The default is I<Object>, which
|
|
472 produces a compiler object (suffix I<.io>). The distribution also includes
|
|
473 a I<Perl> backend, which produces an executable Perl program (suffix I<.pl>).
|
|
474 In addition, the pseudo backend I<Run> will run the program instead of
|
|
475 writing any object. In this case, the output file name is ignored. Note
|
|
476 that the program will only run if the compiler is in batch mode.
|
|
477 Other back ends can be provided as compiler plug ins. The distribution
|
|
478 also contains a I<ListObject> backend, which does not produce executables
|
|
479 but object listings. A future version might allow to "compile" the output
|
|
480 of the I<ListObject> back end, but this is currently impossible because not
|
|
481 all the internal state of the object is provided, only the part which is
|
|
482 likely to be useful to a human reader.
|
|
483
|
|
484 =item B<--bug>=I<number>
|
|
485
|
|
486 Selects a different probability for the compiler bug. The compiler bug is
|
|
487 implemented by initialising the compiler's state with the required probability:
|
|
488 when a statement is compiled (usually at runtime), a "BUG" instruction is
|
|
489 emitted with the required probability. The default is 1%.
|
|
490
|
|
491 =item B<--ubug>=I<number>
|
|
492
|
|
493 Selects a probability for the unexplainable compiler bug. This is the compiler
|
|
494 bug which occurs when the probability of a (explainable) compiler bug is zero.
|
|
495 Only wimps would use this option. The default is 0.01%.
|
|
496
|
|
497 =item B<-p>I<name> / B<--preload>=I<name>
|
|
498
|
|
499 Selects a compiler object to prefix to the program. If this option is
|
|
500 specified, the compiler won't automatically prefix objects as suggested by
|
|
501 the suffix. The program B<'oo, ick'> included in previous version of
|
|
502 CLC-INTERCAL used option B<-p> to select a parser. Since the main use of
|
|
503 preloads is to select an alternative (runtime) compiler, it is felt that
|
|
504 it is appropriate to keep the same letter for this option.
|
|
505
|
|
506 The file name specified does not include the suffix F<.io>, which is
|
|
507 always added. The file must be a compiler object, not source code.
|
|
508
|
|
509 The special object I<optimise> should always loaded via B<-O>. Using
|
|
510 B<-poptimise> will not necessarily put the object in the correct place,
|
|
511 and will not instruct the precompiler to do whatever magic it needs to
|
|
512 do to bootstrap the optimiser.
|
|
513
|
|
514 To completely disable preloading (this is only done when compiling the
|
|
515 optimiser, which is used to compile itself) use an empty string.
|
|
516
|
|
517 =item B<--nopreload>
|
|
518
|
|
519 Resets the default behaviour of selecting preloads based on suffixes.
|
|
520
|
|
521 =item B<--suffix>=I<suffix>
|
|
522
|
|
523 Specifies a suffix to use when selecting preloads. If this option is
|
|
524 not specified, the suffix is taken from the file name to be compiled.
|
|
525
|
|
526 =item B<-I>I<path> / B<--include>=I<path>
|
|
527
|
|
528 Adds a directory before the standard search path for compiler objects
|
|
529 and source code. If a file is accessible from the current directory,
|
|
530 it is never searched in any include path.
|
|
531
|
|
532 If this option is repeated, the given paths will be searched in the
|
|
533 order given, followed by the standard paths.
|
|
534
|
|
535 =back
|
|
536
|
|
537 =head2 Misc Options
|
|
538
|
|
539 =over 4
|
|
540
|
|
541 =item B<-r>I<name> / B<--rcfile>=I<name>
|
|
542
|
|
543 Executes commands from file I<name> before entering interactive mode.
|
|
544 This option can be repeated, to execute more than one file. If it is
|
|
545 not specified, the standard library, the current directory, and the
|
|
546 current user's home directory are searched for files with name
|
|
547 F<system.sickrc> or F<.sickrc>, which are then executed. The order
|
|
548 for this search is: specified library (B<--include>), system library,
|
|
549 home directory, current directory. This is different from the search
|
|
550 order used when looking for objects or source code. If a directory
|
|
551 contains both F<.sickrc> and F<system.sickrc>, the F<system.sickrc>
|
|
552 is executed first, followed by F<.sickrc>. Also note that if the
|
|
553 current directory or the home directory appear in the search path
|
|
554 and contain one of these files, they will be executed twice.
|
|
555
|
|
556 If filenames are explicitely specified, they must be fully qualified:
|
|
557 the search path is not used to find them.
|
|
558
|
|
559 =item B<--nouserrc>
|
|
560
|
|
561 Prevents loading a user rcfile (.sickrc); also limits loading of
|
|
562 system.sickrc to the first one found. This option is normally only
|
|
563 used during installation, to prevent interference from previous
|
|
564 versions of CLC-INTERCAL.
|
|
565
|
|
566 =item B<-v> / B<--verbose>
|
|
567
|
|
568 Tells everything it's doing (on Standard Error).
|
|
569
|
|
570 =item B<--stdverb>=I<file>
|
|
571
|
|
572 Sends verbose output to I<file>.
|
|
573
|
|
574 =item B<--trace>
|
|
575
|
|
576 Enables tracing; if compiling from source, the compiler is also
|
|
577 traced; to trace a program, compile it to an object and then run
|
|
578 it with B<--trace>.
|
|
579
|
|
580 =item B<--stdtrace>=I<file>
|
|
581
|
|
582 Enables tracing and selects an output file for the trace information.
|
|
583
|
|
584 =item B<--notrace>
|
|
585
|
|
586 Disables tracing; preloading I<trace.io> has priority over this option.
|
|
587
|
|
588 =item B<-q> / B<--quiet>
|
|
589
|
|
590 Stop talking to Standard Error.
|
|
591
|
|
592 =item B<--times>
|
|
593
|
|
594 Prints a summary of the time take for each major action. This setting is
|
|
595 independent of B<--verbose>.
|
|
596
|
|
597 =item B<--notimes>
|
|
598
|
|
599 Does not print execution times: this is the default.
|
|
600
|
|
601 =item B<--rclist>
|
|
602
|
|
603 Prints the names of all rcfiles found. It prevents starting interactive mode.
|
|
604 For example, the following command (which should work with I<any> Unix shell)
|
|
605 opens all the system and user sickrc files in your favourite editor:
|
|
606
|
|
607 sh -c '"${EDITOR:-vi}" "`sick --rclist`"'
|
|
608
|
|
609 This can be useful to update the defaults.
|
|
610
|
|
611 =back
|
|
612
|
|
613 =head1 BUGS
|
|
614
|
|
615 There are more options than ls(1). This is construed to be a feature.
|
|
616
|
|
617 =head1 SEE ALSO
|
|
618
|
|
619 The INTERCAL on-line documentation, by entering B<sick>'s interactive mode
|
|
620 and finding the "help" menu (X), key (Curses) or command (Line).
|
|
621
|