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

On 28 November 2012 18:01, Shane McCarron <ahby@aptest.com> wrote:
>
>
> 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.

OK, if you're sure.


>
>>
>>
>> >
>> > 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.

For consistency please. All inlines in one group?




>> >
>> > PARAPRE ::= (SP? SP? SP?)
>> (sp){3}  ??? syntax? Where to find an ebnf checker for W3C syntax
>
>
> The XML simplified syntax doesn't permit that.

Where are you getting your parser/checker please?


>
>>
>>
>>
>> >
>> > 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

Would you do it please, lets see it? post para should be superfluous,
otherwise para termination isn't valid?



>> > 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 ) +

Prefer it explicit, latter option - clarity when reading.

regards




-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

Received on Wednesday, 28 November 2012 18:11:25 UTC