comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Lexical Conundrum
Date: 1998/02/23
Date: 1998-02-23T00:00:00+00:00	[thread overview]
Message-ID: <dewar.888252157@merv> (raw)
In-Reply-To: 6crnal$9ei$1@peuplier.wanadoo.fr


JPR says

<<This a known (and presumably only) small difficulty in parsing Ada. And yes,
compilers may take advantage that there is no one letter attribute to make
it easier... although it's not really hard to solve. For example, have a
look at the very simplistic parser used in "normalize" (a utility available
from Adalog's Web site at http://perso.wanadoo.fr/adalog).
>>

It is a difficulty in lexical analysis I would say, rather than parsing.
If you absorb the lexical rules into the grammar accepted by the parser,
there are no ambiguities, and no need for look ahead.

The only "difficulty" arises in doing separate lexical analysis, and as
I showed from the GNAT code, this difficulty is so trivial to resolve
that I see no reason to even describe it as a difficulty, hence my
quotes.

As for one character attributes, not so fast, when you have wide characters,
the test for whether the thing following a quote is or is not a valid
character literal is not that simple, and indeed that test would probably
be more work than the simple test done in the GNAT lexical analyzer.

There are no one character attributes in GNAT currently, but if we ever
found a case where a one character name was the right choice, we could
add this without any difficulties or special processing being required.





  reply	other threads:[~1998-02-23  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-19  0:00 Lexical Conundrum Nick Roberts
1998-02-23  0:00 ` Jean-Pierre Rosen
1998-02-23  0:00   ` Robert Dewar [this message]
     [not found] ` <EotBMK.MnK@world.std.com>
1998-02-22  0:00   ` Robert Dewar
     [not found]     ` <Eou91J.Es9@world.std.com>
1998-02-23  0:00       ` Robert Dewar
1998-02-23  0:00     ` Keith Thompson
1998-02-23  0:00       ` Robert Dewar
1998-02-26  0:00     ` Dr Steve Sangwine
1998-02-23  0:00   ` Mark A Biggar
1998-02-24  0:00     ` Mats Weber
1998-02-24  0:00       ` Robert Dewar
1998-03-05  0:00         ` Robert I. Eachus
  -- strict thread matches above, loose matches on Subject: below --
1998-02-22  0:00 Nick Roberts
1998-02-22  0:00 ` Robert Dewar
1998-02-24  0:00   ` John Roberts-Jones
replies disabled

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