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
camlp4 stream parser syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-03-08 (09:37)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: Re : Re : [Caml-list] Re: camlp4 stream parser syntax

On Sun, Mar 08, 2009 at 08:25:23AM +0000, Joel Reymont wrote:

> How can I make camlp4 parsing case-insensitive?

I think it should work with doing the two following things (both):

1/ Change your lexer to generate case-insensitive tokens.

2/ Use the field "tok_match" of the interface with the lexer. Redefining
   it allows you to match some token pattern with the corresponding token.
     See doc (camlp5) in:
   In the example "default_match", change the test "if con = p_con" into
   "if String.lowercase con = p_con".

Don't know if it still works with Camlp4, but you can often use the
Camlp5 documentation even for many Camlp4 features.

Daniel de Rauglaudre