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
Passing arguments to a parser generated by ocamlyacc
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-03-28 (10:25)
From: Joel Reymont <joelr1@g...>
Subject: Passing arguments to a parser generated by ocamlyacc

I need to pass a symbol table to the parser generated by ocamlyacc. I  
can do this fine with ocamllex and thought I could do the following  
for ocamlyacc:

%start program
%type <Symtab.symtab -> Easy.program> program

It doesn't work, unfortunately. Are there any workarounds?

My parser is supposed to be used as a C library. I have a hunch that  
when there are several calls to the parser the single mutable symbol  
table I'm using now will be overwritten, thus the need to pass one in.

	Thanks, Joel