comp.lang.ada
 help / color / mirror / Atom feed
From: Mario Amado Alves <maa@di.fct.unl.pt>
To: comp.lang.ada@ada.eu.org
Subject: Re: very specific question on Ada syntax
Date: Wed, 31 Jan 2001 11:40:12 +0000 (WET)
Date: 2001-01-31T11:40:12+00:00	[thread overview]
Message-ID: <mailman.980940984.1270.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <956vav$e7q$1@nnrp1.deja.com>

> > > 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





  parent reply	other threads:[~2001-01-31 11:40 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-30  6:28 very specific question on Ada syntax Christoph Grein
2001-01-30  7:16 ` Jean-Pierre Rosen
2001-01-30 16:25   ` Mario Amado Alves
2001-01-30 17:57     ` Robert Dewar
2001-01-30 19:16       ` Ted Dennison
2001-01-31  6:16         ` Robert Dewar
2001-01-31 11:40       ` Mario Amado Alves [this message]
2001-01-31 22:09         ` Florian Weimer
2001-02-01  5:39           ` Robert Dewar
2001-02-01  5:39           ` Robert Dewar
2001-02-04 14:24             ` Florian Weimer
2001-02-01  5:38         ` Robert Dewar
2001-02-01 18:24           ` Mario Amado Alves
2001-02-02  3:52             ` Robert Dewar
2001-01-30 19:06     ` Ted Dennison
2001-01-31  6:18       ` Robert Dewar
2001-01-30 18:41 ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2001-02-02  5:53 Christoph Grein
2001-02-01 11:10 Christoph Grein
2001-02-01 17:58 ` Robert Dewar
2001-02-01  7:14 Christoph Grein
2001-02-01  5:52 Christoph Grein
2001-02-01  6:25 ` Robert Dewar
2001-02-01  9:21   ` Keith Thompson
2001-01-31  5:01 Christoph Grein
2001-01-31  6:02 ` Robert Dewar
2001-01-30  9:30 Christoph Grein
2001-01-30  7:19 Jean-Pierre Rosen
     [not found] <mailman.980516658.10759.comp.lang.ada@ada.eu.org>
     [not found] ` <94s4vm$qr4$1@nnrp1.deja.com>
2001-01-26 20:26   ` Florian Weimer
2001-01-28  0:28     ` Robert Dewar
2001-01-30  8:47       ` Florian Weimer
2001-01-30 18:35         ` Robert Dewar
2001-01-30 22:16           ` Florian Weimer
2001-01-31  6:10             ` Robert Dewar
2001-01-31 13:29               ` Florian Weimer
2001-01-31 14:40                 ` Marc A. Criley
2001-01-26 22:43 ` Paul Graham
2001-01-28  0:32   ` Robert Dewar
     [not found] <200101261211.NAA13016@bulgaria.otn.eurocopter.de>
2001-01-26 17:17 ` Mario Amado Alves
2001-01-28  0:36   ` Robert Dewar
2001-01-29 11:11     ` Mario Amado Alves
2001-01-29 15:55       ` Ted Dennison
2001-01-29 16:41         ` Ted Dennison
2001-01-29 17:52         ` Mario Amado Alves
2001-01-30  6:26         ` Robert Dewar
     [not found] <B6A1A9B09E52D31183ED00A0C9E0888C4699C9@nctswashxchg.nctswash.navy.mil>
     [not found] ` <mailman.980504596.2748.comp.lang.ada@ada.eu.org>
2001-01-26 16:17   ` Paul Graham
2001-01-26 16:38   ` Robert Dewar
2001-01-30 16:45   ` Tucker Taft
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox