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] parsing: old and new ways
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] parsing: old and new ways

On Fri, Dec 14, 2001 at 08:44:27PM +0100, Philippe Esperet wrote:

> # Grammar.Entry.parse mirror (Stream.of_string "abcba");;
> Exception:
> Stdpp.Exc_located ((0, 5), Stream.Error "illegal begin of mirror").
> What am I missing?

The problem is the lexer you use. You took "Plexer.make ()" which
considers "abcba" as a token, therefore not matching the keywords
"a", "b" or "c".

To get the same result you should give the string "a b c b a" as

... or use another lexer, not "Plexer.make ()", which would return
each input character as token. It should be easy. If you need help
to write it, ask me.

Bug reports:  FAQ:
To unsubscribe, mail  Archives: