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] CFG's and OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-08-13 (16:58)
From: Paul Snively <psnively@m...>
Subject: Re: [Caml-list] CFG's and OCaml
Hash: SHA1

Hi David!

On Aug 13, 2004, at 9:04 AM, David McClain wrote:

> Uhuhh... Yes, I did that same "evil" thing as well, even before 
> discussing all these reduce/reduce conflicts/
> What I find is that these screwball little tricks might help, and the 
> might not. YACC is just too darned sensitive to minor and non-obvious 
> perturbations in the input grammar specification. Realizing its 
> legacy, indeed it does arise from the old IBM-360, or more properly 
> PDP-10, days. That was the style of programming back then.. I remember 
> it well.
The issue isn't strictly one of style. You're using an entirely 
context-free parser generator to attempt to parse a grammar that _is 
not_ context free. The joker in this deck is that no non-trivial 
grammar is context-free, so all real-world "context free" grammars use 
some kind of trick to get past it. Hence the effort to turn (1) into 
(k) or, better still, (inf), cf. ANTLR, Spirit, Bison 1.50 or later, or 

> I had though the other night about creating a common subtree of 
> semantic actions and then let the higher levels unravel that subtree. 
> That would probably work well here, but it is a lot more work.
Quite. My advice remains to be to use Elkhound.

> David McClain
> Senior Corporate Scientist
> Avisere, Inc.
> +1.520.390.7738 (USA)
Best regards,

Version: GnuPG v1.2.4 (Darwin)


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: