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

case insensitive lexing?



I need to build a case-insensitive lexer, namely recognize about 80
keywords whose case doesn't matter.
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?

Thanks for your help,
Steve Kelem
Reporting-MTA: dns; ccn.CS.McGill.CA
Received-From-MTA: DNS; valiant.concentric.net
Arrival-Date: Mon, 24 Jan 2000 13:13:53 -0500 (EST)

Final-Recipient: RFC822; sablecc@sable.mcgill.ca
Action: failed
Status: 5.1.1
Remote-MTA: DNS; [132.206.3.53]
Diagnostic-Code: SMTP; 550 <sablecc@sable.mcgill.ca>... User unknown
Last-Attempt-Date: Mon, 24 Jan 2000 13:13:58 -0500 (EST)



I need to build a case-insensitive lexer, namely recognize about 80
keywords whose case doesn't matter.
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?

Thanks for your help,
Steve Kelem
begin:vcard 
n:Kelem;Steve
tel;fax:408-399-8905
tel;work:408-399-8900x18
x-mozilla-html:FALSE
url:http://www.adaptivesilicon.com
org:Adaptive Silicon, Inc.
adr:;;985 University Ave., Suite 31;Los Gatos;CA;95032-7639;U.S.
version:2.1
email;internet:kelem@adaptivesilicon.com
title:Chief Scientist
fn:Steve Kelem
end:vcard