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 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada grammar rules for names too permissive? Date: Sat, 5 Jan 2019 02:45:26 -0600 Organization: JSA Research & Innovation Message-ID: References: <30ba8954-a19e-4c95-b350-798b0276db41@googlegroups.com> <78b94e7e-521b-46c4-8975-1f4c6afbb4b5@googlegroups.com> Injection-Date: Sat, 5 Jan 2019 08:45:27 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="30909"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 X-RFC2646: Format=Flowed; Response Xref: reader01.eternal-september.org comp.lang.ada:55191 Date: 2019-01-05T02:45:26-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:q0n77h$2e4$1@gioia.aioe.org... > On 2019-01-03 23:39, olivermkellogg@gmail.com wrote: >> On Tuesday, January 1, 2019 at 9:44:17 AM UTC+1, Dmitry A. Kazakov wrote: >>> [...] >>> Never push semantic rules into syntax. >> >> I'm not so sure about that: >> 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. > > In presence of overloading, really? Anyway, I see no use in such a > distinction in general. Right. That might work in other languages, but in Ada that is a very complex algorithm. You'd think that the lack of object overloading would help, and it does, but not enough, since you can have a function that returns an array that is then indexed, as opposed to a function that returns an access-to-function. They both could look like: F (1) (2) And you don't want the grammar to be too smart, simply because hand-written error messages are almost always better than automatically generated ones, once you get past the trivial (missing punctuation). Randy.