comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Ada grammar rules for names too permissive?
Date: Thu, 3 Jan 2019 13:45:32 -0800 (PST)
Date: 2019-01-03T13:45:32-08:00	[thread overview]
Message-ID: <ea54f17a-21d7-400a-8bb3-4aaa36fd2e6d@googlegroups.com> (raw)
In-Reply-To: <q0j80m$s8r$1@gioia.aioe.org>

On Wednesday, January 2, 2019 at 12:47:22 PM UTC-8, Dmitry A. Kazakov wrote:
> On 2019-01-02 20:21, Stephen Leake wrote:
> > On Tuesday, January 1, 2019 at 12:42:36 PM UTC-8, Dmitry A. Kazakov wrote:
> >> On 2019-01-01 20:49, Stephen Leake wrote:
> >>> On Tuesday, January 1, 2019 at 12:44:17 AM UTC-8, Dmitry A. Kazakov wrote:
> >>>> The grammar as written is never the one actually used for whatever
> >>>> purpose other than explanation or, maybe, validation. An extreme case
> >>>> illustrating why, is source code coloring,
> >>>
> >>> On the contrary, Emacs Ada mode source code coloring uses a generated parser for the Ada language, with only minimal changes from Annex P.
> >>
> >> In which case it should not work with syntactically incorrect programs.
> > 
> > No, it has error correction to deal with that.
> 
> Ada grammar contains no correction productions.

True for LRM Annex P, and also for Emacs ada.wy, but irrelevant. For LR parsers, there are error correction algorithms that do not require modifying the grammar. Emacs ada-mode uses the McKenzie algorithm (1); exploration of the parse table near the error location, combined with the redundancy of the Ada language (especially named blocks).

One of these days I'll have to write a paper on it ...

Meanwhile, it works quite nicely for me, and I'm waiting to hear from more people on how it works for them (a few positive responses so far, no negative).

(1) McKenzie, Bruce J., Yeatman, Corey, and De Vere,
    Lorraine. Error repair in shift reduce parsers. ACM Trans. Prog.
    Lang. Syst., 17(4):672-689, July 1995.
  

  reply	other threads:[~2019-01-03 21:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-29 18:20 Ada grammar rules for names too permissive? olivermkellogg
2018-12-31 21:45 ` Randy Brukardt
2019-01-01  8:44   ` Dmitry A. Kazakov
2019-01-01 19:49     ` Stephen Leake
2019-01-01 20:42       ` Dmitry A. Kazakov
2019-01-02 19:21         ` Stephen Leake
2019-01-02 20:47           ` Dmitry A. Kazakov
2019-01-03 21:45             ` Stephen Leake [this message]
2019-01-03 22:34               ` Jere
2019-01-05 18:46                 ` Stephen Leake
2019-01-07 11:11                   ` J-P. Rosen
2019-01-08 18:58                     ` Stephen Leake
2019-01-04  8:53               ` Dmitry A. Kazakov
2019-01-03 22:39     ` olivermkellogg
2019-01-04  8:58       ` Dmitry A. Kazakov
2019-01-05  8:45         ` Randy Brukardt
2019-01-05 18:50       ` Stephen Leake
2019-01-01 19:46   ` olivermkellogg
2019-01-03 22:36     ` Randy Brukardt
2019-01-01 19:46 ` Stephen Leake
2019-01-01 21:03   ` olivermkellogg
2019-01-02 19:42     ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox