On Mon, 2022-03-21 at 13:33 +0000, Seymour J Metz wrote:
> I just read the wiki artlice [[Parsing expression grammar]] and don't see 
> either the sophistication or the ease of use compared to regexen. I've come 
> to rely on named captures and backtracking, both
> of which seem to be missing.

Absolutely not. Depending on the library it's trivial to support named captures 
within named captures http://lua-users.org/lists/lua-l/2010-02/msg00493.html. 
Backtracking is equally trivial. PEGs
support recursive decent grammars. The problem with regular expressions is that 
they don't scale. For example, using PEGs it's simple to functionally decompose 
a tricky grammar such as validating a IP
address, which may be either a hostname, IPv4 or IPv6 [1]. Using a regex just 
to validate IPv6 is an intractable mess [2]. PEGs are super powerful which is 
why they are used to write the parsers for
programming language, including perl 6 (does anybody use perl 6?).

[1] 
https://github.com/mozilla-services/lua_sandbox_extensions/blob/main/lpeg/modules/lpeg/ip_address.lua
[2] https://ihateregex.io/expr/ipv6/
[3] https://metacpan.org/dist/Pegex/view/lib/Pegex.pod


> 
> 
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
> 
> ________________________________________
> From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
> David Crayford [dcrayf...@gmail.com]
> Sent: Monday, March 21, 2022 9:08 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: looking for 'how to' developing Rexx host command
> 
> On Mon, 2022-03-21 at 12:42 +0000, Seymour J Metz wrote:
> > Sorry, I should have been less terse. I meant that PCRE provides a more 
> > sophisticated RE engine.
> 
> PCRE is slightly more sophisticated but it's puny when compared to PEG 
> engines. Not only are PEG libraries more sophisticated they are orders of 
> magnitude easier to learn and use.
> 
> 
> > Off topic, but why does the documented URI pattern not recognize fragments 
> > prefixed by "#"?
> > 
> > 
> > --
> > Shmuel (Seymour J.) Metz
> > https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmason.gmu.edu%2F~smetz3&data=04%7C01%7Csmetz3%40gmu.edu%7C1c398fef77da48a8a3ff08da0b3c048f%7C9e857255df574c47a0c00546460380cb%7C0%7C0%7C637834649662173443%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=q%2BzKnJXNJ58TEHt3VL6fHCGFWMws2bqlDgnXLW29USg%3D&reserved=0
> > 
> > ________________________________________
> > From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
> > David Crayford [dcrayf...@gmail.com]
> > Sent: Monday, March 21, 2022 8:28 AM
> > To: IBM-MAIN@LISTSERV.UA.EDU
> > Subject: Re: looking for 'how to' developing Rexx host command
> > 
> > On Mon, 2022-03-21 at 12:01 +0000, Seymour J Metz wrote:
> > > PCRE?
> > 
> > No. It uses the C++ RTL ECMAScript Grammar which is 99% compatible with 
> > PCRE. AFAIK, the only thing it doesn't support is recursive subgroup 
> > matching which I could care less about. I lost interest
> > in
> > REXX long ago and regular expressions when I discovered PEGs
> > http://secure-web.cisco.com/1GzTyMMSxCF_dwz2M6Q46PXDtjQQPO9p6ZnEEaWyOCoB_OCkMHE0mJFg8_ivpVjXcHrXax7OQ0H_1OuTTj4qhcLRfQs7zDJNyLyG4NVFThKZbFfuIyALvQBo0O9xtivp3mfCFxg0XUteBTVqbC7DJJRGiYh8W-yiJjJP3EUpGBcbUS1xJiEstgA_yk97ZlzNUyFasjrTZYqnLYM9-8MQDL-SHo6VnBTY-3DTeVHncLZwmV-qKLCQjvAPRPR8i6ckJ16bUTA7bgxKOsFthBcfdtGpX8OHo8dH-psux7cnLT2547giX2VYLIv-rGiH2qSNOc3AGtygDbBvd8AcrLzf7GiGSTUiPtjI83vwkcCmHPo96dcT4YRSxRO5xEHTJxvKRBg-NAEEbzj1XMm0_hG6iNmaTQm7KhcyvsiKnJk7RoAeWzXdI3ccjohTu7R0o64c-/http%3A%2F%2Flua-users.org%2Fwiki%2FLpegRecipes
> > .
> > 
> > 
> > > --
> > > Shmuel (Seymour J.) Metz
> > > https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmason.gmu.edu%2F~smetz3&data=04%7C01%7Csmetz3%40gmu.edu%7C1c398fef77da48a8a3ff08da0b3c048f%7C9e857255df574c47a0c00546460380cb%7C0%7C0%7C637834649662173443%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=q%2BzKnJXNJ58TEHt3VL6fHCGFWMws2bqlDgnXLW29USg%3D&reserved=0
> > > 
> > > ________________________________________
> > > From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf 
> > > of David Crayford [dcrayf...@gmail.com]
> > > Sent: Sunday, March 20, 2022 11:35 PM
> > > To: IBM-MAIN@LISTSERV.UA.EDU
> > > Subject: Re: looking for 'how to' developing Rexx host command
> > > 
> > > On Sun, 2022-03-20 at 10:08 -0500, Paul Gilmartin wrote:
> > > > On Sun, 20 Mar 2022 07:56:39 -0700, Charles Mills wrote:
> > > > 
> > > > > TSO/E Rexx Reference Chapter 14. Language Processor Environments?
> > > > > 
> > > > Wouldn't a SAMPLIB member be nice?  In a HLL?
> > > 
> > > Writing a REXX command processor in a HLL is non-trivial to do correctly. 
> > > I've done it a few times and it requires creating a persistent LE 
> > > environment and hanging the pointer on the user area
> > > inthe
> > > environment block. Like most things on z/OS, REXX programming services 
> > > were designed for HLASM. Unfortunately, for the kind of APIs I'm 
> > > interested in HLASM is practically useless. For example,
> > > regular
> > > expressions
> > > https://secure-web.cisco.com/1zcwmhQDfP3w43bgtLLTfqgfquwmvKtHyKxkeXoo2pwlKZnmHKubm9IgbehcXUMaSRUvaEdPtbH79-0CZ30CeuslyETSCoPogZKiHdS9lnPt0OXlOV2A1sZGJH1j2ZlRptWqebMlsvE26C_jDXTFaXgQwwpSR4PfcyY2a3fHtEEFPy8N1_EUhKhgNJ4qKrOEzp6jQE_jSCNpvkXsh0td0Atyfzpzn85YvAjgTe-uL_bIgjp-HQoFpsdnKO_USxUiVxvRukM8wHuQLKtjVhDMgqvI3acfBOPJV1xYg3rATQBgwkriE0Ey8C3BtYm8aXHNI2qhJdDLtiR3QZHo90qFKkTga0SshiTOaC9Cn20kfOeXkBwCF8mmt0enaJQnalSmeZbQOZClq3sRCF9rgGZTkAaC-NMWPVp8tZ9C3LobJmxH2MvzLHyNlELnLUQl2PsN_/https%3A%2F%2Fgithub.com%2Fdaveyc%2FRTK
> > > .
> > > 
> > > It's far easier to just use a more contemporary programming language 
> > > which has a modern API for writing packages. Although, then you need to 
> > > know C/C++ for Python, Lua, Ruby, Node etc.
> > > 
> > > 
> > > 
> > > > > -----Original Message-----
> > > > > From: ITschak Mugzach
> > > > > Sent: Sunday, March 20, 2022 7:36 AM
> > > > > 
> > > > > I scanned the tso rexx manuals and haven't found any instructions on 
> > > > > how to
> > > > > develop the host load module. I mean, the one who supplies the 
> > > > > address xxx
> > > > > services. Any idea where to find a sample or instruction manual?
> > > 
> > > ----------------------------------------------------------------------
> > > For IBM-MAIN subscribe / signoff / archive access instructions,
> > > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> > > 
> > > ----------------------------------------------------------------------
> > > For IBM-MAIN subscribe / signoff / archive access instructions,
> > > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> > 
> > ----------------------------------------------------------------------
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> > 
> > ----------------------------------------------------------------------
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to