English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2001-12-14 (20:57)
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: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr