Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2178

Re: Best language for implementing compilers?

From George Neuner <gneuner2@comcast.net>
Newsgroups comp.compilers
Subject Re: Best language for implementing compilers?
Date 2019-03-10 18:23 -0400
Organization A noiseless patient Spider
Message-ID <19-03-012@comp.compilers> (permalink)
References <19-02-002@comp.compilers> <19-02-004@comp.compilers> <19-02-006@comp.compilers> <19-03-009@comp.compilers>

Show all headers | View raw


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

Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Best language for implementing compilers? "Costello, Roger L." <costello@mitre.org> - 2019-02-08 12:20 +0000
  Re: Best language for implementing compilers? Nala Ginrut <nalaginrut@gmail.com> - 2019-02-09 00:27 +0800
  Re: Best language for implementing compilers? George Neuner <gneuner2@comcast.net> - 2019-02-08 18:36 -0500
    Re: Best language for implementing compilers? Bart <bc@freeuk.com> - 2019-02-11 12:59 +0000
      Re: Best language for implementing compilers? drb@ihatespam.msu.edu (Dennis Boone) - 2019-02-12 09:38 -0600
        Re: Best language for implementing compilers? drb@ihatespam.msu.edu (Dennis Boone) - 2019-02-19 11:22 -0500
          Re: Best language for implementing compilers? arnold@skeeve.com (Aharon Robbins) - 2019-02-20 11:48 +0000
      Re: Best language for implementing compilers? Kaz Kylheku <157-073-9834@kylheku.com> - 2019-02-12 16:45 +0000
      Re: Best language for implementing compilers? mertesthomas@gmail.com - 2019-03-09 01:47 -0500
        Re: Best language for implementing compilers? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2019-03-09 10:14 +0100
          Re: Best language for implementing compilers? George Neuner <gneuner2@comcast.net> - 2019-03-09 22:47 -0500
          Re: Best language for implementing compilers? Kaz Kylheku <157-073-9834@kylheku.com> - 2019-03-10 05:40 +0000
        Re: Best language for implementing compilers? Bart <bc@freeuk.com> - 2019-03-09 12:34 +0000
        Re: Best language for implementing compilers? George Neuner <gneuner2@comcast.net> - 2019-03-09 22:57 -0500
          Re: Best language for implementing compilers? Kaz Kylheku <157-073-9834@kylheku.com> - 2019-03-10 05:48 +0000
      Re: Best language for implementing compilers? Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2019-03-10 04:13 -0700
        Re: Best language for implementing compilers? Bart <bc@freeuk.com> - 2019-03-10 15:33 +0000
          Re: Best language for implementing compilers? Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2019-03-11 10:49 -0700
            Re: Best language for implementing compilers? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2019-03-12 06:54 +0100
              Re: Best language for implementing compilers? Bart <bc@freeuk.com> - 2019-03-13 01:50 +0000
        Re: Best language for implementing compilers? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2019-03-10 16:13 +0100
          Re: Best language for implementing compilers? Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2019-03-11 10:06 -0700
        Re: Best language for implementing compilers? George Neuner <gneuner2@comcast.net> - 2019-03-10 18:23 -0400
        Re: Best language for implementing compilers? George Neuner <gneuner2@comcast.net> - 2019-03-10 18:58 -0400
  Re: Best language for implementing compilers? "Robin Vowels" <robin51@dodo.com.au> - 2019-02-09 19:58 +1100
  Best language for implementing compilers? David Lovemore <davidlovemore@gmail.com> - 2019-02-12 03:28 -0800
  Re: Best language for implementing compilers? mertesthomas@gmail.com - 2019-03-12 10:40 -0700

csiph-web