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

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
input...

... 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.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
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