[Info-vax] Parsers (was Re: VMS Features I Wish Linux Had)
Stephen Hoffman
seaohveh at hoffmanlabs.invalid
Tue Jun 14 10:58:35 EDT 2016
On 2016-06-14 13:32:45 +0000, Bob Koehler said:
> I feel the same way. Early on I looked at LIB$TPARSE and decided not
> to try to learn it. CLD was a piece of cake.
The lib$table_parse documentation is comparatively weak, and the use of
macros and not a DSL is not something likely to be emulated. The tool
itself is easy, though quite primitive in terms of what you have to
code to use it. Lots of glue code. The need for glue code for many of
the OpenVMS APIs has been a complaint of mine for a while. There are
ways around that necessity now, ways that hadn't been common in the
1970s; when the majority of the OpenVMS API patterns were conceived.
e.g. OO. But I digress. There are also limitations around the
token-parsing grammar, too. http://labs.hoffmanlabs.com/node/1905
If you're creating a DCL-style command, then certainly use the SET
COMMAND tool and CLD files. If you're solving a problem that does not
lend itself to DCL syntax, then lib$table_parse or some other parsing
tool or library will be far preferable and far more effective than
using CLD files.
Use of flex/bison, byacc, Ragel, or other such tools are much more
common these days, though. Ragel http://labs.hoffmanlabs.com/node/1629
and byacc http://invisible-island.net/byacc/byacc.html are already
available on OpenVMS, and byacc features licensing that would likely
allow its incorporation into OpenVMS itself, if VSI were so inclined.
--
Pure Personal Opinion | HoffmanLabs LLC
More information about the Info-vax
mailing list