Re:The language of languages
by aaronblohowiak on Monday January 14, 2013 @08:22PM
(#5057893)
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.
[ Parent
| on HN ]
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