Version française
Home     About     Download     Resources     Contact us    
Browse thread
Parsing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Parsing
On Fri, 2007-06-22 at 00:14 +0100, Jon Harrop wrote:
> I'm not a parser junkie, so please bear with me if this is silly...
> 
> The camlp4 stream parsing syntax extension is a very cool way to write 
> efficient parsers for simple grammars:

[]

> However, you must factor heads in the pattern matches. 

> Why is this? Is it because the streams are destructive? 

Yes.

> Are there other parser tools that integrate into the language and do a better 
> job?

Yes. Dypgen. I'm cc'ing to emmanuel, because a Dypgen parser using
a stream as an input would be very cool!

Dypgen is GLR, so all the cases get considered simultaneously.
The current build uses an LR0 kernel I think, so there's no
lookahead.

Also, dypgen is extensible, so you can build grammars at
run time and then parse with them. Doing that requires
a bit more code, some of which could be 'libraried' and the
rest probably supported with camlp4 macros if you're into that.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net