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 56C6EBC3D for ; Mon, 8 Aug 2005 04:17:52 +0200 (CEST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.199]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j782HpOb017765 for ; Mon, 8 Aug 2005 04:17:51 +0200 Received: by rproxy.gmail.com with SMTP id a36so1157887rnf for ; Sun, 07 Aug 2005 19:17:51 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ue9XTtc2RNs+U8h+SaZUZZL9y9k0kdJcVFMRUA7HmrP2MrYhCrBxioWFZnnVhVwE+lDTLPNhKiUPgA1B83xozh7OvBAATAkNEO+lrbJomiARkbEPCdLy/U2hsWJl8E4NchlPnMj9lIFvt0YGFC2vqbBDMnFZielqhCJDARQUP5I= Received: by 10.38.101.1 with SMTP id y1mr2390870rnb; Sun, 07 Aug 2005 19:17:51 -0700 (PDT) Received: by 10.38.209.44 with HTTP; Sun, 7 Aug 2005 19:17:51 -0700 (PDT) Message-ID: Date: Mon, 8 Aug 2005 14:17:51 +1200 From: Jonathan Roewen Subject: Re: [Caml-list] ocamllex+ocamlyacc and not parsing properly Cc: caml-list@yquem.inria.fr In-Reply-To: <200508080058.12357.jon@ffconsultancy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200508080058.12357.jon@ffconsultancy.com> X-Miltered: at nez-perce with ID 42F6C0CF.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocamllex:01 ocamlyacc:01 parsing:01 lexer:01 tokens:01 eol:01 parser:01 eol:01 lexer:01 grammar:01 parser:01 invokes:01 parses:01 invokes:01 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=RCVD_BY_IP autolearn=disabled version=3.0.3 > So you're lexer is emitting the tokens str, com, str, com, str, eol but y= our > parser looks as though it is expecting str, com, str, str, str, eol. >=20 > I'm guessing the error is in the lexer because the grammar in the parser = is > very simple. So ":Sovereign.Wyldryde.org" is lexed by "message" into str,= " " > then invokes "command" which parses 254 into com, " " then invokes "param= " > which parses "dst" into str, "param" then invokes the remaining into strs= . >=20 > However, that can't be correct because the lexer has clearly gone back in= to > "command" in order to emit "Irc_types.Numeric 112". >=20 > It's just a guess, but have you assumed that each time the lexer is invok= ed by > the parser that it starts in the rule it was left in when, in fact, the > parser invokes the "message" rule every time? Yes, I assume it continues lexing where it left off. If this is not the case, what's the best way to do conditional parsing?? Jonathan