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
Multiple Yacc-style Parsers in one application?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Christian Rinderknecht <rinderkn@p...>
Subject: Re: Multiple Yacc-style Parsers in one application?
Hello Steve,

Last year I wrote in OCaml a software that had to deal with multiple
output/input files of a commercial tool, and hence needed up to six lexers
and parsers. The different formats were rather close (both lexically and
syntactically), but I wasn't able to share the lexers and the parsers
rules because:
  1) ocamllex generates an "open <Parser module name>" directive;
  2) ocamlyacc doesn't allow rule sharing.
Nevertheless, I shared a lot of semantic actions (defined in standalone

The first point could be solved if ocamllex produced a functor whose
argument signature would constrain the abstract syntax tree, but I am not
sure the underlying implementation of lexer buffers would then behave

Best regards,


Christian Rinderknecht
PolySpace Technologies          Tel:
c/o INRIA                       Fax:
655, Av. de l'Europe  
F-38330 Montbonnot St Martin

On Fri, 23 Jun 2000, Steve Stevenson wrote:

> I'm interested in hearing experiences from people who have used
> multiple yacc parsers in one application. I assume that they would
> share one lexer buffer (but maybe not). Do you have to manipulate the
> lexical world to deal with the one-lookahead?