Re: EBNF was Re: [markdown-testsuite] Add End Of Line (EOL) definition/tests. (#1)

* Dave Pawson <dave.pawson@gmail.com> [2012-11-28 11:37 -0500]:
> So who is going to have a go at a para in EBNF?
> 
> Any takers. Quite simply I think a generalised end of line is a non starter
> if the intent is to re-use it elsewhere as a terminator.
> Until we have tried a few, suggest we stick to a simpler option, then look
> for a re-write if it happens.

Hrm... while I'm eating lunch, I'll take a try.  Note, this is per [1].
Also, I do not attempt to address an inclusive list of characters [2] in
this, just sticking to excluding the EOL sequences.

[1]: http://www.w3.org/TR/REC-xml/#sec-notation
[2]: http://en.wikipedia.org/wiki/Unicode#Standardized_subsets

Definition follows (including a definition for a line break).

SP ::= #x0020

HT ::= #x0009

WS ::= (SP | HT)

CR ::= #x000D

LF ::= #x000A

EOL ::= (CR | LF | CR LF)

LB ::= (SP SP EOL)

TEXT ::= [^#x000D#x000A]

PARAPRE ::= (SP? SP? SP?)

PARAPOST ::= ([^#x0020] SP)

BLANKLINE ::= (WS* EOL)

PARAGRAPH ::= (PARAPRE TEXT PARAPOST EOL BLANKLINE)

How does that look?  I used the code-points inside brackets, because [1]
doesn't indicate that symbols may be used inside brackets.

I think that covers all the things we talked about, but please critique!

Regards,
-- 
dave [ please don't CC me ]

Received on Wednesday, 28 November 2012 17:17:57 UTC