caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] stream parser jump-back
@ 2002-08-04 18:59 Max Kirillov
  2002-08-05  6:40 ` Daniel de Rauglaudre
  0 siblings, 1 reply; 3+ messages in thread
From: Max Kirillov @ 2002-08-04 18:59 UTC (permalink / raw)
  To: caml-list

Hello!

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):

expr:
[[ 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
now)?

Thanks for your attention.
Max.
-------------------
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] 3+ messages in thread

end of thread, other threads:[~2002-08-06  3:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-04 18:59 [Caml-list] stream parser jump-back Max Kirillov
2002-08-05  6:40 ` Daniel de Rauglaudre
2002-08-06  3:05   ` Max Kirillov

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).