From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 5AD11BC3D for ; Sun, 7 Aug 2005 23:54:38 +0200 (CEST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.192]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j77LsbCB026756 for ; Sun, 7 Aug 2005 23:54:38 +0200 Received: by rproxy.gmail.com with SMTP id a36so1131592rnf for ; Sun, 07 Aug 2005 14:54:37 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=azv31Rxoener8j4VMt171cQoAjDyvfMTqizwmJiRxUWbgxdndF8i0HQIHE5ddRvMVz9KbVLdOoftjKuKbIe9XdkM3LK302O0gxdW+r8F/RstT8p4udjxaIQfCcsnXsOjUau+FV0uXRAidnhEgAsscF5aaXu1QOzkLME+mQq2spI= Received: by 10.38.11.37 with SMTP id 37mr2329039rnk; Sun, 07 Aug 2005 14:54:37 -0700 (PDT) Received: by 10.38.209.44 with HTTP; Sun, 7 Aug 2005 14:54:37 -0700 (PDT) Message-ID: Date: Mon, 8 Aug 2005 09:54:37 +1200 From: Jonathan Roewen To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] ocamllex+ocamlyacc and not parsing properly In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Miltered: at nez-perce with ID 42F6831D.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 parser:01 minor:01 lexer:01 mll:01 parser:01 lexing:01 wrote:01 exception:01 parsed:01 spaces: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 I should add what the expected format of the IRC string is: [':' ] { } [ ':' ] from :=3D letters not including space command =3D digit digit digit OR uppercase letters only param =3D letters not including spaces last-param =3D any letters including spaces Jonathan On 8/8/05, Jonathan Roewen wrote: > Hi, >=20 > I'm having some trouble with a lexer+parser I've written to parse IRC > strings. Just about all strings are parsed correctly, but I'm having a > few minor issues. >=20 > Here are two strings that fail to parse correctly: > :Sovereign.Wyldryde.org 254 dst 112 :holodeck programs running >=20 > :Sovereign.Wyldryde.org 333 dst #bfos Helio 112025589 >=20 > My irc_lexer.mll & irc_parser.mly are attached :-) (don't wanna spam > the list with huge lines of code) >=20 > Used in ircii.ml as: >=20 > let input_line =3D IO.read_line instream in > try match (Irc_parser.args Irc_lexer.message (Lexing.from_string > input_line)) with >=20 > If someone can highlight what's going wrong, I'd really appreciate it > (though, it doesn't currently affect any received irc commands of > great significance at the moment). >=20 > BTW: As an aside, if the lexer doesn't cover all the bases, it doesn't > throw an exception, just screws up my OS (Bounds check error, followed > by seg-fault). >=20 > Jonathan >=20 >=20 >