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

📄 cdg.l

📁 reads a set of C-source files and generates a two-column listing of those sources
💻 L
字号:
.TH CDG L "14\ Jan\ 1996" "Release\ 1.0".UC 4.SH NAMECDG \- A C Documentation Generator..SH SYNOPSIS.B cdg\fIlistfile\fP[ \fItagfile\fP ].SH DESCRIPTIONCdg is a program that produces two-column listings with numbered lines andthree-column cross reference tables in landscape mode on suitable printers.Lines in the source files that were wider than 80 characters are broken atposition 80 with a backslash added in position 81. Tabs are expanded intospaces. Trailing spaces and tabs are ignored..PPThe cross reference table lists for each name the line-numbers where thatname is used. Line-numbers where the name gets defined or declared are outputin bold-face (or otherwise highlighted, depending on the capabilities ofthe printer).  \fBCdg\fP sends the formatted output to \fIstdout\fP..brThe format of the output was inspired on the format used in"Source Code and Commentary on UNIX level 6" by John Lions..SH FORMAT OF THE LISTFILEThe \fIlistfile\fP is a plain ASCII file that consists of four parts:.TPIdentification of the output (3 lines)This text will be appear on the footer of every output page. These linescan be used for copyright messages and/or to identify the product to whichthe source files belong. The first two lines may have a length of up to 180characters, the third may have a length of no more than 156 charactersbecause the current date and time are printed after that..TPTypes for the cross reference table (optional, one line)This line describes what types of words must be cross referenced,see below at \fISelecting types for cross reference table\fP..TPNames to exclude (any number of lines)Each of these lines lists one word that must be excluded from the crossreference table. Each of these lines consist of a dash followed by one word..TPNames of the source files (any number of lines)Any number of lines, each containing the name of a source file to be includedin the documentation..PPAn example \fIlistfile\fP for the sources of the \fBcdg\fP program lookslike this:.brCDG is a C-source Documentation Generator..brCDG used on it's own sources yields this document..brCDG is distributed under the GNU GPL conditions..brMakefile.brcdg.h.brmain.c.brpage.c.bry.tab.h.brparse.c.brscan.h.brscan.l.PPAn example \fIlistfile\fP (very similar to this one) is included in thedistribution of \fBcdg\fP..SH OPTIONS.TP\fItagfile\fPPreserve the list of all identifiers in a file named \fItagfile\fP..SH SELECTING TYPES FOR CROSS REFERENCE TABLEThis is done with a line in the \fIlistfile\fP. This line consists of thesymbol \fB+\fP followed by letters which indicate types of identifiers tobe included in the cross reference table. Default is all types, exceptparameters in extern function declarations. The types are:.TP\fBT\fPNames that are typedef-d..TP\fBt\fPNames that are types..TP\fBF\fPNames of functions being defined..TP\fBC\fPNames of function being called..TP\fBD\fPNames of identifiers being declared..TP\fBR\fPNames of identifiers being referenced (used)..TP\fBd\fPNames of parameters in an extern function declaration..TP\fBM\fPMacro names being defined..TP\fBm\fPNames being referenced in a preprocessor directive..TP\fBN\fPConstant being defined in an enum list..TP\fBE\fPNames of extern variables..SH SUPPORTED PRINTERSThree types of output-device are currently supported.The actual type is determined at compile-time.Adding support for other printers should not be verydifficult for programmers with sufficient determination..TP\fBPostScript\fP tmAdobe's page makeup language. This can be printed on PostScript printersand with the use of the \fBgs(1)\fP program on many other devices. Anattempt is made to activate duplex (double-sided) printing..TP\fBHP-LaserJet\fPShould work on most HP laser printers. This has been tested on theLaserJet IID and the LaserJet IIISi printer. On printers that are equippedwith the right gears and rollers (this is an option on some models) duplex(double-sided) printing is activated..TP\fBHP-DeskJet\fPWorks on the DeskJet 500 printer but not on many later models.It also gives good (preview) results when displayed with recent versionsof the \fBless(1)\fP program in very wide (180 column) xterm windows.\fBLess\fP version 290 is recent enough..SH FORMAT OF THE TAGFILEThe \fItagfile\fP consists of one line for each name that was found in thesource listings. The order in which the names appear is identical to theorder in which the parser found them in the source files. If a word appearsseveral times on one source line, it will appear several times in the\fItagfile\fP (but only once in the cross reference table). Each line inthe \fItagfile\fP consists of 3 fields separated by a tab character..TP\fBlinenumber\fPThe line number (where the name can be found in the source listings part ofthe output of \fBcdg\fP). The \fBlinenumber\fP occupies 6 positions; leadingspaces are used..TP\fBtype\fPThe type of the object that the name refers to (see the list in the section\fISelecting types for cross reference table\fP above)..TP\fBname\fPThe name of the object (truncated to 80 characters)..SH LIMITATIONS.TP\fB-\fPOnly files with names ending on \fB.c\fP, or \fB.h\fP are cross-referenced.However, other files will be included in the listing..TP\fB-\fPAll source files must have balanced braces, parentheses and brackets. Certainconstructions with \fB#ifdef\fP, \fB#else\fP and \fB#endif\fP that violatethis restriction should be rewritten anyway. If the \fBindent(1L)\fP programlikes the source files, there is a good chance that \fBcdg\fP will like themtoo..TP\fB-\fPThe number of lines in the listing section must be less than 999.900(the number of lines in each individual file is rounded up to thenext multiple of 50), because no linenumber may exceed 6 digits and nopage number may exceed 4 digits..TP\fB-\fPIdentifiers longer than 58 characters will be truncated in the cross referencelisting. Identifiers longer than 80 characters which are identical in thefirst 80 characters are treated as one and the same for the crossreference table..TP\fB-\fPThe method used to identify the type of a word is not perfect. This iscaused by the fact that the parser examines each file separately anddoes not examine any #include-d files, nor learn any type-names. There is(at least) one case where the parser can not be sure whether a word is anidentifier or a type. In.br\fB(\fP\fIword\fP\fB) - \fP\fIexpression\fP.brthe parser will assume that \fIword\fP is a type and the minus is the negationoperator. The other solution (not taken) is that \fIword\fP is a parenthesizedexpression (where the parentheses are apparently redundant) and the minus isthe subtraction operator. For the cross reference table the choice isirrelevant (provided that both types are included or both are excluded).If you use the \fItagfile\fP option to preserve the list of identifier tagsyou should be aware of this problem..TP\fB-\fPAll filenames must be no longer than 41 characters and may not contain spaces,tabs, etc..TP\fB-\fPThe C-parser of \fBcdg\fP treats ANSI C-prototypes exactly like functiondefinitions; there is currently no way to exclude only the C-prototypesfrom the cross reference table..TP\fB-\fPAll identifiers appear in the \fItagfile\fP, even those that should be excludedaccording to the \fIlistfile\fP. However for each excluded word there isan extra entry at the beginning of the \fItagfile\fP of type \fBX\fP andwith linenumber \fB0\fP..TP\fB-\fPPrinter selection must be done at compile-time..TP\fB-\fPA4-size paper is assumed for all printers except PostScript..TP\fB-\fPTo sort the identifier tags \fBcdg\fP invokes the \fBsort(1)\fP program.Therefore \fBsort\fP must be in the search-path. This use of an externalprogram will make it a bit harder to port \fBcdg\fP to other operating systems..SH FILESAll the files mentioned here are automatically removed when the program exits,except the \fItagfile\fP if an alternate name was specified on the commandline..TP/tmp/cdgL*The source listing (with numbered, broken lines). Each source fileis preceded by one line that contains a dash followed the name of thenext source file, two spaces and the modify-date and -time of the file..TP/tmp/cdgT*The list of all identifier tags (unless overridden by the \fItagfile\fPoption)..TP/tmp/cdgS*The sorted list of all identifier tags..SH REVISION HISTORYThe initial version (0.0) was written by Peter Knoppers<Peter.Knoppers@ct.tudelft.nl> during the Xmas holidays of December 1995,except for the lexical scanner which was derived from a public domainC-parser written 10 years earlier by Scott Lee..brAdding PostScript and HP-LaserJet printer output and fixing some errorsin the recognition of enums increased the version number to 1.0 inJanuary 1996..brIn August 1996 version 1.1 was made public. This version fixed a fewbugs in the parse and the scanner. Support for US Letter sized paperwas added (but only for PostScript printers). An attempt is made toactivate double-sided printing on PostScript printers. This may notwork for all PostScript printers..SH DISTRIBUTIONThe most recent version of \fBcdg\fP can be found through a link on PeterKnoppers' WWW home-page which is (currently) located at URL:.brhttp://cardit.et.tudelft.nl/~knop.PPThis program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2 of the License, or(at your option) any later version..PPThis program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details..PPYou should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

⌨️ 快捷键说明

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