Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] start conditions in ocamllex
@ 2004-02-25 18:07 Sean Proctor
  2004-02-25 19:00 ` Shawn Wagner
  0 siblings, 1 reply; 5+ messages in thread
From: Sean Proctor @ 2004-02-25 18:07 UTC (permalink / raw)
  To: caml-list

Hi,

Has anyone thought of implementing start conditions for ocamllex? I have some
problems that require keeping some state. They would be very simply solved
with start conditions. I don't know much about the internals of ocamllex, but
if the implementor of it thinks this is a good idea, I would be interested in
writing this.

I was thinking a good syntax would be something like:
regexp where condition

ex:
condition startcondition
rule entrypoint =
  parse 'a' { start startcondition; A_TOKEN }
    | 'a' where startcondition { finish startcondition; B_TOKEN }

so a string of a's would give alternating A_TOKEN and B_TOKEN.

Sean

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-02-26  2:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-25 18:07 [Caml-list] start conditions in ocamllex Sean Proctor
2004-02-25 19:00 ` Shawn Wagner
2004-02-25 19:23   ` Kenneth Knowles
2004-02-25 19:31     ` Shawn Wagner
2004-02-26  2:54     ` [Caml-list] Plea for arguments to Ocamlyacc generated parsers skaller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox