From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: Re: PEG Parser Date: Thu, 27 Jan 2011 22:25:50 -0500 Message-ID: References: <87bp3fi5cp.fsf@gnu.org> <87aaisr6sn.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1296200383 12581 80.91.229.12 (28 Jan 2011 07:39:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 28 Jan 2011 07:39:43 +0000 (UTC) Cc: =?ISO-8859-1?Q?Ludovic_Court=E8s?= , guile-devel@gnu.org To: Michael Lucy Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 28 08:39:37 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Piivf-0002ab-Nq for guile-devel@m.gmane.org; Fri, 28 Jan 2011 08:39:35 +0100 Original-Received: from localhost ([127.0.0.1]:49183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Piive-00060H-Vy for guile-devel@m.gmane.org; Fri, 28 Jan 2011 02:39:35 -0500 Original-Received: from [140.186.70.92] (port=53772 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Piidd-0008Ux-Ow for guile-devel@gnu.org; Fri, 28 Jan 2011 02:20:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Piidc-0006KG-SL for guile-devel@gnu.org; Fri, 28 Jan 2011 02:20:57 -0500 Original-Received: from mail-gx0-f169.google.com ([209.85.161.169]:48331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Piidc-0006Jr-PQ; Fri, 28 Jan 2011 02:20:56 -0500 Original-Received: by gxk5 with SMTP id 5so1208061gxk.0 for ; Thu, 27 Jan 2011 23:20:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=2EGxZIvfTeggfxZwUesMLhJGEZd05YNFxxoNk8IT4a8=; b=uFkIWBPgwTHQMyoOtKo/sO+CDEMBWpK0b4uxngepuVORpa0CPoZq51vrGx1BIv17/g 5xEF8M46V3eXRXSde82WylFe2hh75ypl8s6VKa4J3F7CcBAFJeiQ9pivUNG16ppD64su MatJ7tov/4zcpJdHJ+RFU9qVH9lUmWrM0jqBg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=lk4gofFCaMHuNgdBOTb3EaYYNliEmiXxCAzIc0JPkgh/ss5DAbzY8/M9T7tT6tx7BR wziwdMcBWWUZlizXiy+0rU1vHVgN6C2Oh0sSuCL99N+Swqe7TqHhhw2aD5rlYK0z/4BN Ow2+LEOJ1OIvjzkrHXYlynuHosANl7jMybJbs= Original-Received: by 10.150.229.11 with SMTP id b11mr1389421ybh.303.1296185150755; Thu, 27 Jan 2011 19:25:50 -0800 (PST) Original-Received: by 10.147.32.7 with HTTP; Thu, 27 Jan 2011 19:25:50 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: ILy0Dc32caEOJsYGTAR3A1-Z2Ic X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.169 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11367 Archived-At: Hello again, I've run into another issue with the parser that should be addressed in the documentation (or the code?). How do you match a character that is used in the PEG grammar, like "["? Can you only define such matchers via s-expressions? Noah On Thu, Jan 27, 2011 at 12:17 AM, Noah Lavine wro= te: > Hi, > >> It flattens until you have a list where each element either: >> 1. Is an atom. >> or 2. Is a list whose first element is in the list of keywords. >> >> So the car of the argument will change if it's a list that doesn't >> start with the right keyword. =A0E.g.: >> (keyword-flatten '(a) '((c (a b)) (a b) (b a))) -> >> (c (a b) (a b) b a) > > I see. > >> That's odd. =A0Could you paste in the lambda expression it generates? > > Wait, actually, I realized it was my own error. My test function was > using nonterminals, but I had only done (define grammar-string ....), > not (define-grammar grammar-string). I think the generated code tried > to call the nonterminals that should have been there, and threw an > error when it didn't find them. > > The peg matcher is really awesome. I am glad to be able to use it soon. > > Noah >