From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr 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 A9A24BB9C for ; Thu, 24 Nov 2005 11:26:24 +0100 (CET) Received: from ash25e.internode.on.net (ash25e.internode.on.net [203.16.214.182]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jAOAQMUd018519 for ; Thu, 24 Nov 2005 11:26:23 +0100 Received: from rosella (ppp45-3.lns2.syd6.internode.on.net [59.167.45.3]) by ash25e.internode.on.net (8.12.9/8.12.6) with ESMTP id jAOAPLGO014829; Thu, 24 Nov 2005 20:55:22 +1030 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] Using Frontc From: skaller To: Zhu Ping Cc: Gerd Stolpmann , matthieu.dubuget@laposte.net, caml-list@yquem.inria.fr, Anil Madhavapeddy In-Reply-To: <438559DC.5020906@comp.nus.edu.sg> References: <002c01c5edae$afd08d20$1db312ac@comp.nus.edu.sg> <43806DF3.1000806@laposte.net> <000e01c5ee77$724858b0$1db312ac@comp.nus.edu.sg> <4373.192.168.1.2.1132566896.squirrel@gps.dynxs.de> <438559DC.5020906@comp.nus.edu.sg> Content-Type: text/plain Date: Thu, 24 Nov 2005 21:25:20 +1100 Message-Id: <1132827920.8955.9.camel@rosella> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 4385954E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 parser:01 lexing:01 lexeme:01 lexbuf:01 lexing:01 lexeme:01 lexbuf:01 emits:01 wrote:01 sourceforge:01 recursively:01 int:01 int:01 parse:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Thu, 2005-11-24 at 14:12 +0800, Zhu Ping wrote: > > /home/dreamer/code/sample1.c[1] Invalid symbol: int main(int base, int > expon) > /home/dreamer/code/sample1.c[2] Invalid symbol: { Spurious CR by any chance? Only one error per line here. Weird though, it should handle it. Anyhow the reason it works is simple enough: the parser is called 'initial' and here is the rule in question: | _ {E.parse_error "Invalid symbol" (Lexing.lexeme_start lexbuf) (Lexing.lexeme_end lexbuf); initial lexbuf} so you can see it emits a diagnostic .. and then continues by recursively calling itself again .. ignoring the error. -- John Skaller Felix, successor to C++: http://felix.sf.net