User talk:Kanor

Testing wiki grammar
Testing "a\n :a\n:a"

a :a
 * a

Testing ":a\na\n:a"


 * a

a
 * a

--Kanor

I consider this to be not context free, because the value of "***" is dependant on the exact prefix of the previous line(s).

a a
 * a
 * a
 * a
 * a
 * a

I consider this to be context free because the value of "  " is dependent only on whether the previous line was prefixed with " " or not.

a a a   a  a a a

--Conrad.Irwin

EBNF rules for wiki lists
It is actually context-free in both cases. Say we have this rule for a list:

list: list-item+ list-item: level-mark+, text-line

And this one for the fixed width lines:

pre-block: pre-line+ pre-line: " ", text-line

The two blocks can be generated by a set of context-free (type 2) grammar rules. The rules for the list items are actually defined as an undefined number of level marks, but actually this is valid in wiki code:

* a *** b ** c **** d * e

Resulting in:


 * a
 * b
 * c
 * d
 * e

Which does not make sense in terms of a list, but it is a drawback of the fact that the wiki markup requires several level marks to achieve a certain depth in the list.

--Kanor 23:07, 24 November 2009 (UTC)