comp.lang.ada
 help / color / mirror / Atom feed
* 1:= syntax error
@ 1987-09-22 17:54 Robert.Firth
  0 siblings, 0 replies; only message in thread
From: Robert.Firth @ 1987-09-22 17:54 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1987-09-22 17:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1987-09-22 17:54 1:= syntax error Robert.Firth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox