This is my revised TAP grammar. I'm using this to drive development of the TAPx::Parser. If you're not familiar with reading this style of grammar, here are a few comments:

I'm using POSIX character classes to represent digits and printable characters. If you want to manually encode all of the Unicode characters for [:print:], be my guest :)

The following means "all printable characters except the newline".

([:print:] - "\n")

The following means, a digit followed by zero or more digits.

digit {digit}

A question mark after an atom means it's optional.

I'm not particularly gifted with grammars, so corrections welcome.

The corrected TAP grammar:

digit ::= [:digit:] character ::= ([:print:] - "\n") positiveInteger ::= ( digit - '0' ) {digit} nonNegativeInteger ::= digit {digit} tap ::= plan tests | tests plan {comment} plan ::= '1..' nonNegativeInteger "\n" lines ::= line {lines} line ::= (comment | test) "\n" tests ::= test {test} test ::= status positiveInteger? description? directive? status ::= 'not '? 'ok ' description ::= (character - (digit '#')) {character - '#'} directive ::= '#' ( 'TODO' | 'SKIP' ) ' ' {character} comment ::= '#' {character}

For purposes of forward compatability, all lines which do not match the grammar are labeled as TAPx::Parser::Result::Unknown and are not considered parse errors.

Cheers,
Ovid

New address of my CGI Course.


In reply to Revised TAP Grammar by Ovid

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.