Is it easier to write a recursive-descent parser using an EBNF or a BNF?
Posted
by Vivin Paliath
on Stack Overflow
See other posts from Stack Overflow
or by Vivin Paliath
Published on 2010-03-24T18:03:25Z
Indexed on
2010/03/24
18:13 UTC
Read the original article
Hit count: 591
I've got a BNF and EBNF for a grammar. The BNF is obviously more verbose. I have a fairly good idea as far as using the BNF to build a recursive-descent parser; there are many resources for this. I am having trouble finding resources to convert an EBNF to a recursive-descent parser. Is this because it's more difficult? I recall from my CS theory classes that we went over EBNFs, but we didn't go over converting them into a recursive-descent parser. We did go over converting BNF's into a recursive-descent parser.
The reason I'm asking is because the EBNF is more compact.
From looking at the EBNF's in general, I notice that terms enclosed between {
and }
can be converted into a while
loop. Are there any other guidelines or rules?
© Stack Overflow or respective owner