In fact, the language that my "spew" language uses is very close to a BNF-style language anyway. You could probably use that parser as a good start.
| [reply] |
P::RD (Parse::RecDescent) uses BNF to parse text. It doesn't parse BNF. If I understood the OP correctly, he wants to parse the BNF notation itself, i.e. given a file with a BNF description, create a parse tree from it.
Naturally, you can use P::RD it to either:
- Look into its source and see how it parses the BNF.
- Write a grammar for BNF in it
I recommend the second technique, because it's (1) very simple, the BNF notation is trivial. (2) Will let one understand BNF as the rule descriptions of P::RD are written in it. | [reply] |
P::RD doesnt *quite* use BNF, in fact its kind of a slightly mutated *Extended*BNF (EBNF). BNF itself is a lot simpler.
C.
| [reply] |