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:a5e:df44:: with SMTP id g4mr8135052ioq.0.1546714256747; Sat, 05 Jan 2019 10:50:56 -0800 (PST) X-Received: by 2002:aca:c703:: with SMTP id x3mr689192oif.5.1546714256546; Sat, 05 Jan 2019 10:50:56 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!2.eu.feeder.erje.net!4.us.feeder.erje.net!feeder.erje.net!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!q69no408755itb.0!news-out.google.com!v71ni425ita.0!nntp.google.com!k10no409830itk.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 5 Jan 2019 10:50:56 -0800 (PST) In-Reply-To: <78b94e7e-521b-46c4-8975-1f4c6afbb4b5@googlegroups.com> 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> <78b94e7e-521b-46c4-8975-1f4c6afbb4b5@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <10f539a0-0ec7-4437-8609-ab742be97011@googlegroups.com> Subject: Re: Ada grammar rules for names too permissive? From: Stephen Leake Injection-Date: Sat, 05 Jan 2019 18:50:56 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:55199 Date: 2019-01-05T10:50:56-08:00 List-Id: On Thursday, January 3, 2019 at 2:39:12 PM UTC-8, oliverm...@gmail.com wrote: > A nice feature of ANTLR is that is supports semantic predicates which can be embedded in the grammar. > For example, using sem preds on the basis of symbol tables would permit discerning among indexed_component, type_conversion, function_call. That could be useful for colorization; Emacs Ada-mode takes a simplistic approach to coloring identifiers. libadalang takes a different approach; it does some semantic analysis after parsing, including name resolution. > The interesting question IMO is: > What are the necessary transformations for going from Annex P BNF plus informal description of semantic rules to the actual implementation grammar. That totally depends on the purpose of the implementation. A compiler has very different requirements from an IDE engine. -- Stephe