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: -- (:)
From: Max Kirillov <max630@m...>
Subject: Re: [Caml-list] stream parser jump-back

On Mon, Aug 05, 2002 at 08:40:39AM +0200, Daniel de Rauglaudre wrote:
>> Is it possible in a stream parser to parse again already
>> accepted token.
> No.


Well, in the case I can simply note that little of module_expr
may be misparsed as expr, and define something like

    [[ ... -> (<:module_expr< ...>>,<:expr< ...>>)]]
    [[ (m1,_) = module_expr_or_expr; "." ... 
    | (_,e1) = module_expr_or_expr -> e1

and so on.

> You can add a grammar entry defined by a parser. There are examples of
> that in the "normal" syntax (, in Camlp4, subdirectory etc).
> See entries "test_ctyp_minusgreater", "test_label_eq",
> "test_typevar_list_dot". But I consider they are "hacks" to make
> some situation work.

Thank you.
That funcs use Stream.npeek to get a content of the stream,
than parse it manually. Hmm...

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: