From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:e387:: with SMTP id d129mr37851659ith.40.1546553133423; Thu, 03 Jan 2019 14:05:33 -0800 (PST) X-Received: by 2002:aca:308d:: with SMTP id w135mr616847oiw.0.1546551932367; Thu, 03 Jan 2019 13:45:32 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.166.215.MISMATCH!k10no13046itk.0!news-out.google.com!v71ni104ita.0!nntp.google.com!q69no13115itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 3 Jan 2019 13:45:32 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.77.182.20; posting-account=W2gdXQoAAADxIuhBWhPFjUps3wUp4RhQ NNTP-Posting-Host: 76.77.182.20 References: <30ba8954-a19e-4c95-b350-798b0276db41@googlegroups.com> <38103aef-2528-41ae-bb29-eec551a64808@googlegroups.com> <10d98401-d974-459f-93ed-e0b315b414e8@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Ada grammar rules for names too permissive? From: Stephen Leake Injection-Date: Thu, 03 Jan 2019 22:05:33 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:55179 Date: 2019-01-03T13:45:32-08:00 List-Id: 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 wro= te: > >> On 2019-01-01 20:49, Stephen Leake wrote: > >>> On Tuesday, January 1, 2019 at 12:44:17 AM UTC-8, Dmitry A. Kazakov w= rote: > >>>> The grammar as written is never the one actually used for whatever > >>>> purpose other than explanation or, maybe, validation. An extreme cas= e > >>>> 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= . > >=20 > > No, it has error correction to deal with that. >=20 > Ada grammar contains no correction productions. True for LRM Annex P, and also for Emacs ada.wy, but irrelevant. For LR par= sers, there are error correction algorithms that do not require modifying t= he grammar. Emacs ada-mode uses the McKenzie algorithm (1); exploration of = the parse table near the error location, combined with the redundancy of th= e 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 negati= ve). (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. =20