Re: Best language for implementing compilers?

George Neuner <gneuner2@comcast.net>
Sun, 10 Mar 2019 18:23:52 -0400

          From comp.compilers

Related articles
[17 earlier articles]
Re: Best language for implementing compilers? gneuner2@comcast.net (George Neuner) (2019-03-09)
Re: Best language for implementing compilers? 157-073-9834@kylheku.com (Kaz Kylheku) (2019-03-10)
Re: Best language for implementing compilers? 157-073-9834@kylheku.com (Kaz Kylheku) (2019-03-10)
Re: Best language for implementing compilers? christopher.f.clark@compiler-resources.com (Christopher F Clark) (2019-03-10)
Re: Best language for implementing compilers? bc@freeuk.com (Bart) (2019-03-10)
Re: Best language for implementing compilers? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2019-03-10)
Re: Best language for implementing compilers? gneuner2@comcast.net (George Neuner) (2019-03-10)
Re: Best language for implementing compilers? gneuner2@comcast.net (George Neuner) (2019-03-10)
Re: Best language for implementing compilers? christopher.f.clark@compiler-resources.com (Christopher F Clark) (2019-03-11)
Re: Best language for implementing compilers? christopher.f.clark@compiler-resources.com (Christopher F Clark) (2019-03-11)
Re: Best language for implementing compilers? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2019-03-12)
Re: Best language for implementing compilers? mertesthomas@gmail.com (2019-03-12)
Re: Best language for implementing compilers? bc@freeuk.com (Bart) (2019-03-13)
| List of all articles for this month |
From: George Neuner <gneuner2@comcast.net>
Newsgroups: comp.compilers
Date: Sun, 10 Mar 2019 18:23:52 -0400
Organization: A noiseless patient Spider
References: 19-02-002 19-02-004 19-02-006 19-03-009
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

On Sun, 10 Mar 2019 04:13:47 -0700 (PDT), Christopher F Clark
<christopher.f.clark@compiler-resources.com> 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



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.