in reply to using Perl with EBNF grammar

Hi,

I may have done this thread a disfavour when, motivated by some of the help pages, I left out a number of details to focus more on the question:

JadeNB, thanks for pointing me to Parse:EBNF. I find I've been focussing too much on finding Perl compatible versions of the tools I knew from the last time I did this (lex and yacc, over 20 years ago, which I know to now have flex and bison as counterparts), and hence have missed some other possible ways to parse languages. Unfortunately, counter to the name, that module isn't concerned with EBNF either.

EBNF, for those who do not know this, is a standard: ISO 14799. And the reason it is a standard is exactly this one: To avoid such problems of having a parser that can parse something, but it's not really defined the same way. For the details: A version of ISO 14799 can usually be found at Markus Kuhn's EBNF page. The normal form used for XML is not EBNF, even if the standard says so. I'm not even sure it's a Backus normal form at all. This faux pas seems to muddle the issue no end, including the weird situation of having an EBNF-parser that doesn't actually understand EBNF.

JavaFan, thanks for pointing me to Parse::RecDescent. Originally, I thought it would require C input, but apparently the description should be read differently.

It seemd both Parse::\w+ modules will get me somewhere, but not from where I am now. I probably will have to parse my pnf more formally to be able to get to either starting point. I guess that was inevitable anyway, but it's a bit weird to write a whole parser to preproccess the parser input. Anyway, I'll have to see which Parser module would work best for me.

Thanks,

PHM