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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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-31 03:36:25 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!193.251.151.101!opentransit.net!jussieu.fr!enst!enst.fr!not-for-mail From: Mario Amado Alves Newsgroups: comp.lang.ada Subject: Re: very specific question on Ada syntax Date: Wed, 31 Jan 2001 11:40:12 +0000 (WET) Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: avanie.enst.fr 980940984 59250 137.194.161.2 (31 Jan 2001 11:36:24 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 31 Jan 2001 11:36:24 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: X-Authentication-Warning: lexis.di.fct.unl.pt: maa owned process doing -bs In-Reply-To: <956vav$e7q$1@nnrp1.deja.com> Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: supernews.google.com comp.lang.ada:4747 Date: 2001-01-31T11:40:12+00:00 > > > Character'('a') > > > > This is the killer one. > > Yes, this is well known, and as Tuck says, all production > quality Ada lexers have known about this for two decades, Good. I suspected that, but only come into contact with Ada two years ago. > and handle it with no problem (apostrophe after identifier > is always a tic). Any lexer not able to do such computations > will have trouble. Note that if you are using a tool like > flex, there is absolutely no problem in dealing with this. I write my lexers "by hand" (I dont understand flex), but without problem anyway. I already posted the relevant excerpt. Here it is again: 63 when ''' => 64 if Previous_Kind = Identifier 65 or (Previous_Kind = Delimiter and To_String(Previous_Form)=")") 66 or Previous_Kind = Reserved_Word_All 67 then 68 Send(Delimiter, C); 69 else 70 State := Character_Literal_1; 71 end if; According to Dewar and Taft (this thread) I should add String_Literal (Taft only) and Character_Literal to the list of apostrophe-enabling previous tokens (lines 64-66). But those are syntax errors, no? I tried "123"'Length on GNAT. It says "binary operator expected" on the apostrophe (error). Thanks. | |,| | | |RuaFranciscoTaborda24RcD 2815-249CharnecaCaparica 351+939354005 |M|A|R|I|O| |A|M|A|D|O|DepartmentoDeInformaticaFCT/UNL 2825-114 Caparica 351+212958536 |A|L|V|E|S| fax 212948541 | | | | | | maa@di.fct.unl.pt FCT 212948300