Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Case-insensitive lexing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-02-23 (15:31)
From: Joel Reymont <joelr1@g...>
Subject: Case-insensitive lexing

Is there a way to make a case-insensitive lexer with ocamllex?

The only answer I was able to find is the following from John Skaller:

| identifier {
   let x = toupper (lexeme lexbuf) in
   try Hashtbl.find keywords x
   With Not_found -> x

	Thanks, Joel