* contrib/dot/pp.txt
* Corrected typos.
* include/hbpcode.h
* Corrected comments for HB_P_MACROLIST and HB_P_MACROLISTEND
78 lines
2.9 KiB
Plaintext
78 lines
2.9 KiB
Plaintext
PP has 3 personalities which are tied tightly together.
|
|
|
|
1. What is supposed to be 100% Clipper compatible Pre-Processor. Executing
|
|
PP followed by a source file name and the -P switch, will create
|
|
<filename.pp$> which is the equivalent of the Clipper <filename.ppo> file.
|
|
In this mode there are few optional switches.
|
|
|
|
PP filename[.ext] [-U][-DM][-DE][-DP][-CCH]
|
|
|
|
-U = Don't load standard rules.
|
|
-DM = Show tracing information into the Match Engine.
|
|
-DE = Show tracing information into the Expression Scanner.
|
|
-DP = Show tracing information into the Output Generator.
|
|
-CCH = Generate a .cch file (compiled command header).
|
|
|
|
2. DOT prompt, which suppose to allow most of Harbour syntax. Please
|
|
report any syntax you expect to work, but is not supported.
|
|
|
|
It does support IF [ELSE] [ELSEIF] ENDIF in DOT environment.
|
|
|
|
Executing PP with no source filename will start the DOT prompt mode. In
|
|
this mode you can execute a single line at a time, by typing the line
|
|
and pressing the [Enter] key.
|
|
|
|
Additionally you may type:
|
|
|
|
DO filename.prg [Enter]
|
|
|
|
So that DOT will "run" the specified source file. This interpreter
|
|
mode is subject to few limitations:
|
|
|
|
a. It does support LOCAL/STATIC/PRIVATE/PUBLIC, but:
|
|
|
|
- STATICs are actually implemented as publics.
|
|
|
|
- LOCALS have scoping of locals but are implemented as privates
|
|
so you can't have a LOCAL and a PRIVATE with the same name.
|
|
|
|
b. Non declared variable are auto-created on assignment in Harbour
|
|
but NOT in Clipper (yet).
|
|
|
|
c. It does support definition and execution of prg defined
|
|
FUNCTIONs/PROCEDUREs.
|
|
|
|
d. It does support ALL control flow structures *except* BEGIN
|
|
SEQUENCE [BREAK] [RECOVER] END SEQUENCE.
|
|
|
|
e. The executed module is compiled with -n option (for now).
|
|
|
|
This will create rp_dot.pp$ compilation trace file.
|
|
|
|
3. Finally, PP is a limited Harbour Interpreter. Subject to those same few
|
|
limitations it can execute most of Harbour syntax. Executing PP followed
|
|
by a source file name and the -R switch, will "RUN" that source (it will
|
|
also create the rp_run.pp$ compilation trace file).
|
|
|
|
This syntax is:
|
|
|
|
PP filename[.ext] -R
|
|
|
|
a. It does support LOCAL/STATIC/PRIVATE/PUBLIC, but:
|
|
|
|
- STATICs are actually implemented as publics.
|
|
|
|
- LOCALS have scoping of locals but are implemented as privates
|
|
so you can't have a LOCAL and a PRIVATE with the same name.
|
|
|
|
b. Non declared variable are auto-created on assignment in Harbour
|
|
but NOT in Clipper (yet).
|
|
|
|
c. It does support definition and execution of prg defined
|
|
FUNCTIONs/PROCEDUREs as well as parameter passing and return values.
|
|
|
|
d. It does support ALL control flow structures *except* BEGIN
|
|
SEQUENCE [BREAK] [RECOVER] END SEQUENCE.
|
|
|
|
e. The executed module is compiled with -n option (for now).
|