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: George Neuner Newsgroups: comp.compilers Subject: Re: Best language for implementing compilers? Date: Sun, 10 Mar 2019 18:23:52 -0400 Organization: A noiseless patient Spider Lines: 34 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <19-03-012@comp.compilers> References: <19-02-002@comp.compilers> <19-02-004@comp.compilers> <19-02-006@comp.compilers> <19-03-009@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="54889"; mail-complaints-to="abuse@iecc.com" Keywords: tools Posted-Date: 10 Mar 2019 21:09:23 EDT 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:2178 On Sun, 10 Mar 2019 04:13:47 -0700 (PDT), Christopher F Clark wrote: >[tree matching] is so good (i.e. easy to use and understand) that Terence Parr >built a whole tool (Sorcerer) to do just that to go along with his tool PCCTS >(aka ANTLR) so that you could do it in Java. I believe in modern versions, he >has merged both into one tool. ANTLR did subsume the Sorceror tree parsing tool that was provided separately with PCCTS. ANTLR also included lexer generation which also was a separate tool in PCCTS, (and originally was not included in the toolkit). So ANTLR can generate lexers, LL parsers, and tree parsers all using the same tool - and it can generate code in multiple target languages: only the ANTLR tool itself requires Java. PCCTS only targeted C. But ANTLR is quite different from PCCTS - their grammars are not compatible, so it can't be said that ANTLR is just a "newer" version. In addition, PCCTS is LL(k) and the programmer must specify required lookahead - the tool will fail to generate a parser (or the parser it generates won't work) if the specified lookahead is insufficient. ANTLR uses Parr's newer LL(*) algorithm which - in the absense of an explicit LL(k) specification - tries to automatically determine the lookahead required. This generally works as advertised, but there are cases where the analysis can take exponential time and/or memory, and in some cases the generated parser is slower than when lookahead is specified. [Creating a good grammar still is an art form 8-)] George