Version française
Home     About     Download     Resources     Contact us    
Browse thread
ocamlyacc -- can i tell it to be quiet?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Christian Lindig <lindig@c...>
Subject: Re: [Caml-list] ocamlyacc -- can i tell it to be quiet?

On Nov 18, 2005, at 3:08 PM, skaller wrote:
> Is there any way to tell it to shut up?

If you have a shift/reduce conflict the default action is to shift. To 
get rid of the warning declare a higher precedence for the symbol being 
shifted. Say, there is a conflict when parsing FOO BAR - FOO could be 
reduced or BAR being shifted; declare in your Yacc file:

%nonassoc FOO
%nonassoc BAR

Nor BAR has higher precedence and gets shifted without creating a 
conflict. Obviously, this kind of conflict resolution requires some 
care.

-- Christian