From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA29818 for caml-redistribution; Fri, 3 Dec 1999 19:28:57 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA27767 for ; Fri, 3 Dec 1999 15:32:05 +0100 (MET) Received: from batman.labri.u-bordeaux.fr (batman.labri.u-bordeaux.fr [147.210.8.5]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id PAA23911 for ; Fri, 3 Dec 1999 15:32:03 +0100 (MET) Received: from serveur2-1.labri.u-bordeaux.fr (vanicat@serveur2-1 [147.210.8.176]) by batman.labri.u-bordeaux.fr (8.8.7/8.8.7) with ESMTP id PAA13315; Fri, 3 Dec 1999 15:32:34 +0100 (MET) Received: (from vanicat@localhost) by serveur2-1.labri.u-bordeaux.fr (8.9.3/8.8.8/Debian/GNU) id PAA08452; Fri, 3 Dec 1999 15:32:00 +0100 Sender: weis To: Georges Mariano Cc: "caml-list@inria.fr" Subject: Re: "nested" parsers References: <38467330.86DA3330@inrets.fr> From: Remi VANICAT In-Reply-To: Georges Mariano's message of "Thu, 02 Dec 1999 13:25:04 +0000" Date: 03 Dec 1999 15:32:00 +0100 Message-ID: User-Agent: Gnus/5.070097 (Pterodactyl Gnus v0.97) Emacs/20.3 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Georges Mariano writes: > Hello everyone, > > We have developed a parser for a language L using ocamllex > and ocamlyacc , thus we have a L.mly > > It appears that we can divide the language L in a few "sub"-languages. > Let's say that L3 <: L2 <: L1 = L ('<:' included in ) > > And we would like to have one entry point for each language > in our parser. > a) is it possible (i.e with ocamlyacc) ? > (with one .mly, with several ??) > > b) how to do that ? (it's not very clear for us ;-) > (pointers to specifica documentation or examples are > welcome...) i am not sure of what you want, but you have this in the documentation: %start symbol ...  symbol Declare the given symbols as entry points for the grammar. For each entry point, a parsing function with the same name is defined in the output module. Non-terminals that are not declared as entry points have no such parsing function. Start symbols must be given a type with the %type directive below. so for each sub-languages you mai put the corresponding symbol in the start close