English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2005-11-18 (14:59)
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 

-- Christian