Pristine Ack-5.5
[Ack-5.5.git] / lang / m2 / comp / modula-2.1
1 .TH MODULA\-2 1 "$Revision: 1.10 $"
2 .ad
3 .SH NAME
4 Modula-2 \- ACK Modula-2 compiler
5 .SH SYNOPSIS
6 \fBack\fR \-m\fImach\fR files
7 .br
8 \fImach\fR files
9 .SH INTRODUCTION
10 This document provides a short introduction to the use of the ACK Modula-2
11 compiler. It also
12 mentions the location of definition modules for "standard" modules.
13 .SH FILENAMES
14 Usually, a Modula-2 program consists of several definition and implementation
15 modules, and one program module.
16 Definition modules must reside in files with names having a ".def" extension.
17 Implementation modules and program modules must reside in files having a
18 ".mod" extension.
19 .PP
20 The name of the file in which a definition module is stored must be the same as
21 the module-name, apart from the extension.
22 Also, in most Unix systems filenames are only 14 characters long.
23 So, given an IMPORT declaration for a module called "LongModulName",
24 the compiler will try to open a file called "LongModulN.def".
25 The requirement does not hold for implementation or program modules,
26 but is certainly recommended.
27 .SH CALLING THE COMPILER
28 The easiest way to do this is to let the \fIack\fR(1) program do it.
29 So, to compile a program module "prog.mod", just call
30 .nf
31         \fBack\fR \-m\fImach\fR prog.mod [ objects of implementation modules ]
32                 or
33         \fImach\fR prog.mod [ objects of implementation modules ]
34 .fi
35 where \fImach\fR is one of the target machines of ACK.
36 .PP
37 To compile an implementation module, use the \-\fBc\fR flag
38 to produce a ".o" file.
39 Definition modules can not be compiled; the compiler reads them when they are
40 needed. 
41 .PP
42 For more details on the \fIack\fR program see \fIack\fR(1).
43 .SH DEFINITION MODULES
44 "Standard" definition modules can be found in
45 the directory \fB~em/lib/m2\fR.
46 .PP
47 When the compiler needs a definition module, it is first searched for
48 in the current directory, then in the directories given to it by the
49 \-\fBI\fR flag
50 in the order given,
51 and then in the directory mentioned above.
52 .SH FLAGS
53 The \fIack\fR(1) program recognizes (among others) the following
54 flags, that are passed to the Modula-2 compiler:
55 .IP \fB\-I\fIdirname\fR
56 .br
57 append \fIdirname\fR to the list of directories where definition modules
58 are looked for. 
59 .IP \fB\-I\fP
60 don't look in
61 the directory \fB~em/lib/m2\fR.
62 .IP \fB\-M\fP\fIn\fP
63 set maximum identifier length to \fIn\fR. The minimum value of \fIn\fR
64 is 14, because the keyword "IMPLEMENTATION" is that long.
65 .IP \fB\-n\fR
66 do not generate EM register messages.
67 The user-declared variables will not be stored into registers on the target
68 machine.
69 .IP \fB\-L\fR
70 do not generate the EM \fBfil\fR and \fBlin\fR instructions that enable
71 an interpreter to keep track of the current location in the source code.
72 .IP \fB\-w\fR\fIclasses\fR
73 suppress warning messages whose class is a member of \fIclasses\fR.
74 Currently, there are three classes: \fBO\fR, indicating old-flashioned use,
75 \fBW\fR, indicating "ordinary" warnings, and \fBR\fR, indicating
76 restricted Modula-2.
77 If no \fIclasses\fR are given, all warnings are suppressed.
78 By default, warnings in class \fBO\fR and \fBW\fR are given.
79 .IP \fB\-W\fR\fIclasses\fR
80 allow for warning messages whose class is a member of \fIclasses\fR.
81 .IP \fB\-g\fR
82 produce a DBX-style symbol table.
83 .IP \fB\-x\fR
84 make all procedure names global, so that \fIadb\fR(1) understands them.
85 .IP \fB\-Xs\fR
86 make INTEGER ranges symmetric, t.i., MIN(INTEGER) = - MAX(INTEGER).
87 This is useful for interpreters that use the "real" MIN(INTEGER) to
88 indicate "undefined".
89 .LP
90 .SH SEE ALSO
91 \fIack\fR(1), \fIem_m2\fR(6), \fIm2mm(1)\fR
92 .SH FILES
93 .IR ~em/lib/em_m2 :
94 binary of the Modula-2 compiler.
95 .SH DIAGNOSTICS
96 All warning and error messages are written on standard error output.
97 .SH REMARKS
98 Debugging and profiling facilities may be present during the development
99 of \fIem_m2\fP.