On Mar 8, 2009, at 2:09 PM, Matthieu Wipliez wrote:
using a single rule, say buy : [ [ "buyOrSell"; ... ] ]
Yes, I want camel-case above.
and at lexing time do if String.lowercase s = "buyorsell" then IDENT "buy_or_sell" else IDENT s
And this is the part that I object to. I have quite a number of keywords and I don't want to have a bunch of if statements or have a hash table mapping lowercase to camel case. This would mean having to track the parser (camel case) version in two places: the lexer and the parser.
What I want is to extend Camlp4.Struct.Grammar.Static with a custom version of Make that applies String.lowercase before giving the string to 'using' to be inserted into the keywords table.
Thanks, Joel --- http://tinyco.de Mac, C++, OCaml _______________________________________________ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs