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
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: 2007-10-31 (13:51)
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.


> --- Peter