- DISQLite3 3.1.2 – Change default database schema from 1 to 4, new powersafe overwrite, new functions like sqlite3_stmt_busy(), bug fixes.
|
|
Table of Contents
DIPPDIPP is a Pascal Preprocessor to manipulate Pascal source code files. DIPP is a tiny console application suitable for batch processing. It returns an exit code <> 0 on error. DIPP reads, processes and writes one file at a time, performing minimal syntax check as it goes. Output files can then be passed on to Pascal compilers. DIPP can
DIPP is useful to
Usage and Syntax
To run DIPP, open a console window, type
C:\DIPP>DIPP
The Delphi Inspiration Pascal Preprocessor Version 1.2
Copyright (c) 2003-2007 Ralf Junker, The Delphi Inpiration
http://www.yunqa.de/delphi/
Syntax: DIPP.exe [options] <INFILE> <OUTFILE>
-$[<+|-><sym>[;<sym>]] Remove directives / keep/remove by wildcards
-ai[<file>[;<file>]] Add / insert include files [specific files]
-C[1] Remove comments [but keep 1st comment]
-c Process Conditionals
-d<sym>[;<sym>] Define conditionals
-h[<+|-><sym>[;<sym>]] Remove conditionals / keep/remove by wildcards
-i<path>[;<path>] Include directories
-n Interface only (up to implementation identifier)
-o Overwrite existing file
-p<Pascal compiler> Imitate Pascal compiler conditional defines:
Delphi: D, D32, D1-7
Kylix: K, K1-3
C++Builder: C, C32, C1, C3-6
-ri[<FILE>[;<FILE>]] Read Include files [specific files]
-si[<FILE>[;<FILE>]] Skip Include files [specific files]
-t[i] Time stamp outfile to infile [or latest include]
Preprocessing Pascal files with DIPP requires you to enter both an input file and an output file. DIPP reads from the input file and writes the processed Pascal source code to the output file: C:\DIPP>DIPP infile.pas outfile.pas The Delphi Inspiration Pascal Preprocessor Version 1.2 Copyright (c) 2003-2007 Ralf Junker, The Delphi Inpiration http://www.yunqa.de/delphi/ In: infile.pas Out: outfile.pas Processed 6523 lines in 10 ms. Without options, DIPP doesn't really process infile.pas except for some minor formatting like removing multiple line breaks. To turn on real preprocessing, you need to specify one or more of the following options: -$ Remove Compiler DirectivesRemoving compiler directives can be used to adjust Pascal sources to older compilers which do not support all directives of the latest Pascal versions. Directives do not include conditionals and switches.
Multiple directives can be separated by semicolon ';':
Directive names can also contain wildcards '*' and '?'. Wildcards allow to remove groups of directives with start or end with particular characters.
-c Process ConditionalsEnables processing of conditional compiler directives. With conditionals enabled, DIPP skips over code enclosed by undefined conditionals, inserts include files depending on defined conditionals. In other words: DIPP treats your sources like a Pascal compiler would do. Conditional directives include:
Do not confuse -c (lower case) with the -C (upper case) option, which removes comments. -C Remove Comments
Do not confuse -C (upper case) with the -c (lower case) option, which enables processing conditionals. | -d Define ConditionalsDefines conditional symbols, just like the DCC32 command line compiler. Separate multiple defines with a semicolon ';'.
-h Remove ConditionalsRemoving compiler directives from Pascal sources can be used to clean them up for easier debugging or to create sources for specific Pascal compilers. Conditionals do not include directives and switches. To remove conditionals, you must instruct DIPP to process conditionals in the first place.
Multiple directives can be separated by semicolon ';':
Directive names can also contain wildcards '*' and '?'. Wildcards allow to remove groups of conditionals with start or end with particular characters.
-i Include DirectoriesThe -I option lets you specify a list of directories in which DIPP searches for include files. Separate multiple defines with a semicolon ';'. DIPP starts searching for include files at the current directory, then at the first directory specified, then the 2nd, and so on.
-n Interface Only-n Outputs the interface part of a Pascal unit only. The implementation part will not be included. -p Pascal CompilerCauses DIPP to imitate a particular Pascal compiler by setting and selected conditional compiler symbols.
-ai Add / Insert Include Files-ai is one of the options to specify handling of include files. -ai causes DIPP to insert all include files into the output file. If enabled, DIPP also processes conditionals for all inserted include files.
You can fine-tune the -ai option by appending one or multiple file names, separated by semicolon ';', which instructs DIPP to insert only those include files specified. Include file names may contain wildcards.
If DIPP can not find an include file and open it for reading, it will terminated with an error. To solve the problem, set the include directories. -ri Read Include Files-ri causes DIPP to read the contents of include files. If enabled, DIPP processes conditionals for all include files which DIPP reads. However, simply reading will not insert the include files' contents into the output file.
You can fine-tune the -ri option by appending one or multiple file names, separated by semicolon ';', which instructs DIPP to read only those include files specified. Include file names may contain wildcards.
If DIPP can not find an include file and open it for reading, it will terminated with an error. To solve the problem, set the include directories. -si Skip Include Files-si causes DIPP to skip all include files.
You can fine-tune the -si option by appending one or multiple file names, separated by semicolon ';', which instructs DIPP to skip only those include files specified. Include file names may contain wildcards.
Skipping an include file does not require DIPP to be able to locate it and open it for reading. -t Time Stamp OutputFile The -t option instructs DIPP to set the time stamp of the output file to that of the input file.
With the additional option -ti, DIPP calculates the new timestamp from the input file as well as all include files inserted and read.
ExamplesThe following example file contains comments, conditional defines, compiler directives and an implementation section. Let's see how we can use DIPP to modify it. { Copyright (c) 2003-2007 Ralf Junker, The Delphi Inpiration } { This is a test unit for DIPP. } unit Test; {$HPPEMIT '#include "common.h"'} {$IMAGEBASE $00400000} interface {$IFDEF MSWINDOWS} const OS = 'MS Windows' ; {$ENDIF} {$IFDEF LINUX} const OS = 'Linux' ; {$ENDIF} implementation {$IFDEF Debug} initialization WriteLn( '!!! Debug Mode !!!' ); {$ENDIF} end. Removing all comments, the file looks like: C:\DIPP>DIPP -C test.pas out.pas unit Test; {$HPPEMIT '#include "common.h"'} {$IMAGEBASE $00400000} interface <SNIP> Removing all but the 1st comment, the file looks like: C:\DIPP>DIPP -C1 test.pas out.pas { Copyright (c) 2003-2007 Ralf Junker, The Delphi Inpiration } unit Test; {$HPPEMIT '#include "common.h"'} {$IMAGEBASE $00400000} interface <SNIP>
This will remove all comments but the 1st, and also remove the C:\DIPP>DIPP -C1 -$-HPPEMIT test.pas out.pas { Copyright (c) 2003-2007 Ralf Junker, The Delphi Inpiration } unit Test; {$IMAGEBASE $00400000} interface <SNIP>
Next we want to remove all comments ( C:\DIPP>DIPP -C -$ -h -c test.pas out.pas unit Test; interface implementation end.
Why is the file almost empty? DIPP does, by default, not know about the Pascal compiler. Imitating Delphi 6 ( C:\DIPP>DIPP -C -$ -h -c -pD6 test.pas out.pas unit Test; interface const OS = 'MS Windows' ; implementation end.
Now imagine creating a Debug build by defining the C:\DIPP>DIPP -C -$ -h -c -pD6 -DDebug test.pas out.pas unit Test; interface const OS = 'MS Windows' ; implementation initialization WriteLn( '!!! Debug Mode !!!' ); end.
Last but not least, we will create an interface file (-n) for Kylix ( C:\DIPP>DIPP -C1 -h -c -n -pK test.pas out.pas { Copyright (c) 2003-2007 Ralf Junker, The Delphi Inpiration } unit Test; {$HPPEMIT '#include "common.h"'} {$IMAGEBASE $00400000} interface const OS = 'Linux' ; implementation products/dipp/index.txt · Last modified: 2007/12/21 16:14 (external edit)
|
| Copyright (c) 2000-2011 Ralf Junker – http://www.yunqa.de/delphi/ – Disclaimer – Haftungsausschluss – Impressum |