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

Cool tutorial and introduction. In my toy languages, I prefer PEGs to CFGs because I believe in ordinal precedence of choice -- this means that your grammar can NOT be ambiguous. I also enjoy that you can skip tokenization.


I too am a fan of PEG (Parsing Expression Grammar [1]), in particular I like that it is pretty easy to write a PEG parser, whereas there is a lot more work and housekeeping (IMHO) in implementing an LALR[2] parser.

I find it interesting that the parser generators are so closely bound up with code generation. I like the model where you can specify at runtime: when this non-terminal is parsed, execute that function.

[1] http://en.wikipedia.org/wiki/Parsing_expression_grammar [2] http://en.wikipedia.org/wiki/LALR_parser




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

Search: