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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c89a4b067758a6e1 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.germany.com!newsfeed-0.progon.net!progon.net!news-zh.switch.ch!switch.ch!news.ip-plus.net!newsfeed.ip-plus.net!news.post.ch!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Is it really Ok to assert that the Ada syntax is a context-free grammar ? Date: Wed, 20 Feb 2008 11:05:15 +0100 Organization: Swisscom IP+ (post doesn't reflect views of Swisscom) Message-ID: <47bbfb5b$1@news.post.ch> References: <4a448c5c-a4ed-446f-bb8b-67c5ba99927a@f47g2000hsd.googlegroups.com> NNTP-Posting-Host: 194.41.146.1 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: atlas.ip-plus.net 1203501918 21078 194.41.146.1 (20 Feb 2008 10:05:18 GMT) X-Complaints-To: abuse@ip-plus.net NNTP-Posting-Date: Wed, 20 Feb 2008 10:05:18 +0000 (UTC) User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) In-Reply-To: X-Original-NNTP-Posting-Host: w03duo.pnet.ch X-Original-Trace: 20 Feb 2008 11:05:15 +0100, w03duo.pnet.ch Xref: g2news1.google.com comp.lang.ada:19905 Date: 2008-02-20T11:05:15+01:00 List-Id: Jeffrey R. Carter schrieb: > Hibou57 wrote: >> >> But as pointed by someone, the grammar is not LR(1), due to the fact >> (which is common to many other languages), that as an example X(Y) can >> stand for a type cast, a function call, an array access, or even an >> array slice, and this cannot be decided without knowledge of the >> context. You could also consider X (Y) as a (intrinsic) function in all cases - with X being a function which converts Y to type X or a function which accesses element Y from array X. > X (Y) cannot represent a type cast because Ada does not have anything > called "type cast". Not quite, if you consider "type cast" is a unchecked bit pattern copy - so if you define: function X is new Unchecked_Conversion (...); the X would indeed be a it "type cast". Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com