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
[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 Archives:
Bug reports: FAQ:
Beginner's list: