On 11/8/07, Mark Clements [email protected] wrote:
This is normally abandoned when it is realised that this is 'very hard' (impossible in BNF/EBNF form according to some people).
Not to mention that BNF is not really suited to the task. BNF is supposed
to answer the question "does text A match grammar B?" However, essentially all wikitext is "valid" - so we're really looking for something that answers the question "how should text A be rendered" or "what is the meaning of text A" or even "how should text A be converted into a decorated* syntax tree".
For example, this text is "valid":
#foo ##boo #**moo ##woo
Is BNF capable of expressing that the second-level numbering restarts at "woo"? Do we even care - is our grammar attempting to describe an actual rendering of input text into output text, or does it consider the output to be HTML (<OL> etc).
So: - What do we mean by a "grammar" of Wikitext? - Are we also attempting to define the semantics of that grammar? - Do the semantics incorporate the semantics of the HTML elements themselves? - Why are we doing this anyway?
Steve