[comp.lang.ada] Emery's Lexical Q

Mendal@SIERRA.STANFORD.EDU (Geoff Mendal) (09/22/87)

We batted Dave Emery's lexical question (... + 1:= ...) around
Stanford and came up with two interpretations:

  (1) The declaration is syntactically illegal because it requires a
      separator to distinguish between the three lexical tokens.
  (2) The declaration is syntactically legal because even though
      the colon is the replacement character for the pound sign,
      "1:=" is not itself a legal token and therefore requires
      different interpretation.

The relevant section in the LRM appears to be 2.2(2).  The question
that Emery's example poses is:

  Must a compiler try all possible reinterpretations if it finds
  a syntax error?  Or is there something inherent in the syntax
  of Ada which requires a separator in this case?

The Stanford boys are deadlocked, and different compilers give different
answers (Verdix rejects, DEC-Ada accepts), so we'd appreciate hearing
from anyone who knows the "correct" answer.

gom
-------

cwilliams%gburg.DECnet@BLUTO.SCC.COM ("GBURG::CWILLIAMS") (09/23/87)

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
------

jws@hpcllf.HP.COM (John Stafford x75743) (09/24/87)

Alsys Ada likes it also.

John Stafford -- Hewlett Packard Computer Language Lab
{allegra,decvax,ihnp4,ucbvax}!hplabs!hpclla!jws
{fortune,sun,thirdi,ucbvax}  !hpda  !hpclla!jws