From rlpowell@digitalkingdom.org Wed Nov 10 12:54:26 2004 Received: with ECARTIS (v1.0.0; list lojban-list); Wed, 10 Nov 2004 12:54:26 -0800 (PST) Received: from rlpowell by chain.digitalkingdom.org with local (Exim 4.34) id 1CRzTn-0005I2-Fn for lojban-list@lojban.org; Wed, 10 Nov 2004 12:54:11 -0800 Date: Wed, 10 Nov 2004 12:54:11 -0800 To: lojban-list@lojban.org Subject: [lojban] Re: Computer grammar question: non-left recursive RPN? Message-ID: <20041110205411.GD17470@chain.digitalkingdom.org> Mail-Followup-To: lojban-list@lojban.org References: <20041107081848.GW18082@chain.digitalkingdom.org> <1099989949.419083bdf00a0@imp3-q.free.fr> <20041109190255.GW20718@chain.digitalkingdom.org> <1100077185.4191d881ce20e@imp3-q.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1100077185.4191d881ce20e@imp3-q.free.fr> User-Agent: Mutt/1.5.6+20040722i From: Robin Lee Powell X-archive-position: 8974 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 Wed, Nov 10, 2004 at 09:59:45AM +0100, Jo l'apache wrote: > there was no operand in the version I submitted you, so it was wrong anyway. > > here is another version : > > rp-expression = rp-operand rp-operand operator > rp-operand = operand rp-operand' > rp-operand' = rp-operand operator rp-operand' | () The second two statements are exactly equivalent to my current version: rp-expression <- operand rp-expression-tail rp-expression-tail <- rp-expression operator rp-expression-tail / () I don't think the first line makes any difference. This works, but it's right recursive, so the parse tree looks wrong. Thanks for trying, though. The parser generator I'm using actually has a way around this, but using it makes the resulting code GPLd. Not sure what I'm gonna do about that. -Robin -- http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ Reason #237 To Learn Lojban: "Homonyms: Their Grate!" Proud Supporter of the Singularity Institute - http://singinst.org/