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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!labrea!decwrl!decvax!ucbvax!SEI.CMU.EDU!Kenneth.Lee From: Kenneth.Lee@SEI.CMU.EDU Newsgroups: comp.lang.ada Subject: Re: Strange syntax Message-ID: <8709231753.AA26614@q.sei.cmu.edu> Date: Wed, 23-Sep-87 13:53:10 EDT Article-I.D.: q.8709231753.AA26614 Posted: Wed Sep 23 13:53:10 1987 Date-Received: Sat, 26-Sep-87 04:48:52 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet List-Id: > From: "GBURG::CWILLIAMS" > The Rational R1000 compiler also accepts the example as legal and does execute > properly. Given the fact that DEC-Ada also accepts it, I would say that it is > in fact legal Ada. The fact that other compilers reject it as erroneous > suggests to me that the example should be added to the ACVC if the final > determination is that the example is legal. > > Chuck Williams > CONTEL Federal Systems The Rational R1000 compiles the code because the first step when a source unit is promoted to an installed unit is to format the code. The reformatted code for the line in question is: Foo : Integer range 1 .. Max_Val + 1 := 15; The following, recent post on the SEI bboard from Robert Firth provides an explanation for the compiler diagnostics. 22-Sep-87 17:52 Robert Firth@sei cmu edu 1:= syntax error The problems with "1:=" generating an error can be traced to [RM 2.4.2 - Based Literals] and [RM 2.10 - Allowable Replacements of Characters]. The compiler believes that the sequence "1:" introduces a based literal, for instance "1:0123:". Accordingly, it fails on the "=" character, which cannot be part of a based literal. Recall that, while based literals are usually written "2#1010#", the colon is an allowable replacement for the hachure. You should expect various error messages, such as "illegal char in based literal", "invalid base in based literal", and so on. This lexis is correct according to the RM - indeed, any alternative would no longer be LR(1) and so would cause trouble for automatic scanner generators. And the colon is a replacement character because Steelman required that Ada be representable using a 56-character set. Sigh. Robert ----- Ken