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,3a1c64628a09855b,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!p25g2000hsf.googlegroups.com!not-for-mail From: usenet@leapheap.co.uk Newsgroups: comp.lang.ada Subject: Lack of formal syntax undermines Ada Date: Fri, 11 Apr 2008 02:41:28 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 32.58.34.227 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1207906888 7368 127.0.0.1 (11 Apr 2008 09:41:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 11 Apr 2008 09:41:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p25g2000hsf.googlegroups.com; posting-host=32.58.34.227; posting-account=QVLfzAkAAAA63KKDMkjz_X5cKx2FC2Nc User-Agent: G2/1.0 X-HTTP-Via: 1.0 KNDPXS01 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20876 Date: 2008-04-11T02:41:28-07:00 List-Id: Ada does not have a formal syntax. The LRM provides "syntax rules" section by section, then collectively in Annex P. The resulting woolly grammar is well-known to be ambiguous (e.g. is X:=Y(Z) an assignment from a function call, array indexing or something else?). It mixes lexical and syntactical information. It cannot be used as the input to a parser generator. The interpretation necessary via other sections of the LRM risks making the language as a whole indefinite. Ada is designed for the construction of high-integrity software by validated compilers. Would it not be better to have formal Ada lexical and syntactic rules, expressed in regular expression and BNF format respectively, even if such rules turn out to be not particularly readable? As an example, my parser is having trouble with the fragment: task type TT is pragma priority(12); end TT; Is this legal Ada95 syntax or not? Regards, Chris Noonan