Syntax – Is it easier to write recursive drop parsers using EBNF or BNF?

I have a grammar for BNF and EBNF. BNF is obviously more verbose. As far as building a recursive descent parser using BNF, I have a pretty good idea; there are many resources for me. Could not find the resource to convert EBNF to recursive descent parser. Is this because it is harder? I recall from my CS theory class that we discussed EBNF, but we did not convert them into recursive descent parsers. We did convert BNF to recursive descent parsers.

I The reason for asking is because EBNF is more compact.

By looking at EBNF, I noticed that the term between {and} can be converted into a while loop. Are there other guidelines or rules?

Neither is harder than the other. Iteratively implements something and recursively implements something It’s really different. In BNF, everything is recursive. In EBNF, some recursion is expressed iteratively. EBNF grammar has different variations, so I only use English… “zero or more” is a simple The while loop, as you have discovered. “One or more” is the same as the one followed by “zero or more”. “Zero or one time” is a simple if statement. This should cover most cases.

I have a grammar for BNF and EBNF. BNF is obviously more verbose. As far as using BNF to build a recursive descent parser, I have a pretty good idea; there are a lot of resources for me. Could not find the resource to convert EBNF to recursive descent parser. Is this because it is harder? I recall from my CS theory class that we discussed EBNF, but we did not convert them into recursive descent parsers. We did convert BNF to recursive descent parsers.

I The reason for asking is because EBNF is more compact.

By looking at EBNF, I noticed that the term between {and} can be converted into a while loop. Are there other guidelines or rules?

Neither is harder than the other. It is really different between implementing something iteratively and implementing something recursively. In BNF, everything is It is recursive. In EBNF, some recursion is expressed iteratively. EBNF syntax has different variations, so I only use English… “Zero or more” is a simple while loop, as you have discovered. ” One or more” is the same as the one followed by “zero or more”. “Zero or one time” is a simple if statement. This should cover most cases.

Leave a Comment

Your email address will not be published.