Dec 112017
 
CLParser is a Command Line Parser. It provides the programmer with several pre-defined objects for dealing with command line options and switches. Turbo Pascal 5.5 TPU only.
File CLP30.ZIP from The Programmer’s Corner in
Category Pascal Source Code
CLParser is a Command Line Parser. It provides the programmer with several pre-defined objects for dealing with command line options and switches. Turbo Pascal 5.5 TPU only.
File Name File Size Zip Size Zip Type
CLPARSER.DOC 24605 6945 deflated
CLPARSER.TPU 5408 2439 deflated
CLPDEMO.DAT 266 149 deflated
CLPDEMO.EXE 9840 5633 deflated
CLPDEMO.MAP 384 181 deflated
CLPDEMO.PAS 6541 1692 deflated
DEMO.BAT 46 46 stored
READ.ME 5230 2003 deflated

Download File CLP30.ZIP Here

Contents of the READ.ME file


READ.ME
___________________________________________________________________________

CLPARSER.TPU (c)1989, 1990 Greg Truesdell
Version 3.0 a Turbo Pascal 5.5 Object Unit
___________________________________________________________________________

This disk/archive contains the following files:

CLPARSER.TPU The Command Line Parser Unit
CLPARSER.DOC A reference manual for the unit.
READ.ME This file, obviously.
CLPDEMO.PAS An example file.
CLPDEMO.DAT A sample parameter file
CLPDEMO.MAP The map file for CLPDEMO.EXE
CLPDEMO.EXE The compiled version of the example program.
DEMO.BAT A sample demo of CLPDEMO.EXE.

Resgistered users also receive:

MODSYS.EXE Program to modify your SYSTEM.TPU file. See below.
YAPL.PAS A non-trivial example of CLPARSER's use.
YAPL.MAP The map file for YAPL.EXE (note smart linked size)
YAPL.EXE Yes, Another Program Lister executable.

Source Licencees also receive:

CLPARSER.PAS Licensed Source for CLPARSER v3.0


The program file YAPL.PAS has been added to the distribution disk as a
NON-TRIVIAL example of how CLPARSER can be used. It is in no way intended
to be the definitive work on how CLPARSER should be used. I have tried
a number of approaches and some are better than others. Take a look at
the use of object pointer switching used to select either a switch object
or a pfile object as input. You might also find the program useful.
It seems to me, however, that we've seen enough YAPLs (pronounced YAPPLE)
to do for awhile.

PLEASE NOTE

THE .EXE FILES WERE COMPILED WITH A MODIFIED VERSION OF SYSTEM.TPU
MOVED INTO TURBO.TPL. THIS ALLOWS SWITCHES WHICH START WITH "/" TO
BE CONCATENATED WITHOUT A SPACE. (ie: hello/a/b filename ... )

SEE SECTION "MODIFICATIONS TO RTL" FOR MORE INFORMATION


A number of changes have been made to this version of the CLPARSER source
code. Please read the CHANGES comments in CLPARSER.DOC for more
information.


MODIFICATIONS TO RTL_______________________________________________________

Turbo Pascal v5.5 Run Time Library file PARS.ASM (PARS.OBJ) includes what I
would consider a deficiency. When loading the command line arguments into
the ParamStr() array, the SPACE ($20) character is used as a delimiter. In
most cases this is fine. It can be annoying, though, when you have become
accustomed to command lines like:

C:\DOS> myexe/q filename /a/f

Turbo Pascal would pass "/a/f" as a single parameter. This can be overcome
in your own code, if you wish. I have not dealt with that issue in
CLPARSER. Since the Turbo Pascal RTL is available, I have patched the PARS
assembler source code to accept "/" as a delimiter also. In the PARS.ASM
file at line 99 you need to replace

@@2: CMP BYTE PTR ES:[DI],' '
JA @@3

with
@@2: CMP BYTE PTR ES:[DI],'/' ; if char is = switch then skip
JZ @@3
CMP BYTE PTR ES:[DI],' ' ; if char is > space then skip
JA @@3

and at line 105 you need to replace

@@4: CMP BYTE PTR ES:[DI],' '
JBE @@5
INC DI
LOOP @@4
with

@@4: CMP BYTE PTR ES:[DI],' ' ; skip if white space
JBE @@5

CMP SI,DI ; ignore next if 1st switch
JZ @@41

CMP BYTE PTR ES:[DI],'/' ; skip if switch
JZ @@5

@@41: INC DI
LOOP @@4


If you do not have the Run Time Libraries for TP 5.5, you can still get
this modification applied to your copy. First you must BACK UP!!! Make
working copies of TURBO.TPL and SYSTEM.TPU in a separate directory. Use
Borland's TPUMOVER program to copy SYSTEM.TPU out of TURBO.TPL. Then
run the MODSYS.EXE program provided (registered user's only!) to modify
the copy of SYSTEM.TPU. This should add 16 bytes to the original 30384
bytes (now 30400 bytes). If this process is successful, then, AND ONLY
THEN, use TPUMOVER to install the new SYSTEM.TPU file into TURBO.TPL.

There are no guarentees that this will work. I am assuming that all
copies of SYSTEM.TPU are the same. If not, you will need the RTL files
from Borland. Then you will have to make changes to PARS.ASM as detailed
above. See the Borland RTL documentation for information on how to do
that.
___________________________________________________________________________



 December 11, 2017  Add comments

Leave a Reply