[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Pseudocode to XyWrite



Here's a little program that can change the pseudocode we write
for these listings into executable XPL. NOTE: *this* listing is
*not* written in the proper pseudocode for automatic conversion.
See the notes below.

≪GT0≫Program to change ASCII XPL listings to true XPL.
Conventions: use curly braces for euroquote chevrons and
surround function calls with colons. This version of the program
will run under III+ or XY4.

≪LB0≫:BC: ci /}/≫/:XC: :BC: ci /{/≪/:XC: ≪LB_Loop1≫:XD:
:BC: sea/f
/::A: :A: :/:XC: ≪IF≪ER≫≫≪GL_End≫

≪EI≫:RC: :DF: :CR: :CR: :RC: :RC: :DF: ≪SV01≫:RD: :BC: pfun
≪PV01≫:XC:
≪GL_Loop1≫

≪LB_End≫:BC::CC:TF:≪PRDone≫≪EX≫

---------------------

You can delete the stuff from ≪GT0≫ thru ≪LB0≫, tho it's
harmless to leave it in. You can also make this a XY4/XYW
program by changing all BC's except the last one to BX's, all
XC's to Q2's, and killing the CC.

This listing must violate its own conventions for the sake of
clarity. In the listing I used ≪ and ≫ for the euroquotes
because one of the search and replace arguments is the curly
braces (which in this listing must remain curly braces -- don't
change them to euroquotes! Another convention: the sequence
::A: :A: : means "literal colon followed by two wildcard A
characters followed by a literal colon". Notice also that the
function calls are to be followed by a space. The colon should
provide enough of a visual clue in pseudocode listings.
Unfortunately, I haven't found a way to get XPL automatically
converted to pseudocode. I'll let you know if I figure it out.

All comments and modifications cheerfully welcomed.