in reply to Re: Backus Naur Form
in thread Backus Naur Form

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:

  1. Look into its source and see how it parses the BNF.
  2. 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.

Replies are listed 'Best First'.
Re^3: Backus Naur Form
by castaway (Parson) on Apr 27, 2005 at 08:26 UTC
    P::RD doesnt *quite* use BNF, in fact its kind of a slightly mutated *Extended*BNF (EBNF). BNF itself is a lot simpler.

    C.