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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6d9eb594a33cb947 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-30 08:45:57 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!128.230.129.106!news.maxwell.syr.edu!newsxfer.eecs.umich.edu!news.bu.edu!inmet!not-for-mail From: Tucker Taft Newsgroups: comp.lang.ada Subject: Re: very specific question on Ada syntax Date: Tue, 30 Jan 2001 11:45:56 -0500 Organization: AverStar (formerly Intermetrics) Burlington, MA USA Message-ID: <3A76EFC4.585811F6@averstar.com> References: NNTP-Posting-Host: nebula.burl.averstar.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: inmet2.burl.averstar.com 980873156 23201 141.199.8.77 (30 Jan 2001 16:45:56 GMT) X-Complaints-To: usenet@inmet2.burl.averstar.com NNTP-Posting-Date: 30 Jan 2001 16:45:56 GMT X-Mailer: Mozilla 4.75 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:4713 Date: 2001-01-30T16:45:56+00:00 List-Id: Mario Amado Alves wrote: > > > len := Color'image(Color'first)'length; > > Yes, of course. Thanks. Just found an example in the RM itself: > > Rainbow'Base'First 4.1.4(16) > > This was because I was wondering if a character literal could be tokenized > without context. I guess not. In > > A'B'C > > 'B' has the form of a character literal, but it is not it. I could perhaps > rely on the fact (?) that there is no attribute of only one letter, but > that is twisted to say the least. Anyone who has built a production-quality Ada compiler will know that distinguishing the attribute "'" from the character literal "'"..."'" requires some special finagling. The technique most of us have adopted is to keep track of whether the immediately prior token can be the last token of a "name", and if so, interpret the "'" as an attribute "tic" rather than as a character-literal "quote". In particular, if the prior token is: identifier ) string-literal ALL character-literal then a "'" should be interpreted as an attribute "tic"; otherwise presume it is the beginning of a character literal. > > | |,| | | |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 -- -Tucker Taft stt@avercom.net http://www.averstar.com/~stt/ Chief Technology Officer, AverCom, Inc. (A Titan Company) Burlington, MA USA (AverCom was formed 1/1/01 from the Commercial Division of AverStar) (http://www.averstar.com/services/ebusiness_applications.html)