From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 0E3E7BC8C for ; Fri, 28 Jan 2005 03:28:22 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j0S2SLgh017509 for ; Fri, 28 Jan 2005 03:28:21 +0100 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 DAA15937 for ; Fri, 28 Jan 2005 03:28:21 +0100 (MET) Received: from smtp.syd.swiftdsl.com.au (smtp.syd.swiftdsl.com.au [218.214.224.138]) by nez-perce.inria.fr (8.13.0/8.13.0) with SMTP id j0S2SHVI017501 for ; Fri, 28 Jan 2005 03:28:20 +0100 Received: (qmail 7763 invoked from network); 28 Jan 2005 02:28:23 -0000 Received: from unknown (HELO coltrane.mega-nerd.net) (218.214.64.136) by smtp.syd.swiftdsl.com.au with SMTP; 28 Jan 2005 02:28:23 -0000 Received: from coltrane (localhost [127.0.0.1]) by coltrane.mega-nerd.net (Postfix) with SMTP id A04697B86 for ; Fri, 28 Jan 2005 13:28:13 +1100 (EST) Date: Fri, 28 Jan 2005 13:28:12 +1100 From: Erik de Castro Lopo To: Subject: Re: [Caml-list] yacc style Message-Id: <20050128132812.7001512c.ocaml-erikd@mega-nerd.com> In-Reply-To: <1106874879.12114.145.camel@pelican.wigram> References: <875c7e0705012712177a9e852@mail.gmail.com> <20050128083956.7dc72787.ocaml-erikd@mega-nerd.com> <1106874879.12114.145.camel@pelican.wigram> Organization: Erik Conspiracy Secret Labs X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; i386-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41F9A345.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41F9A342.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 sourceforge:01 wrote:01 wrote:01 parser:01 ocamlyacc:01 ocamllex:01 strangely:01 typedef:01 lexbuf:01 avoiding:01 parser:01 nospam:98 hacks:01 lex:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.0 X-Spam-Level: On 28 Jan 2005 12:14:39 +1100 skaller wrote: > On Fri, 2005-01-28 at 08:39, Erik de Castro Lopo wrote: > > > > Yes, normally the parser generates a parse tree which is then > > passed to the semantic analyser for semantic checking. > > Unfortunately this is useless in the common case > of needing to parse C. I'm happy to take your word for it John, but I'd like to know why. > It would surely be nice > to be able to pass an argument to ocamlyacc, > as can now be done for ocamllex. Could you give a example? > Strangely in this case the ideal place to add > on the typedef table would be the lexbuf, Ok, so this enables you to know at lex time if an identifier is a user type avoiding ugly parser hacks to work around the fact that identifier X is actually a user defined type. Am I on the right track here? Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ "life is too long to know C++ well" -- Erik Naggum