📄 mod.1
字号:
.TH mod 1 VAX "" Unsupported.SH Namemod \- Modula-2 compiler.SH Syntax.B mod[ \fIoptions\fP ] \fIname\fP ....SH Description.NXS "Modula-2 compiler" "mod command".NXB "mod command".NXB "Modula-2 program" "compiling"The .PN modcommandcompiles one or more Modula-2 programs or implementation modules.Definition modules are not compiled.In the absence of options, it will compile all specified modules and linkthem together into an executable file called.PN a.out..PPEach program or implementation module must be in a separate file with a nameending with .mod.Each definition module must be in a separate file called module.def where module is the name of the module.Object files ending with .o compiled with.PN modor someother compiler may be specified..PPFile name arguments ending with .pcd, and .s, are assumed to be \-pcodeand assembly language files respectively,and are translated and assembled into object files..SH Options.NXR "mod command" "options".IP \fB\-c\fRCreate object files but do not link them together..IP \fB\-g\fRGenerate additional symbol table information for the debugger.MS dbx 1 ..IP \fB\-i\fRIgnore the errors in some of the modulesand continue compiling the rest of them..IP "\fB\-m \fRflags"Perform intermodule checking.If an out-of-date module is encountered, recompile it using thespecified .I flags.The flags are separated by commas or spaces, and must be quoted if spacesare used..IP \fB\-n\fRWrite out what will happen when the same command is enteredwithout the \*(lq-n\*(rq option..IP "\fB\-o \fIname\fR"Create an executable file called \*(lqname\*(rq instead of the default \*(lqa.out\*(rq..IP \fB\-pg\fRSet up object files for profiling by.MS gprof 1 ..IP \fB\-r\fRRetain pcode and assembly language files in the current directory aftercompilation..IP \fB\-s\fRUse standard conventions for reserved word case, cardinal data type, and strings.See Extensions below..IP \fB\-sc\fRUse standard conventions for cardinal data type (See Extensions, below)..IP \fB\-sk\fRUse standard conventions for reserved word case (See Extensions, below)..IP \fB\-ss\fRUse standard conventions for string constants (See Extensions, below)..IP \fB\-u\fRConvert all identifiers and reserved words to upper case (that is, ignorethe case of identifiers and reserved words on input)..IP \fB\-v\fRPrint out messages which state what is occurring during compilation..IP \fB\-C\fRGenerate runtime checks for illegal pointers, subrange and index bounds,and variant record tags..IP "\fB\-D \fIdirectory\fR"Use the specified directory for the phases of the compiler and thelocation of the standard definition modules and libraries..IP \fB\-L\fRIgnore references to modulesnot specified while performing intermodule checking.This is useful when checking modules to be placed in a library..IP \fB\-M\fRPerform intermodule checking, but do not recompile if inconsistenciesare found..IP \fB\-N\fR \fIname\fRIgnore references to the modulename while performing intermodule checking.This is useful when the module name is not a Modula-2 module.You may use this option as many times as needed..IP \fB\-O\fRPerform code optimizations..IP \fB\-P\fRStop after generating pcode in a file ending with .pcd. .IP \fB\-S\fRStop after generating assembly language in a file ending with .s..SH Library Modules.NXR "mod command" "library modules"By default, an import of a global module will cause the compiler to look forthe definition module firstin the working directory and then in the standard library directory.The standard library modules are automatically linked with the program..PPThe default may be overridden to specify other directories of definition modulesusing the MODPATH environment variable..NXR "MODPATH environment variable" "setting"MODPATH is set to a sequence of directory names separated by colons.Those directories will be searched in the order specified to find a definitionmodule.The corresponding object files or libraries are specified when linking.The MODPATH environment variable may be set by the userin .login or in .modpath in the working directory.If the file .modpath exists in the working directory, the .PN modcommand will use its first line as the value of the MODPATH variable..PPThe following modules are provided by this implementation of Modula-2.Note that system, memory, io, and bitoperations are builtin modules;definition modules for them are provided for documentation purposes only.Only strings and parameters are actually implemented in Modula-2..TP 12systemBuilt in system module. Contains types of what word, address, etc., and processroutines..TPmemoryBuilt in storage module. Sets up pointers properly for runtime checks.Contains ALLOCATE and DEALLOCATE..TPioBuilt in I/O module that provides formatted read and write similar to.MS scanf 3and.MS printf 3 ..TPbitoperationsBuilt in bit manipulation module.Performs operations such as shift, exclusive or, etc., on integer operands..TPmathPerforms mathematical functions.Interface to the C math library..TPparametersAccesses command line parameters and environment variables..TPstringsCompares, assigns, and links strings..TPunixDefines some UNIX system calls and C library routines..TPStorageStandard storage module, for compatibility with standard Modula-2.Contains ALLOCATE and DEALLOCATE..SH Differences And Extensions.NXR "mod command" "Wirth's compiler and"This implementation of Modula-2 has compiled and run Wirth's Modula-2 compiler(as modified by Cambridge University for the VAX) with only minor changesto make Wirth's compiler more portable.However, the definition of the language has been relaxed in some areas.For the most part, these changes are compatible..PPThe following is an incomplete list of differences between this compiler andWirth's compiler:.PPReserved words and standard identifiers are recognized in upperand lower case,Thus, case variations of reserved words may not be used for identifiers.This feature is disabled by the.B \-skoption..PPCardinal and non-negative subranges that do not exceed MAXINT are consideredto be subranges of integer and are compatible with integers.Subranges that exceed MAXINT are compatible with cardinal and non-negativesubranges.This feature is disabled by the.B \-scoption..PPA built in module called.I ioprovides formatted input and output.The.I readfand.I writefroutines can accept any number of parameters, as long as their typescorrespond properly with the format string.Supported formats include: for integer and cardinal,.BR d ,.BR x ,and.BR o ;for real,.B g(output only),.BR f ,and.BR e ;for longreal,.B G(output only),.BR F ,and.BR E ;for char,.BR c ;andfor string (array of char),.B sand[] (input only)..PPNo import of.I allocateor.I deallocateis required to use new and dispose if the standard memory allocation routinesare desired.Programs that require checking import .I allocate and .I deallocatefrom memory rather than storage..PPThe sizes returned by.I sizeand.I tsizeand expected by.IR allocate ,.I deallocateand.I newprocessare in units of bits..PPThe.I systemmodule includes the type.IR byte ,which is analogous to.IR word ,as well as appropriate related constants.There is also a function cputime, which returns the accumulated programCPU time in milliseconds..PPThere is a standard type called.I longrealthat stores a double precision real value.A standard function longfloat converts cardinals, integers, or reals to longreal..PPAdditional standard procedures include:.TP 12min(a,b)Returns the smaller of two cardinal, integer, real, or longreal values..TPmax(a,b)Returns the larger of two cardinal, integer, real, or longreal values..TPassert(condition[,message])Aborts the program (with the optional message)if the condition is false..TPnumber(a)Returns the number of elements in the specified array..TPfirst(type)Returns the smallest legal value of the specified type..TPlast(type)Returns the largest legal value of the specified type..PPDefinition modules are not compiled..PPEscape sequences may be placed in strings to specify non-printing characters.E.g., \en, \et, \er, \ef, \eb, \e\e, \e', and \e" meanlinefeed, tab, carriage return, form feed, backspace, backslash,single quote, and double quote, respectively.In addition a \e followed by up to three octal digits specifies thethe character whose ASCII code is the octal value.A single (double) quote also may be put in a string delimited withsingle (double) quotes by specifying two single (double) quotes.This feature is disabled by the.B \-ssoption..PPThe interface to Unix is through a module called.I unixrather than the.I systemmodule.The.I unixcallprocedure is handled for compatibility with the Cambridge compiler,but is not recommended..PPAdditional keywords are recognized in certain contexts.These keywords are prefixed by @ to avoid conflicting with valididentifiers..TPPointer attributesAttributes may be specified between the keywords.I pointerand.I toin order to change the default assumptions of Modula-2 pointer with checking.Recognized attributes are:.br.ta 2i@nocheck Modula-2 pointer, no checking.br@c C/malloc pointer, no checking.br@pascal Pascal pointer, Pascal checking.TPSize and alignmentThe size and alignment of data types may be specified preceding anytype specification.The size and alignment multiples are in bits.For example,.br type Register = @align 2 @size 4 [-8..7];.brdefines a type that occupies 4 bits aligned on a multiple of two bits..TPExportsExports from a definition module are assumed qualified. Unqualified exports are permitted if the @unqualified keyword is used.Multiple export statements are permitted, but they must occur next toeach other..TPExternal variables and proceduresA procedure or variable may be accessed by C and Pascal routines usingits unqualified name if the @external attributeoccurs between the keyword procedure and the name of the procedure orprecedes the variable declaration. .TPUncounted open arraysOpen array parameters appear as two parameters, the address of the array andthe number of element-to-non-Modula-2 programs.If necessary, the count may be omitted by placing the attribute @nocountbetween the keywords.I arrayand.I ofin the open array declaration..SH Restrictions .NXR "mod command" "restricted"This is an experimental compiler, and thus no warranties are expressed orimplied about its conformance to the definition of the Modula-2 languageor about its proper functioning.We will endeavor to report and fix bugs, but users should be aware that thiscompiler is not a supported product..SH Diagnostics.NXR "mod command" "diagnostics"All error messages suppress subsequent compilation phases.Error messages ending with a question mark are internal errors, andprobably represent compiler bugs.When pointer checking is running in a Modula-2 program,segmentation faults may be generated by the pointer validation test.These are intentional and should be considered as invalid pointer messages. The compiler runs with runtime checks enabled, and may produce core dumps.Report problems to the author..SH Files.ta 2.6ifile.mod Program or implementation module.brfile.def Definition module.brfile.pcd Pcode (\-P or \-r).brfile.s Assembly code (\-S or \-r).br/usr/local/lib/mod/mod2.0 Modula-2 compiler front-end.br/usr/local/lib/mod/mod2.1 Modula-2 compiler back-end.br/usr/local/lib/mod/mod2.2 Intermodule checker.br/usr/local/lib/mod/*.def Standard definition modules.br/usr/local/lib/mod/modlib Default library.br/tmp/modNNNNNN.pcd Temporary Pcode file.br/tmp/modNNNNNN.s Temporary assembly code file.\" .SH "SEE ALSO".\" N. Wirth,.\" .IR "Programming in Modula-2" ,.\" Springer-Verlag, New York, 1982..\" .SH AUTHOR.\" Michael L. Powell.\" .br.\" Digital Equipment Corporation.\" .br.\" Western Research Laboratory.\" .br.\" 4410 El Camino Real.\" .br.\" Los Altos, CA 94022.\" .br.\" Mail: powell@decwrl.csnet or {decvax,ucbvax}!decwrl!powell.\" .PP.\" Software and documentation is.\" Copyright 1984, Digital Equipment Corporation,.\" Maynard, Massachusetts..\" All rights reserved..\" This software is provided under license agreement and must be kept confidential..NXB "mod command".NXB "Modula-2 program" "compiling"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -