Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'd like to point out that there are libraries (PyPEG, PyParsing, and PyMeta) which take EBNF-style descriptions of grammars and produce decently fast parsers, PEG-style. PyMeta's my personal favorite, since it both takes a straight text description, and also uses OMeta instead of ENBF, turning parse and lex into a single operation.

Of course, the downside is that formal grammars are often a bad fit for custom languages of the web, which tend to have incomplete/undecideable/context-dependent grammars. This would work for Markdown, though, since it does have a parseable grammar.



I agree. (Though my favorite is FuncParserLib, very haskellish.)

Using a real parser could probably cut half the code. Been meaning to make my own Markdown parser, everyone else's kind of sucks :-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: