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

In reply to Re: using Perl with EBNF grammar by phm
in thread using Perl with EBNF grammar by phm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.