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
Ocamllex question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-10-23 (21:12)
From: Matt Gushee <matt@g...>
Subject: Another problem (was Re: [Caml-list] Ocamllex question)
While we're on the subject of Ocamllex, there's another issue I'm
wondering about. My lexer needs to handle quoted strings, something like:

  | '"' [^ '"'] * as word '"'     { WORD word }

Not essential, but it would be nice to allow escaped quotes within such

  "The quick brown fox jumped over the \"lazy\" dog."

I've haven't actually tried to implement this yet, but thinking about it
it seems like it would make the lexer hugely more complex. Can anyone
suggest a reasonably simple way to deal with escape sequences?

Matt Gushee
Englewood, CO, USA