From: Jere <jhb.chat@gmail.com>
Subject: Re: Ada grammar rules for names too permissive?
Date: Thu, 3 Jan 2019 14:34:40 -0800 (PST)
Date: 2019-01-03T14:34:40-08:00 [thread overview]
Message-ID: <fe4878b7-305b-48e6-8fbb-86d3df15c234@googlegroups.com> (raw)
In-Reply-To: <ea54f17a-21d7-400a-8bb3-4aaa36fd2e6d@googlegroups.com>
On Thursday, January 3, 2019 at 5:05:34 PM UTC-5, Stephen Leake wrote:
> 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.
Is there a guide on how to manually update the Ada mode part of emacs? I
have a slightly older version, but it doesn't list ada mode in emacs
when I go through the normal update procedure. I can't really update emacs
itself due to IT policies but was hoping to test out the newer Ada mode
fixes at some point. In the version I have, it has trouble with things
like expression functions (situations where you have "is" but no "begin/end"
blocks).
next prev parent reply other threads:[~2019-01-03 22:34 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
2019-01-03 22:34 ` Jere [this message]
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