From lojban+bncCK30vq5WEO-XsOcEGgQbqtyq@googlegroups.com Tue Nov 23 10:46:23 2010 Received: from mail-pz0-f61.google.com ([209.85.210.61]) by chain.digitalkingdom.org with esmtp (Exim 4.72) (envelope-from ) id 1PKxsh-00048G-0B; Tue, 23 Nov 2010 10:46:23 -0800 Received: by pzk7 with SMTP id 7sf91286pzk.16 for ; Tue, 23 Nov 2010 10:46:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:x-beenthere:received:received:received :received:received-spf:received:date:from:to:subject:message-id :references:mime-version:in-reply-to:user-agent:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type:content-disposition; bh=M52DkzzpBSad3brfK+FgxlU/9PoL17my5P9bqJEWBUk=; b=DjpAu6p3nqxLbJaCbSGsrvlIGVxjy+5Rp1EP84EimXAzywSDY63yRszqAaB76sfr46 9A0YI1JUwWiiBV20TECrW+KE+Q/kycuM2nVCWPFeUpER/pnruB+k5XTjRshmkwuG+GuN P+geUiPQL0lSRBNNLZ88NWcuAo3hja7jX1sTk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:date:from:to:subject:message-id:references :mime-version:in-reply-to:user-agent:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type:content-disposition; b=zBsSHRb4rU7LAPpilpmGT5fXZYUTp4lfXw3/BLDrBElHof+AILisIYzQ3gM2HMhtxV 9bsEzKXbzkrzyYtO/WABbR7yDUuUkLtpv73BpBmIl2L7JPPpd+aREf9zTcIsT5BRlEGp u5+uBXGRL/jnqFFF4TvJ57tq0Y6XQ3gD4Nuto= Received: by 10.142.250.38 with SMTP id x38mr390940wfh.59.1290537967909; Tue, 23 Nov 2010 10:46:07 -0800 (PST) X-BeenThere: lojban@googlegroups.com Received: by 10.142.78.15 with SMTP id a15ls3154377wfb.2.p; Tue, 23 Nov 2010 10:46:04 -0800 (PST) Received: by 10.142.199.12 with SMTP id w12mr4815389wff.68.1290537962742; Tue, 23 Nov 2010 10:46:02 -0800 (PST) Received: by 10.142.199.12 with SMTP id w12mr4815388wff.68.1290537962711; Tue, 23 Nov 2010 10:46:02 -0800 (PST) Received: from chain.digitalkingdom.org (digitalkingdom.org [173.13.139.234]) by gmr-mx.google.com with ESMTP id f13si9413832wfo.4.2010.11.23.10.46.02; Tue, 23 Nov 2010 10:46:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of rlpowell@digitalkingdom.org designates 173.13.139.234 as permitted sender) client-ip=173.13.139.234; Received: from rlpowell by chain.digitalkingdom.org with local (Exim 4.72) (envelope-from ) id 1PKxsQ-000483-2P for lojban@googlegroups.com; Tue, 23 Nov 2010 10:46:02 -0800 Date: Tue, 23 Nov 2010 10:46:02 -0800 From: Robin Lee Powell To: lojban@googlegroups.com Subject: Re: [lojban] NORATS, SPACE, and PUBLIC in PEG grammar Message-ID: <20101123184601.GS9301@digitalkingdom.org> References: <20101123180616.GB10838@alice.local> <20101123181027.GQ9301@digitalkingdom.org> <20101123181658.GR9301@digitalkingdom.org> <20101123183210.GD10838@alice.local> MIME-Version: 1.0 In-Reply-To: <20101123183210.GD10838@alice.local> User-Agent: Mutt/1.5.20 (2009-06-14) X-Original-Sender: rlpowell@digitalkingdom.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of rlpowell@digitalkingdom.org designates 173.13.139.234 as permitted sender) smtp.mail=rlpowell@digitalkingdom.org Reply-To: lojban@googlegroups.com Precedence: list Mailing-list: list lojban@googlegroups.com; contact lojban+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: Sender: lojban@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline On Tue, Nov 23, 2010 at 11:32:10AM -0700, .alyn.post. wrote: > > I had a brief conversation on the PEG parser mailing list about > associating code with rules in a PEG grammar. It seems that > embedding code inside '{}' brackets has become the standard way of > putting code inside a peg file, but there is no concensus on > whether that code should execute every time a production is parsed > (even after a backtrack), only executed the first time but not if > the rule was rematched after memoization, or only at the end of a > successful parse. > > Some parsers give you a flag or hook to say when code is executed. Not having 40 years of history *does* matter sometimes. :) > The most compelling case I found was where the 'code' inside '{}' > brackets was actually more like a tag, and the source code file > that handled the parse tree was stored separately from the > grammar. So tags inside '{}' were effectively function calls, but > could in theory be language independent. That would be a nice way to do it, yeah. > Do you know off-hand if the lojban grammar has something like this: > > expr <- mulexpr [+] mulexpr > mulexpr <- digits [*] digits > digits <- [0-9]+ > > Where a particular rule (in this case expr and mulexpr) has the > same non-terminal more than once (mulexpr non-terminal for rule > expr and digits non-terminal for rule mulexpr)? I would be *shocked* if it didn't. Lojban is, as far as anyone knows, the largest and most complicated regular language grammar that exists, except possibly the artificially-regular products of natural language research. Ah, here's one: terms-1 <- terms-2 (pehe-sa* PEhE-clause free* joik-jek terms-2)* > Also, what does snarf_morph.sh, from the cook file, do? I would > assume it grabs xorxes' morphology file from lojban.org? I didn't > see snarf_morph.sh in the rats/ folder. It's one level up. Here: http://teddyb.org/~rlpowell/hobbies/lojban/grammar/grammar.tgz That should simplify things for you. -Robin -- http://singinst.org/ : Our last, best hope for a fantastic future. Lojban (http://www.lojban.org/): The language in which "this parrot is dead" is "ti poi spitaki cu morsi", but "this sentence is false" is "na nei". My personal page: http://www.digitalkingdom.org/rlp/ -- You received this message because you are subscribed to the Google Groups "lojban" group. To post to this group, send email to lojban@googlegroups.com. To unsubscribe from this group, send email to lojban+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/lojban?hl=en.