Path: csiph.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Kaz Kylheku <157-073-9834@kylheku.com> Newsgroups: comp.compilers Subject: Re: Best language for implementing compilers? Date: Sun, 10 Mar 2019 05:40:11 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 32 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <19-03-007@comp.compilers> References: <19-02-002@comp.compilers> <19-02-004@comp.compilers> <19-02-006@comp.compilers> <19-03-002@comp.compilers> <19-03-003@comp.compilers> Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="47916"; mail-complaints-to="abuse@iecc.com" Keywords: parse Posted-Date: 10 Mar 2019 01:02:04 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:2173 On 2019-03-09, Hans-Peter Diettrich wrote: > Am 09.03.2019 um 07:47 schrieb mertesthomas@gmail.com: > >> For parsing I don't think that pattern matching leads to correct >> results in all cases. I have seen too much buggy attempts to do >> parsing with pattern matching. Even for such simple things as >> lines with key=value I saw "solutions" with pattern matching, that >> triggered bugs when the line was not simple. A good approach for >> parsing is LL(1), which has nothing to do with pattern matching. > > IMO bottom-up parsers (LR) do pattern matching, in contrast to top-down > parsers (LL). Where bottom-up parsers can suffer from shift/reduce > conflicts. Top-down is still pattern matching! Match this, then match that, then peek at the next symbol, and choose among five different functions, each of which match this, match that ... There is no unravelling of nested syntax without pattern matching in some shape or form. LL(1) matching is still a combination of matching a regular language, with a push-down automaton. Just because you hand-translate that into recursive-descent code doesn't mean it ceases to be a regex recognizer with push-down -- TXR Programming Lanuage: http://nongnu.org/txr Music DIY Mailing List: http://www.kylheku.com/diy ADA MP-1 Mailing List: http://www.kylheku.com/mp1