Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
cref_license.txt | 2008-02-16 | 15.0 kB | |
cref_readme.txt | 2008-02-16 | 3.9 kB | |
Totals: 2 Items | 18.9 kB | 0 |
Delphi Cross-reference Read-me ------------------------------ Date: February 15, 2008 Author: Hector Castro Web site: http://www.great-web-info.com License: GNU General Public License Disclaimer This program may be used and copied freely without charge, but only for non-commercial purposes. The author is not responsible for any damage or loss of data that may be caused by using it. Background This program was written out of the need for a simple utility that make a cross-reference listing of a single Delphi program without any reference to other units. Having searched on the Internet for such a utility, none was found that meet the requirements of considering Delphi's comments beginning with a double slash, and that did not include text that was written between quotation marks. The closest hit was PASCREF (Pascal Cross-Reference generator), version 2.3 dated on February 19, 2000, by J R Ferguson. As all other programs were less apt than Ferguson's, I will refer only to this. Pascref recognizes standard Pascal keywords as reserved, but does not recognize the new keywords introduced with Delphi, like for example: add break byte clear close continue copy count create delete except exit halt inc insert items length overload pos result single try word Some of these keywords are variable types and other are common procedures that because of their frequent use is desirable to consider them as reserved. Moreover, Pascref indexes words that are within comments, which obviously is not what one has in mind when making a cross-reference. For example, from this program program sample; { this is a sample program } // you may not decompile var i: integer; // this program begin { it is very secret } i := 2; end. it produces this listing DECOMPILE 4 I 6 8 MAY 4 PROGRAM 1 6 SAMPLE 1 THIS 6 YOU 4 Consequently, a program was made using as base algorithm the one proposed by Niklaus Wirth in his 1975 book, "Algorithm+data=programs". Some idiosyncrasies of the program derive from this origin. The list of reserved keywords was extracted to a text file that can be modified by the user to include his favorite ones. Usage instructions The program can be run using this command line: cref [<input_file>] [<output_file>] If the extension is omitted in <input_file>, it is assumed to be .PAS. Both parameters are optional. If no parameters are given, the program asks for them. If only one parameter is given, the program asks the second one. If it is omitted, it is assumed to be "out.txt". The output of the program is a text file containing a source listing with line numbers and the cross-reference itself. The tab characters in the source file are expanded to four spaces. This can be modified by altering the constant NTAB. The list of reserved keywords is in the file PASCAL.LTG that can be modified by the user to include his favorite keywords (up to 100). If more than this number is desired, the constant "c5" must be altered. The maximum length of an indexed word is of 25 characters. If this represents a trouble, the constant "c1" can be changed. The maximum number of lines in the source file is set in the "c4" constant to be of 1000 lines. Warning When modifying this program, do not compile it with the Delphi GUI, use the command line compiler instead. It has been found that (at least in one version of Delphi) there exist discrepancies in the way the end of line is treated. This program can also be compiled with Free Pascal (FPC). To-do list Possible future enhancements to this program are a switch to let the user alter the number of spaces per tab, and another to suppress the source listing.