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

On Wed, Nov 28, 2012 at 11:49 AM, Dave Pawson <dave.pawson@gmail.com> wrote:

> On 28 November 2012 17:17, David J. Weller-Fahy
> <dave-lists-public-markdown@weller-fahy.com> wrote:
>
> > EOL ::= (CR | LF | CR LF)
>
> Omits the LF CR option which is in the wiki markup I posted?
>
>
I actually don't believe LF CR is a legal line termination anywhere.  I can
imagine it being parseable, but consider the sequence

  CR LF CR LF  (two blank lines)

An LALR parser would work with ( CR LF | CR | LF ) and correctly capture
two newlines.  With ( LR CR | CR LF | CR | LF ) it would / might capture
three lines.


>
> >
> > LB ::= (SP SP EOL)
>
> No, SP* EOL no max limit... Needs testing but I think WS may be valid too?
> Karl?
> I would prefer meaningful symbols rather than two letter ones.... nit
> picking though.
>

We can expand the symbol names.  SP SP EOL is what the JG spec says is a
line break that is transformed into a <br />.  It is still part of a
paragraph, and I agree that it is not required in the paragraph definition,
but I also think it is harmless.


>
>
> >
> > TEXT ::= [^CR LF]  /* Is that syntactically correct? */
> I think so, using W3C syntax
>
> (expression)
> [char options]
>
> >
> > PARAPRE ::= (SP? SP? SP?)
> (sp){3}  ??? syntax? Where to find an ebnf checker for W3C syntax
>

The XML simplified syntax doesn't permit that.


>
>
> >
> > PARAPOST ::= ([^#x0020] SP)
>
> Whats this for? a para ends with para termination?
> Initially lets ignore 'inlines' such as <br/> till we are sure of basics?
>

Well - we can... But ([^#0020] SP?) correctly captures the JG document's
assertion that a paragraph ends with no more than a single space character.
 On the other hand, since a BLANKLINE is required after the paragraph to
actually terminate, this is superfluous.  I would remove the parapost and
just say TEXT EOL BLANKLINE


> >
> > BLANKLINE ::= (WS* EOL)
> >
> > PARAGRAPH ::= (PARAPRE TEXT PARAPOST EOL BLANKLINE)
>
> Need to include 'inlines' with text. optional.
>

I think inlines are permitted in this definition - once we start to define
them we will need to expand the definition of TEXT to permit them, or use (
TEXT | INLINE ) +


>
>
> >
> > 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 it's expressions inside braces, code points / symbols inside []
>
> I'll find a parser.
>
> regards
>
>
>
>
> --
> Dave Pawson
> XSLT XSL-FO FAQ.
> Docbook FAQ.
> http://www.dpawson.co.uk
>
>


-- 
Shane P. McCarron
Managing Director, Applied Testing and Technology, Inc.

Received on Wednesday, 28 November 2012 18:01:42 UTC