English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] stream parser jump-back
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-08-04 (18:58)
From: Max Kirillov <max630@m...>
Subject: [Caml-list] stream parser jump-back

Is it possible in a stream parser to parse again already
accepted token.

An example (a little incorrect) follows.

I'd like to make this in camlp:

A(B).c --> let module M = A(B) in M.c

To do that, i write (scematically):

[[ m = module_expr; "."; e = expr -> ... ]]

"Note" may be parsed as either module expression or a usual
one. But, expr cannot be followed by a period (that's wrong,
I know, but let's forget about it for a while). Then,
writing None, I've got the Stream.Error and parsing error.

So, can I write something like:
[[ TRY (m = module_expr); "."; ... and so on, do get parsing
failure insted of error, and push the successful head of failed
structute back into a stream, to parse it again (as an expr

Thanks for your attention.
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