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-26 08:19:07 PST Path: supernews.google.com!sn-xit-02!sn-xit-04!supernews.com!cabal10.airnews.net!news.airnews.net!cabal11.airnews.net!news.airnews.net!news.cadence.com!not-for-mail From: Paul Graham Newsgroups: comp.lang.ada Subject: Re: very specific question on Ada syntax Date: Fri, 26 Jan 2001 11:17:06 -0500 Organization: Cadence Design Systems Message-ID: <3A71A302.15F87C6E@cadence.com> References: NNTP-Posting-Host: pgraham-dsl.cadence.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.51 [en] (X11; I; SunOS 5.5.1 sun4u) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:4560 Date: 2001-01-26T11:17:06-05: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. VHDL, which is based on Ada, allows user defined attributes, so it is possible to have, say x'some_user_attr'length and there is no rule preventing a user defined attribute from being one character in length, so you can have: x'y'length A VHDL parser won't get confused for the same reason that an Ada parser wouldn't: a character literal cannot immediately follow an identifier. Paul