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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6d9eb594a33cb947 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-30 22:10:33 PST Path: supernews.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!newscore.gigabell.net!newsfeed.hanau.net!fr.clara.net!heighliner.fr.clara.net!feed2.onemain.com!feed1.onemain.com!feeder.qis.net!nntp.abs.net!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: RE: very specific question on Ada syntax Date: Wed, 31 Jan 2001 06:02:03 GMT Organization: Deja.com Message-ID: <9589op$kgb$1@nnrp1.deja.com> References: NNTP-Posting-Host: 205.232.38.14 X-Article-Creation-Date: Wed Jan 31 06:02:03 2001 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x54.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:4737 Date: 2001-01-31T06:02:03+00:00 List-Id: In article , comp.lang.ada@ada.eu.org wrote: > So please what is the most appropriate treatment (i.e. > preventing extra checks AFTER lexical analysis in most > cases) for 'Access, 'Delta, 'Digits, 'Range? Tick > Identifier or Tick Reserved_Word? Either would work, someone has to list special cases here. In GNAT we find it preferable not to distort the lexical rules of the language (which clearly say that it is a reserved word), and do the special tests in the parser, following the official grammar in the RM. But you could alter the lexical structure and alter the grammar, and do the special checks in the lexical analyzer if you want. GNAT always attempts to keep its internal data structures as close as possible to the formal definition. This has proved a good choice since it means that the RM acts as a kind of manual for the compiler. > > I would tend to say, it's better to put the extra check for these four into the > lexer and treat them as identifiers afterwards. > > >> Also here OpenToken will fail.] > > > >How? It should return access as a reserved keyword, surely > >it does ...> > > Of course is does. So in the light of the above, it does not fail. > > Sent via Deja.com http://www.deja.com/