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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,df854b5838c3e14 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: C/C++ knocks the .... Date: 1996/02/24 Message-ID: #1/1 X-Deja-AN: 140857882 references: <4g2r2r$ded@stc06.ctd.ornl.gov> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-02-24T00:00:00+00:00 List-Id: In article , Robert I. Eachus wrote: >...When the syntax was first >changed to use the ' for qualified expressions, there >were cases where you had to do arbitrary lookahead >to determine whether or not the first ' started a character literal or >an attribute. A'B'('"','A','B','C',... is the canononical "horrible" >case. I don't understand your example. The technique I'm familiar with is to use look-back, not look-ahead. E.g. if the previous token is an identifier, and there's an apostrophe after it, it cannot possibly be the start of a character literal. If you look at all the syntax rules, you can figure out, for each token, whether it can be followed by a character literal or not. Are you saying that B is (or might be) an attribute name in the above? Were there user-defined attributes in Green? - Bob