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-29 22:41:22 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: Christoph Grein Newsgroups: comp.lang.ada Subject: RE: very specific question on Ada syntax Date: Tue, 30 Jan 2001 07:28:29 +0100 (MET) 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 980836881 16108 137.194.161.2 (30 Jan 2001 06:41:21 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Tue, 30 Jan 2001 06:41:21 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: Content-MD5: vpRhJDNEOnfZ+G/WTRFQAA== X-Mailer: dtmail 1.2.1 CDE Version 1.2.1 SunOS 5.6 sun4u sparc Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0 Precedence: bulk X-Reply-To: Christoph Grein 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:4689 Date: 2001-01-30T07:28:29+01:00 Ted Dennison wrote: > A'L'M; > > and got: > > Found IDENTIFIER_T A > Found CHARACTER_T 'L' > Found IDENTIFIER_T M > Found SEMICOLON_T ; > Found END_OF_FILE_T * > > I suppose the original author of the Ada syntax (Christop, I think) was Ted, you're doing me too much favour, I'm definitely NOT the author of the Ada syntax ;>) only of the syntax analyser. > more or less forced to do it that way because the OpenToken lexical > analyzer keeps no record of what the last token was. That can certainly > be fixed. It will add a bit of processing time on each token. But I think this isn't worth it as long as we do not definitely know of a compiler having a one letter attribute that also can appear as an attribute prefix (since A'L is correctly lexed). And as long as there are no such compilers, A'L'M is just a syntax error because it should perhaps be A & 'L' & M. So, as Robert Dewar said, Ada lexing is not so simple as it might look. BTW: I'm a physicist and have never studied (computer) language theory. I assumed that lexical analysis need not care for the previous token. Now I stand corrected. [OK, I already knew about the difference of access and 'Access, but I ignored this deliberately. Also here OpenToken will fail.] I'm more worried about how to lex wide characters. I gather the best way in OpenToken would be to leave the character recognizer alone and create a new wide_character recognizer, which then could handle the different encodings. We can postpone this until the need arises. Christoph Grein