caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Francois Rouaix" <francois@rouaix.org>
To: "Joel Reymont" <joelr1@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Case-insensitive lexing
Date: Fri, 23 Feb 2007 12:21:38 -0800	[thread overview]
Message-ID: <f2d6cc680702231221w49fc280di9b9a3eb1ec435b51@mail.gmail.com> (raw)
In-Reply-To: <23E977DC-77FF-44A2-8675-5EAA8F61505F@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 951 bytes --]

You could wrap existing lexbuf generating functions with a layer that
converts everything to uppercase or lowercase, and write your lexer
accordingly? Won't work if you have constants strings, but otherwise it puts
all the case logic in one place.


On 2/23/07, Joel Reymont <joelr1@gmail.com> wrote:
>
> Folks,
>
> 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
>
> --
> http://wagerlabs.com/
>
>
>
>
>
> _______________________________________________
> 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
>

[-- Attachment #2: Type: text/html, Size: 1597 bytes --]

  parent reply	other threads:[~2007-02-23 20:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-23 15:32 Joel Reymont
2007-02-23 15:41 ` [Caml-list] " Denis Bueno
     [not found] ` <011EB42A-05E3-4686-BED7-2DB8B2663221@cs.uni-sb.de>
2007-02-23 16:02   ` Joel Reymont
2007-02-23 19:04     ` Martin Jambon
     [not found]     ` <42EFE4CF-F2F8-4AD2-9909-D0CF027A17AD@cs.uni-sb.de>
2007-02-23 21:03       ` Joel Reymont
2007-02-23 22:51         ` Erik de Castro Lopo
2007-02-23 23:00           ` Jon Harrop
2007-02-23 23:39             ` Tom
2007-02-24  0:32               ` Jon Harrop
2007-03-17 19:55                 ` Oliver Bandel
2007-02-23 20:21 ` Francois Rouaix [this message]
2007-02-24  2:25 ` skaller
2007-02-24  2:46 ` Jon Harrop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f2d6cc680702231221w49fc280di9b9a3eb1ec435b51@mail.gmail.com \
    --to=francois@rouaix.org \
    --cc=caml-list@inria.fr \
    --cc=joelr1@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).