From nobody@digitalkingdom.org Tue Oct 30 17:55:17 2007 Received: with ECARTIS (v1.0.0; list lojban-list); Tue, 30 Oct 2007 17:55:17 -0700 (PDT) Received: from nobody by chain.digitalkingdom.org with local (Exim 4.67) (envelope-from ) id 1In1rY-0002ud-E4 for lojban-list-real@lojban.org; Tue, 30 Oct 2007 17:55:16 -0700 Received: from rlpowell by chain.digitalkingdom.org with local (Exim 4.67) (envelope-from ) id 1In1rW-0002uM-MX for lojban-list@lojban.org; Tue, 30 Oct 2007 17:55:15 -0700 Date: Tue, 30 Oct 2007 17:55:14 -0700 From: Robin Lee Powell To: lojban-list@lojban.org Subject: [lojban] Re: PEG left recursive definitions Message-ID: <20071031005514.GL27850@digitalkingdom.org> Mail-Followup-To: lojban-list@lojban.org References: <737b61f30710301744x530646c8q748ccb5190ec3eee@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <737b61f30710301744x530646c8q748ccb5190ec3eee@mail.gmail.com> User-Agent: Mutt/1.5.16 (2007-06-11) X-archive-position: 13888 X-ecartis-version: Ecartis v1.0.0 Sender: lojban-list-bounce@lojban.org Errors-to: lojban-list-bounce@lojban.org X-original-sender: rlpowell@digitalkingdom.org Precedence: bulk Reply-to: lojban-list@lojban.org X-list: lojban-list On Tue, Oct 30, 2007 at 07:44:38PM -0500, Chris Capel wrote: > Does the PEG currently use left recursive definitions? The *only* place in Lojban that is unavoidably left-recursive is the RPN mekso stuff. > 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' If you can show me how to fix the RPN productions in my PEG, I'd really appreciate it; I never quite got it right. It parses IFF it should parse, but the resulting tree is wrong. -Robin -- Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo Proud Supporter of the Singularity Institute - http://singinst.org/ http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ 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.