From nobody@digitalkingdom.org Tue Oct 30 17:44:46 2007 Received: with ECARTIS (v1.0.0; list lojban-list); Tue, 30 Oct 2007 17:44:46 -0700 (PDT) Received: from nobody by chain.digitalkingdom.org with local (Exim 4.67) (envelope-from ) id 1In1hN-0002PN-66 for lojban-list-real@lojban.org; Tue, 30 Oct 2007 17:44:46 -0700 Received: from rv-out-0910.google.com ([209.85.198.185]) by chain.digitalkingdom.org with esmtp (Exim 4.67) (envelope-from ) id 1In1hH-0002P7-Rt for lojban-list@lojban.org; Tue, 30 Oct 2007 17:44:44 -0700 Received: by rv-out-0910.google.com with SMTP id b22so1907931rvf for ; Tue, 30 Oct 2007 17:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=Xh9NEJ+iYsPMqEjmg76eMigWqah9R0bj92P9dIKMnsI=; b=WqKb+aWFKTK4wTlFbYK+paMNT9DSKR7K/RKNRqYTbbRm5VewDGYBKKuzhWkvRoApuXWA6gABDqhCarcHxUq7mxE0xZgqSQUD9ULqK3WE3FavIJeanTz4nNX6jkQ8+Bz96Rhcw6n0amXTQ89EFlsr54xNidXTZjG4H1Ww1qkRb/M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=HmxsnY05wFN+lFLzLR1b3jFKSvEOmLFHyScLD9lIT6DwC7F9o6z+VzFZF4ZefVT7UfbRelayfKFLrU3x9VqO5qGdXhYhXnv3zYx/+n4Bl91ail/gLZdZ44aTw0vRH4zKOQSlejHWholAjAE0iD3bdLR5vt3vew7TIh84voZ1BQE= Received: by 10.114.146.1 with SMTP id t1mr5434323wad.1193791478116; Tue, 30 Oct 2007 17:44:38 -0700 (PDT) Received: by 10.114.24.4 with HTTP; Tue, 30 Oct 2007 17:44:38 -0700 (PDT) Message-ID: <737b61f30710301744x530646c8q748ccb5190ec3eee@mail.gmail.com> Date: Tue, 30 Oct 2007 19:44:38 -0500 From: "Chris Capel" To: lojban-list@lojban.org Subject: [lojban] PEG left recursive definitions MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Spam-Score: -0.0 X-Spam-Score-Int: 0 X-Spam-Bar: / X-archive-position: 13887 X-ecartis-version: Ecartis v1.0.0 Sender: lojban-list-bounce@lojban.org Errors-to: lojban-list-bounce@lojban.org X-original-sender: pdf23ds@gmail.com Precedence: bulk Reply-to: lojban-list@lojban.org X-list: lojban-list Does the PEG currently use left recursive definitions? If not, would it be helpful if it could? For instance. Example input: x ? x : x To parse this, we could write expr <- tri-cond / x tri-cond <- expr '?' expr ':' expr x <- 'x' This would be translated to expr-1 <- x tri-cond <- expr-1 '?' expr ':' expr / expr-1 expr <- tri-cond / expr-1 x <- 'x' I'm currently writing a PEG parser in C# that I hope will be able to support indirect left recursion, among other nice features. I have a quasi-mathematical algorithm that I believe shows that any level or complexity of indirect left-recursion can be resolved, (if anyone's interested I can post it,) but I'm not sure how it's going to work out. It could make a mess of the grammar, or maybe make optimizations much harder, or who knows what. Chris Capel -- "What is it like to be a bat? What is it like to bat a bee? What is it like to be a bee being batted? What is it like to be a batted bee?" -- The Mind's I (Hofstadter, Dennet) To unsubscribe from this list, send mail to lojban-list-request@lojban.org with the subject unsubscribe, or go to http://www.lojban.org/lsg2/, or if you're really stuck, send mail to secretary@lojban.org for help.