English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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