> I don't think this will work elegantly. > > Static first makes a Structure (is make the right term?) and then makes a bunch > of other modules using it. A custom Structure will be needed to downcase the > keywords before inserting them into the hash table, so Static will need to be > duplicated as well. Well I just duplicated Static to Static1 (and added Camlp4.Struct.Grammar where necessary) and replaced: module Structure = Camlp4.Struct.Grammar.Structure.Make Lexer; by: module Structure = struct include Camlp4.Struct.Grammar.Structure.Make Lexer; value using { gkeywords = table; gfilter = filter } kwd = let kwd = String.lowercase kwd in let r = try Hashtbl.find table kwd with [ Not_found -> let r = ref 0 in do { Hashtbl.add table kwd r; r } ] in do { Token.Filter.keyword_added filter kwd (r.val = 0); incr r }; end; This way, I redefine "using" to my liking, the only modification being the lower-casing on the first line. Structure is then passed to other functors as usual. Note that you need to compile Static1 with camlp4r because it is revised syntax (in ocamlbuild _tags this is camlp4r, use_camlp4). This seems to work (you need the lowercase in match_keyword too btw): I have "acTIon" and "actiON" in the parser, and parses "action" in input files. Cheers, Matthieu