Arg decoding with a template?

David Bolen db3l at fitlinxx.com
Tue Jul 31 22:23:13 EDT 2001


"Steve Holden" <sholden at holdenweb.com> writes:

> Was this the one that allowed to you define command lines like
> 
>     COPY FROM <file> TO <file>
> 
> and variations could be deduced from the noise words? I seem to remember a
> college chum of mine working in BCPL with a scheme like this, circa 1978,
> but have only this fading memory.

The term "noise" words (while I'm sure it's generic) reminds me of the
TOPS-10/20 parsing that another poster wrote about (still in use in
some Columbia applications like MM or Kermit - in fact there's a C
CCMD library around made for that, although the TOPS stuff was built
as a system JSYS which I tended to use in MACRO).

In such a case, you actually defined parse tables that were
incrementally parsed and control was passed off to various routines as
the parsing continued, which could then dynamically vary the remainder
of the parsing.  Along the way you could define "noise" words so if
the user allowed auto-completion (normally TAB or ESC) the completed
word would be printed followed by the noise words in parenthesis
afterwards to give a hint as to what to type next.

Took a lot of set up work to do though in the code, and it was best
for interactive parsing (where you got the most benefit), although
since it was there it also got used for command lines.  But even it
had a convention for options and values as opposed to the native text
in the command.

The readline library is somewhat similar in construction but less
dynamic and flexible.

Actually, come to think of it, a wrapper around the CCMD library might
be an interesting idea as a Python extension for interactive parsing,
although I suppose with limited target base nowadays.

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list