⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mod.l

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 L
字号:
.\"#@(#)mod.l	4.1	Ultrix	7/17/90.TH MOD l "1 February 1984".SH NAMEmod \- Modula-2 compiler.SH SYNOPSIS.B mod[ options ] name ....SH DESCRIPTION.I Modis a Modula-2 compiler.It compiles one or more Modula-2 program 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.I a.out..PPEach program or implementation module must be in a separate file with a nameending with \*(lq.mod\*(rq.Each definition module must be in a separate file called \*(lqmodule.def\*(rq,where \*(lqmodule\*(rq is the name of the module.Object files ending with \*(lq.o\*(rq compiled with.I modor someother compiler may be specified..PPFile name arguments ending with \*(lq.pcd\*(rq and \*(lq.s\*(rq are assumed to be pcodeand assembly language files, respectively,and are translated and assembled into object files..PPThe following options are available:.TP 6.B \-cCreate object files but do not link them together..TP 6.B \-gGenerate additional symbol table information for the debugger.IR dbx (1)..TP 6.B \-iIgnore the fact that there are errors in some of the modulesand continue compiling the rest of them..TP 6.BR \-m "flags"Perform intermodule checking.If an out-of-date module is encountered, recompile it using thespecified \*(lqflags\*(rq.The flags are separated by commas or spaces, and must be quoted if spacesare used..TP 6.B \-nWrite out what will happen when the same command is enteredwithout the \*(lq-n\*(rq option..TP 6.BR \-o " name"Create an executable file called \*(lqname\*(rq instead of the default \*(lqa.out\*(rq..TP 6.B \-pgSet up object files for profiling by.IR  gprof (1)..TP 6.B \-rRetain pcode and assembly language files in the current directory aftercompilation..TP 6.B \-sUse standard conventions for reserved word case, cardinal data type, and strings(See Extensions, below)..TP 6.B \-scUse standard conventions for cardinal data type (See Extensions, below)..TP 6.B \-skUse standard conventions for reserved word case (See Extensions, below)..TP 6.B \-ssUse standard conventions for string constants (See Extensions, below)..TP 6.B \-uConvert all identifiers and reserved words to upper case (i.e., ignorethe case of identifiers and reserved words on input)..TP 6.B \-vPrint out messages saying what is happening during compilation..TP 6.B \-CGenerate runtime checks for illegal pointers, subrange and index bounds,and variant record tags..TP 6.BR \-D "directory"Use the specified directory for the phases of the compiler and thelocation of the standard definition modules and libraries..TP 6.B \-LWhile performing intermodule checking, ignore references to modulesnot specified.(This is useful when checking modules to be placed in a library)..TP 6.B \-MPerform intermodule checking, but do not recompile if inconsistenciesare found..TP 6.BR \-N nameWhile performing intermodule checking, ignore references to the module\*(lqname\*(rq.(This is useful when the module \*(lqname\*(rq is not a Modula-2 module.)This option may occur multiple times..TP 6.B \-OPerform code optimizations..TP 6.B \-PStop after generating pcode in a file ending with \*(lq.pcd\*(rq..TP 6.B \-SStop after generating assembly language in a file ending with \*(lq.s\*(rq..SH "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.MODPATH is set to a sequence of directory names separated by colons.Those directories will be searched in the order specified to find any 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 \*(lq.modpath\*(rq exists in the working directory, the .B 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..TPsystem.brBuiltin system module.  Contains types like word, address, etc., and processroutines..TPmemory.brBuiltin storage module.  Sets up pointers properly for runtime checks.Contains ALLOCATE and DEALLOCATE..TPio.brBuiltin I/O module that provides formatted read and write similar to.IR scanf (3)and.IR printf (3)..TPbitoperations.brBuiltin bit manipulation module.Performs operations such as shift, exclusive or, etc., on integer operands..TPmath.brMathematical functions.Interface to the C math library..TPparameters.brAccesses command line parameters and environment variables..TPstrings.brCompares, assigns, and concatenates strings..TPunix.brDefines some Unix system calls and C library routines..TPStorage.brStandard storage module, for compatibility with standard Modula-2.Contains ALLOCATE and DEALLOCATE..SH "DIFFERENCES AND EXTENSIONS"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 that compiler more portable.However, the definition of the language has been relaxed in some areas.For the most part, these changes are upward compatible..PPThe following is an incomplete list of differences between this compiler andWirth's compiler:.PPReserved words and standard identifiers are recognized in any case,not just in upper 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 builtin module called.I ioprovides formatted input and output.The.I Readfand.I Writefroutines can accept any number of parameters, so 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 desire checking will normall import allocate and 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:.TPmin(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.See Using Modula-2 with Unix C and Berkeley Pascal for more details..TPExportsExports from a definition module are assumed qualified whether the exportstatement says qualified or not.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, respectively.See Using Modula-2 with Unix C and Berkeley Pascal for more details..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.See Using Modula-2 with Unix C and Berkeley Pascal for more details..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 DIAGNOSTICSAll error messages suppress subsequent compilation phases.Error messages ending with a question mark are internal errors, andprobably represent compiler bugs.When pointer checking is enabled in a running 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 AUTHORMichael L. Powell.brDigital Equipment Corporation.brWestern Research Laboratory.br4410 El Camino Real.brLos Altos, CA  94022.brMail: powell@decwrl.csnet or {decvax,ucbvax}!decwrl!powell.PPSoftware and documentation isCopyright 1984, Digital Equipment Corporation,Maynard, Massachusetts.All rights reserved.This software is provided under license agreement and must be kept confidential..SH LIMITATIONSThis 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.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -