For debugging, set $::RD_TRACE = 1. It is very verbose, but allows you to debug your grammars without risk of altering their behavior. For your script, it outputs this: (truncated by me)

Parse::RecDescent: Treating "/\w/" as a /../ pattern terminal printing code (9723) to RD_TRACE 1| start |Trying rule: [start] | 1| start | |"ABCD" 1| start |Trying production: [character | | |character character] | 1| start |Trying subrule: [character] | 2|character |Trying rule: [character] | 2|character |Trying production: [/\w/] | 2|character |Trying terminal: [/\w/] | 2|character |>>Matched terminal<< (return value: | | |[A]) | 2|character | |"BCD" 2|character |>>Matched production: [/\w/]<< | 2|character |>>Matched rule<< (return value: [A]) | 2|character |(consumed: [A]) | 1| start |>>Matched subrule: [character]<< | | |(return value: [A] | . . .

Good Day,
    Dean


In reply to Re: RecDescent help by duelafn
in thread RecDescent help by ikaruga

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.