From grey.havens@online.fr Mon Nov 08 21:48:42 2004 Received: with ECARTIS (v1.0.0; list lojban-list); Mon, 08 Nov 2004 21:48:43 -0800 (PST) Received: from smtp-102-tuesday.noc.nerim.net ([62.4.17.102] helo=mallaury.noc.nerim.net) by chain.digitalkingdom.org with esmtp (Exim 4.34) id 1CROrp-0000Ix-B3 for lojban-list@lojban.org; Mon, 08 Nov 2004 21:48:33 -0800 Received: from [192.168.1.3] (pilot.net2.nerim.net [213.41.129.7]) by mallaury.noc.nerim.net (Postfix) with ESMTP id EB20462E3F; Tue, 9 Nov 2004 06:48:23 +0100 (CET) In-Reply-To: <20041107081848.GW18082@chain.digitalkingdom.org> References: <20041107081848.GW18082@chain.digitalkingdom.org> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-19--734413724" Message-Id: <1624C623-3213-11D9-9684-000D9329C984@online.fr> From: =?ISO-8859-1?Q?Rapha=EBl_Poss?= Subject: [lojban] Re: Computer grammar question: non-left recursive RPN? Date: Tue, 9 Nov 2004 06:49:14 +0100 To: lojban-list@lojban.org X-Pgp-Agent: GPGMail 1.0.2 X-Mailer: Apple Mail (2.619) X-archive-position: 8965 X-ecartis-version: Ecartis v1.0.0 Sender: lojban-list-bounce@lojban.org Errors-to: lojban-list-bounce@lojban.org X-original-sender: grey.havens@online.fr Precedence: bulk Reply-to: lojban-list@lojban.org X-list: lojban-list --Apple-Mail-19--734413724 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; format=flowed Le 7 nov. 04, =E0 09:18, Robin Lee Powell a =E9crit : > Lojban has a reverse polish (i.e. postfix math) mode built in. > > The ABNF form of this rule is: > > rp-expression =3D rp-operand rp-operand operator > > rp-operand =3D operand / rp-expression > > which does exactly what you'd expect. > > I can't figure out a way to convert this into a version without left > recursion. I've got: > > rp-expression =3D operand rp-expression-tail > rp-expression-tail =3D rp-expression operator rp-expression-tail / () > > (where () is the empty production), but I'm not at all certain it's > equivalent, and the parse trees it produces look very wrong (i.e. > not left recursive at all). > > Help? > (I assume from the ABNF grammar above that a RP expression has at least=20= 2 operands and 1 operator) What about : rp-expression =3D operand operand rp-tail rp-tail =3D operand rp-tail / operator ? --=20 Rapha=EBl --Apple-Mail-19--734413724 Content-Type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: =?ISO-8859-1?Q?Ceci_est_une_signature_=E9lectronique_PGP?= content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFBkFpe18ht0zty5ysRAqlJAJ4zPDOOL7GXAMCipkwCXM5ytFD68wCePr0L HyLtOBr2MjKcbt/oEoVYMnU= =4AjO -----END PGP SIGNATURE----- --Apple-Mail-19--734413724--