Thanks for reviewing xbScript, a full featured xHarbour (and xBase variations)
Interpreter, Dot Prompt Console, and Clipper/xHarbour compatible Pre-Processor.
xbScript
-----------

Script Interpreter/ Dot Prompt Console / Pre-Processor

Copyright 2000-2005 Ron Pinkas <ron@xharbour.com>
http://www.xbScript.com

License:
--------
Please note the xbScript is subject to the GPL 2.0 terms and conditions.
This means you may freely link its source code into your application
but only if your application is distributed freely as per GPL terms and
conditions.

If you want to include xbScript functionality into your propriatary sources
you'll have to purchase the xbScript Typical Retail License (TPL) to overcome
the above restriction.

For any licensing questions please contact the author at <ron@xharbour.com>

Command line switches and syntax:
---------------------------------

  xbscript filename[.ext] [-CCH] [-D<id>] [-D:E] [-D:M] [-D:P] [-H]
                          [--help][-I<path>] [-P] [-R] [-STRICT]
                          [-U[<ch-file>]]

    -CCH     = Generate a .cch file (compiled command header).
    -D<id>   = #define <id>.
    -D:E     = Show tracing information into the Expression Scanner.
    -D:M     = Show tracing information into the Match Engine.
    -D:P     = Show tracing information into the Output Generator.
    -FIX     = Do not clone Clipper PreProcessor bugs.
    -H       = Syntax and command line switches description.
    --help   = Syntax and command line switches description.
    -I<path> = #include file search path(s) (';' seperated).
    -P       = Generate .pp$ pre-processed output file.
    -Q       = Quiet.
    -R       = Run filename as a script.
    -U       = Use command definitions set in <ch-file> (or none).

Overview:
---------
xbScript has 3 personalities which are tied tightly together.

1. What is supposed to be 100% Clipper compatible Pre-Processor
   (with some extensions).

   Executing xbScript followed by a source file name  and the -P switch,
   will create <filename.pp$> which is the equivalent of the Clipper
   <filename.ppo> file.

   This syntax is:

     xbScript filename[.ext] -P

   In this mode these are the optional command line switches.

    -CCH     = Generate a .cch file (compiled command header).
    -D<id>   = #define <id>.
    -D:E     = Show tracing information into the Expression Scanner.
    -D:M     = Show tracing information into the Match Engine.
    -D:P     = Show tracing information into the Output Generator.
    -FIX     = Do not clone Clipper PreProcessor bugs.
    -I<path> = #include file search path(s) (';' separated).
    -Q       = Quiet.
    -U       = Use command definitions set in <ch-file> (or none).

2. DOT prompt, which allows most of the Clipper syntax. Please
   report any syntax you expect to work, but is not supported.

   It does support IF [ELSE] [ELSEIF] ENDIF in DOT environment.

   Executing xbScript 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 variables are auto-created on assignment in Harbour
        but NOT in Clipper (yet).

     c. It does support all control flow structures excluding SWITCH
        including:
         - BEGIN SEQUENCE [BREAK] [RECOVER] END SEQUENCE
         - TRY [CATCH [<xCatcher>]] END.
         - FOR EACH <Enumerator> IN <Enumeration>

     d. It does not support DETACHED LOCALs in codeblocks as the interpreter
        does not implement real locals.

  The interpreter does support definition and execution of prg-defined
  FUNCTIONs/PROCEDUREs as well as OOP code (when compiled with xHarbour and
  hbclass.ch is #included).

  This will create rp_dot.pp$ compilation trace file.

  xbScript is using pre-burned rules to support this functionality, unless a
  file named rp_dot.ch is present. If rp_dot.ch is present xbScript will load
  rp_dot.ch instead of using the pre-burned rules. If this file doesn't
  include all the needed rules, the functionality of the the Dot Prompt mode
  may be faulty.

3. Finally, xbScript is a limited Clipper/Harbour/xBase Interpreter. Subject
   to those same few limitations it can execute most of Harbour syntax.
   Executing xbScript 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:

     xbScript filename[.ext] -R

   In this mode these are the optional command line switches.

    -CCH     = Generate a .cch file (compiled command header).
    -D<id>   = #define <id>.
    -D:E     = Show tracing information into the Expression Scanner.
    -D:M     = Show tracing information into the Match Engine.
    -D:P     = Show tracing information into the Output Generator.
    -FIX     = Do not clone Clipper PreProcessor bugs.
    -I<path> = #include file search path(s) (';' separated).
    -P       = Generate .pp$ pre-processed output file.
    -Q       = Quiet.
    -U       = Use command definitions set in <ch-file> (or none).

     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 variables are auto-created on assignment in [x]Harbour
        but NOT in Clipper (yet).

     c. It does support definition and execution of prg-defined
        FUNCTIONs/PROCEDUREs and OOP code (when compiled with xHarbour) code
        as well as parameter passing and return values.

     d. It does support ALL control flow structures excluding SWITCH but
        including BEGIN SEQUENCE [BREAK] [RECOVER] END SEQUENCE TRY
        [CATCH [<xCatcher>]] END and FOR EACH [HB_EnumIndex()] ][LOOP] [EXIT]
        NEXT.

     e. It does not support DETACHED LOCALs in codeblocks as the interpreter
        does not implement real locals.

     f. The compiled module is automatically using -n (No implicit startup
        procedure) if the script starts with a Procedure/Function definition.

     g. Built-in OLE COM Client gateway is included when PP is compiled with
        xHarbour.

  xbScript is using pre-burned rules to support this functionality, unless a
  file named rp_run.ch is present. If rp_run.ch is present xbScript will load
  rp_run.ch instead of using the pre-burned rules. If this file doesn't
  include all the needed rules, the functionality of the the Interpreter mode
  may be faulty.
