[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: case insensitive lexing?



How is the SAS paper going?

Laurie

+-------------------------------------------------------------+
| Professor Laurie Hendren, School of Computer Science        |
| McGill University                                           |
| 318 McConnell Engineering Building      tel: (514) 398-7391 |
| 3480 University Street                  fax: (514) 398-3883 | 
| Montreal, Quebec H3A 2A7               hendren@cs.mcgill.ca |
| CANADA                  http://www.sable.mcgill.ca/~hendren |
+-------------------------------------------------------------+

On Mon, 24 Jan 2000, Etienne M. Gagnon wrote:

> Hi steve.
> 
> > I need to build a case-insensitive lexer, namely recognize about 80
> > keywords whose case doesn't matter.
> 
> I already answered this:
> 
> http://www.sable.mcgill.ca/listarchives/sablecc-list/msg00234.html
> 
> > Is there an easy way to extend a lexer for id=[A-Za-z][A-Za-z_0-9]* so
> > that it could return the appropriate keyword token if the id is one of
> > the reserved words (keywords) of the language, and return the "id" token
> > otherwise?
> 
> Just put all the keyword tokens first, then put the "id" token
> definition. 
> 
> Etienne
> -- 
> ----------------------------------------------------------------------
> Etienne M. Gagnon, M.Sc.                     e-mail: egagnon@j-meg.com
> Author of SableCC:                 http://www.sable.mcgill.ca/sablecc/
> ----------------------------------------------------------------------
>