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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1f96acbbf1e7e66a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!elnk-pas-nf1!newsfeed.earthlink.net!news-feed-01.socal.rr.com!news.rr.com!cyclone2.kc.rr.com!news2.kc.rr.com!tornado.socal.rr.com.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada Subject: Re: lexical ambiguity References: <1nozvv83n7lhc.1b3qf0olmyllp$.dlg@40tude.net> <9M_gg.1598$O5.554@llslave.llan.ll.mit.edu> From: Keith Thompson Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:osGJ/g7ua8GwovMdXpW5SyBKxjo= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 05 Jun 2006 20:27:11 GMT NNTP-Posting-Host: 66.75.136.120 X-Complaints-To: abuse@rr.com X-Trace: tornado.socal.rr.com 1149539231 66.75.136.120 (Mon, 05 Jun 2006 13:27:11 PDT) NNTP-Posting-Date: Mon, 05 Jun 2006 13:27:11 PDT Organization: Road Runner High Speed Online http://www.rr.com Xref: g2news2.google.com comp.lang.ada:4687 Date: 2006-06-05T20:27:11+00:00 List-Id: "Frank J. Lhota" 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 San Diego Supercomputer Center <*> We must do something. This is something. Therefore, we must do this.