[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lojban] Re: Computer grammar question: non-left recursive RPN?
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/