Version française
Home     About     Download     Resources     Contact us    
Browse thread
Problem with precedence declaration in .mly file
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Angela Zhu <angela.zhu@c...>
Subject: Re: [Caml-list] Problem with precedence declaration in .mly file

On Oct 31, 2007, at 6:52 AM, Peter Ilberg wrote:

>
> I have no experience with ocamlyacc, but looking at your grammar  
> below, it seems that you don't need the 'value PLUS exp' etc rules.  
> All these cases should be covered already by the 'exp PLUS exp'  
> rules at the beginning and the 'value' rule at the end.
>
> Try removing the 'value PLUS exp' rules. Maybe ocamlyacc gets  
> confused if it has two sets of productions that it has to  
> disambiguate with precedence rules.

I removed 'value PLUS exp' rules.
The precedence is still not correct, what is more, 1+ t (with t  
declared) gives a syntax error.

Thanks,
Angela



>
> --- Peter