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!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s72.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: lexical ambiguity References: <1nozvv83n7lhc.1b3qf0olmyllp$.dlg@40tude.net> <9M_gg.1598$O5.554@llslave.llan.ll.mit.edu> In-Reply-To: <9M_gg.1598$O5.554@llslave.llan.ll.mit.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.176 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s72 1149545766 12.201.97.176 (Mon, 05 Jun 2006 22:16:06 GMT) NNTP-Posting-Date: Mon, 05 Jun 2006 22:16:06 GMT Date: Mon, 05 Jun 2006 22:16:06 GMT Xref: g2news2.google.com comp.lang.ada:4690 Date: 2006-06-05T22:16:06+00:00 List-Id: Frank J. Lhota wrote: > > 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. That's too simple minded. A character literal can't follow an identifier, so this must be either an attribute or a qualified expression (presuming it's not an error). Since "(" can't be an attribute, it must be a qualified expression. I'm not sure how to parse "...", though. You still have an evil mind, since you didn't include any spaces between the components of the aggregate, making it even harder for humans to parse (lack of spaces shouldn't make any difference to machine parsing). -- Jeff Carter "Nobody expects the Spanish Inquisition!" Monty Python's Flying Circus 22