Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Paul Snively <psnively@m...>
Subject: Re: [Caml-list] CFG's and OCaml
-----BEGIN PGP SIGNED MESSAGE-----
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 
Elkhound.

> 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.
>
> david.mcclain@avisere.com
> +1.520.390.7738 (USA)
>
Best regards,
Paul

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iEYEARECAAYFAkEc8yMACgkQbot1wzHBQBWHggCeNLjlA7AdwuvQBRZ+T5LDqvkQ
WLoAniMo7jA2ISdBz24MeDUZd8aJ7bNt
=JehV
-----END PGP SIGNATURE-----

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners