From: Keith Thompson <kst-u@mib.org>
Subject: Re: lexical ambiguity
Date: Mon, 05 Jun 2006 20:27:11 GMT
Date: 2006-06-05T20:27:11+00:00 [thread overview]
Message-ID: <lnirnfnyao.fsf@nuthaus.mib.org> (raw)
In-Reply-To: 9M_gg.1598$O5.554@llslave.llan.ll.mit.edu
"Frank J. Lhota" <flhota@NOSPAM.ll.mit.edu> writes:
> Jeffrey R. Carter wrote:
>> Yes, but it's good to be precise.
>
> Absolutely! I should have said "qualified expression" in my original
> post. Sorry for any confusion that I may have caused.
>
>>> Foo'(',',',',',' ... )
>> Clearly you have an evil mind :)
>
> Well, there is a good reason to consider this worst case scenario. I
> have seen quick and dirty Ada lexers that try to determine if a single
> quote starts a character literal by looking ahead 2 character. As this
> scenario shows, this approach is not guaranteed to work.
If I recall correctly, it's sufficient to remember what the previous
token was. A character literal cannot follow an identifier.
I think that might break down if an implementation chooses to define
an attribute with a single-character name, but I don't remember the
details; presumably no implementation will actually do this.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
next prev parent reply other threads:[~2006-06-05 20:27 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-02 22:13 lexical ambiguity bla_bla1357
2006-06-02 22:35 ` Frank J. Lhota
2006-06-03 5:20 ` Jeffrey R. Carter
2006-06-04 17:33 ` Frank J. Lhota
2006-06-05 1:36 ` Jeffrey R. Carter
2006-06-05 18:30 ` Frank J. Lhota
2006-06-05 20:27 ` Keith Thompson [this message]
2006-06-05 22:11 ` Jeffrey R. Carter
2006-06-06 10:39 ` Georg Bauhaus
2006-06-06 11:38 ` M E Leypold
2006-06-07 9:02 ` Dmitry A. Kazakov
2006-06-07 13:15 ` Georg Bauhaus
2006-06-07 14:49 ` Robert A Duff
2006-06-07 17:18 ` M E Leypold
2006-06-08 21:30 ` Robert A Duff
2006-06-09 4:41 ` Jeffrey R. Carter
2006-06-09 8:23 ` Georg Bauhaus
2006-06-06 13:50 ` Simon Clubley
2006-06-06 18:56 ` Peter C. Chapin
2006-06-06 19:41 ` Georg Bauhaus
2006-06-05 22:16 ` Jeffrey R. Carter
2006-06-06 13:20 ` Frank J. Lhota
2006-06-02 23:27 ` Keith Thompson
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox