Hi,

I wrote 7 lines of EBNF-ish grammar. On my way to the eventual larger scale project, to be able to see what I'm doing, I'd like to apply this as follow:

  1. Create a perl program that detects well-formed expressions;
  2. Create a perl program that prints well-formed expressions in a human readable way;
  3. Create a perl program where rules will actually trigger functions creating the intended output;
  4. Add more complexity to the grammar.

The problem is, I don't know how to get there from here. I'm obviously in .?lex and bovine country, but wherever I turn it says that either (or both of) input and output should be C(++). I have no problems with them, but they don't provide the ease I'm looking for. How do I do this with EBNF and Perl only?

PHM

In reply to 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.