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 (15:41)
From: Brian Hurt <bhurt@s...>
Subject: Re: [Caml-list] CFG's and OCaml
On Fri, 13 Aug 2004, David McClain wrote:

> Okay... here's a case where when I do "exactly" what the gurus at Inria 
> do, I get a reduce/reduce conflict, and yet when I build OCaml it does 
> not report any such conflicts. [I say "exactly" because obviously I'm 
> not...]
> simple_expr:
> 	constant
> 	...
> simple_pattern:
> 	signed_constant
> 	...
> constant:
> 	INT
> | 	FLOAT
> signed_constant:
> 	constant
>   ;; /*  ---------------------------------------------------------- */
> The reduce/reduce conflict comes on deciding whether to assign an INT 
> seen to signed_constant which will reduce to simple_pattern, or instead 
> to become constant which reduces to simple_expr. Both Inria and I do 
> completely different semantic reductions in these two cases, and so a 
> reduce/reduce conflict could be fatal here...

When the compiler sees an int, which path should it take?

My advice would be to remove the constant from signed_constant's patterns.

> So, as so often happens with the master's touch, everything works fine 
> for them, but it doesn't for me. Why should this be, in this example 
> case?

They're doing something evil- take a look at line 355 of 
parsing/parser.mly in 3.08.0.

"Usenet is like a herd of performing elephants with diarrhea -- massive,
difficult to redirect, awe-inspiring, entertaining, and a source of
mind-boggling amounts of excrement when you least expect it."
                                - Gene Spafford 

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