Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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
strings:

  "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