12

Has anyone started working on this yet?

5
  • 1
    For the people who don't really care to Google an acronym that could mean 100 different things, could you please define BNF Jan 15, 2010 at 3:56
  • Oh, and I wasn't the downvote. I don't really down or upvote anything I don't know about. Jan 15, 2010 at 4:00
  • 14
    I'm 99% sure me means Backus-Naur Form: en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form / This is not meant as an attempt to be "Elite", but: There is really only one meaning of BNF that applies here, and the people this question is directed at would know what he wants, so there is no implicit need to explain it. Of course, it's always nice though :) Jan 15, 2010 at 4:01
  • But if we don't know what BNF means, how can we know if it's directed at us? Jan 15, 2010 at 4:19
  • The questions's on Meta, so it's directed at us, and as Michael Stum said, there's only one conceivable meaning in this context. I see antony.trupe has volunteered to start it off. Everyone loves a volunteer.
    – pavium
    Jan 15, 2010 at 4:49

2 Answers 2

2

I had a little think about this after the podcast last week (having not paid much attention to Markdown before) and it's quite problematic to process with the a standard compiler front-end tool like lex&yacc / ANTLR. The problem is that so much of the language is positional and those tools are really designed to deal with context-free grammars.

It's probably still the way to go, but you need to put a stage infront of the lexer stage to handle it. You'd need to read all the lines into an array first and recognise those that start with quote '>' marks or tab/4space indents, then recognise groups of lines at the same level and insert tokens at the beginning/end of those groups of lines. Then you can proceed in a more context-free manner.

-2
<message> ::= 
<bold> ::=
<italic> ::=
<hyperlink> ::=
<blockquote> ::=
<pre-code> ::=
<img> ::=
<list> ::=
<ol> ::=
<ul> ::=
<h1> ::=
<h2> ::=
<hr> ::=
4

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .