Return-Path: Delivered-To: rainer Received: from h2774747.stratoserver.net (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) by h2774747.stratoserver.net (Dovecot) with LMTP id bYQPEKCAT157eAAA4+3H6A for ; Fri, 21 Feb 2020 08:02:56 +0100 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by h2774747.stratoserver.net (8.15.2/8.15.2/Debian-3) with ESMTP id 01L72t3U030840 for ; Fri, 21 Feb 2020 08:02:56 +0100 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx117 [212.227.17.5]) with ESMTP (Nemesis) id 1Mwh3S-1jOFCl2REQ-00y82w for ; Fri, 21 Feb 2020 08:02:49 +0100 Received: from listserv.uni-heidelberg.de ([129.206.100.94]) by relay.uni-heidelberg.de with ESMTP; 21 Feb 2020 08:02:49 +0100 Received: from listserv (localhost [127.0.0.1]) by listserv.uni-heidelberg.de (Postfix) with ESMTP id 9091912542A; Fri, 21 Feb 2020 08:02:44 +0100 (CET) Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 17.0) with spool id 42079045 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 21 Feb 2020 08:02:44 +0100 Delivered-To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE Received: from listserv (localhost [127.0.0.1]) by listserv.uni-heidelberg.de (Postfix) with ESMTP id 728D112542A for ; Fri, 21 Feb 2020 08:02:44 +0100 (CET) Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Message-ID: <0363523151897734.WA.kellysmith12.21gmail.com@listserv.uni-heidelberg.de> Date: Fri, 21 Feb 2020 08:02:44 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Kelly Smith Subject: Re: Discussion: Specialized Syntax To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-Spam-Flag: NO X-UI-Filterresults: notjunk:1;V03:K0:x4atsHNZBdk=:uxjZNcNmihgMN2tlB1crATgNvS GGeTYTL1S9fKVPlQYXSZf9paWl13i5koYMbo7iYhKVq+sOxmA4BAnsB8acqyQD70rAQML/OGv ueKa15gP7dZD/ljuxvGoJuGJ6Ct/Z6uNGMJF8X1QmLECZHw0UdeP+R/mLo/V4lXphcYCncVSq RG8Pn66s1Ixh5lbZXEKQmrVUFNUetwGxUG6t4nYq1gD2m0I5u+oa5e56YtJ3zhZJbjKBy7bws a6YXqqHapKXCGGZWSbR9aaGsDVQuFmkEDwPtZaiCOFMCVXJiVuABmVkrK+UGlxNRKuv4D0oqU nFENVUsBwD3p2R4T9M6YALHNrrJZB69zxuC6osatTG+HU7r37cehAXeH3wJ51/4Htthz9utKC z5U+kiL8CFKXKfUwfUJJvl77QgJzqdgmBd5/Wtt9Iad5yd+nZDfu+A/MGljCgDzxtOSh/RQaC bGHrkhOn9m1gx+3I4j2vYsuT4sVJPgsI0CCZAda8ySwAGwMWT2WSdfeUJLpJQnrQwLT1ZZzbA BBMdSvLl2LA0SCTSPZi58lhEycAYqmY7QByy+RNovt0KQXvEcWWkoDPUUrH5mJclmqOOposo6 l5NKy8eaqiC5nZ1v0/fdnUv/r8f9ynPjkwOY/D6tfwGNBl5QeSvGktl/5YXcV3WZmylEJQTXM eCz6r1JjHCXQN4C7av4pqBU6meKkkN6mj9xzY+91UV5XmsfKrsQ/Ms87PUM4tKZy2mI1/zUqA aJY1DI3E4pw2t8jbCQSSEdE+0BovsUeOUHE/ybv8+X/qqnva+28qnwTUL7PWwwnOw99bz9Cm9 SmYSZakIx06AOej7RAvncVdMKk7+6EqRJDMV8QjyQXmB6bAjV/EeZ3jkVXayU+pItOkWMEui6 L6UjGZ9njjWng0r6O7M1RnZ2nvHdLitBIzjq2mc8AnQwm4VBLkXYkU/oIX87pfdagzIYXtpDk HyNDMk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TBjcVCshDYBoO5uHSq7IGlTAjsqijU86vUzYyiJQdFxU4n0NhKn1y3KoOl3Gym5 D1LDQY8+C/BIwIvtA0hS6Y0VXGFHthEa3aRgZx+1WdeV4j7hoBJ6/q03L7GbBhRq2VFW+MU6z zKYZ/ilU7l+cf8pdhJ8UBpKVGfQLSlz1gRe1EfUl6e6BYhO++RUivKkBV4OHQsZ6EWtgUw966 +0KK0VFPSPDBCHLJNE6RFSoFi5ez28M= X-Scanned-By: MIMEDefang 2.78 on 81.169.212.23 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by h2774747.stratoserver.net id 01L72t3U030840 Status: R X-Status: X-Keywords: X-UID: 8201 On Wed, 19 Feb 2020 14:34:33 +0100, Kelly Smith wrote: >On Wed, 19 Feb 2020 12:27:31 +0100, Bruno Le Floch wrote: > >>On 2/19/20 10:25 AM, Jonathan Spratte wrote: >>> Hi, >>> >>>> - Defining an environment that sets up active characters to emulate >>>> traditional BNF syntax is very concise, but comes at the cost of >>>> delimited arguments and catcode madness. >>> >>> You could as well use a letter-by-letter parser that doesn't need altered >>> category codes. Take a look at the pgf module `parser`. That's not `expl3` >>> but could give you an idea on what's possible. >>> >>> Best, >>> Jonathan >>> >> >>I've been *toying* for a long time (haven't gone very far) with the idea >>of writing a parser generator, but I couldn't decide how powerful to >>make it. One option would be to support "parsing expression grammars" >>(PEGs), which can be parsed in linear time using a packrat parser (but >>use a lot of memory, possibly problematic). Another option would be to >>stick with more traditional things like LL or LR parser. To be honest, >>I don't know enough about parsers and what useful languages they cover >>to decide. Thoughts welcome. >> >>Best, >>Bruno > >Given that the machinery already exists in the regex module, I would >suggest making a lexer generator and then complementing it with >a parser generator. > >Some quick reading suggests that LALR parsers (e.g. YACC) would be >a good balance of expressiveness and efficiency. Since this would be >used for document syntax, the parsers do not need to be very powerful, >since user-facing syntax should be relatively simple and certainly >should be unambiguous. > >Warmly, >Kelly After discussing with a friend who’s more knowledgeable about parsers than I, I’m retracting my suggestion of an LALR parser, in favor of PEGs. However, after thinking about it, I’ve come to favor the idea that parsing document syntax should still be done as it’s always been in LaTeX: incrementally and interleaved with command execution. Trying to parse and heavily process entire documents or even large sections at once would be very resource-intensive and require a lot of tooling. I’ll have to consider this further and see if I can explain it more fully. Warmly, Kelly