Version française
Home     About     Download     Resources     Contact us    
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.

Sad.

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

module_expr_or_expr:
    [[ ... -> (<:module_expr< ...>>,<: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 (pa_o.ml, 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...

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