Re: Declaring 'reserved words'

"C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com> writes:
> So instead of the definitions above, 'name' could be defined using
> priorities to prefer
>
>                  @name = {10} reserved-word
>                        | {5} extension
>                        | {1} ALPHA, (ALPHA|DIGIT|"-")+.
>              extension = ["xX"], "-", (ALPHA|DIGIT|"-")+.
>          reserved-word = "BEGIN"; "END".
>
> But note that this does not completely solve the problem:  "BEGIN" and
> "END" are still accepted as names; they are just marked specially.
>
> So a simple priority scheme is not going to do the trick. Rats.  I had
> hopes for that.

It would make sure that the priority parse would mark them as reserved
words though. That would probably simplify downstream cleanup.

> (What was that noise?  It sounded like five regular expressions falling
> on the floor in a heap.)

Next to all those open worm cans, I suppose.

                                        Be seeing you,
                                          norm

--
Norm Tovey-Walsh
Saxonica

Received on Monday, 27 June 2022 15:57:41 UTC