http://en.wikipedia.org/wiki/
http://hwaci.com/sw/lemon/
It's always re-entrant and thread-safe, with some other advantages and all the best lessons of yacc (e.g. error-handling).
Anyway, I'm nearly sold on PEG (Parsing Expression Grammars).
http://en.wikipedia.org/wiki/
http://piumarta.com/software/
Unlike LR parsers, a PEG parser does not require a separate tokenizer. It's very elegant, much like BNF. I want to do some runtime comparisons, but I expect it to be comparable. I will try to attach a pegleg grammar that I wrote to solve this (with the added constraint of left-associativity):
https://www.spoj.pl/problems/
Just install peg/leg, run 'leg' on the attached file (if I ever manage to post it to this blog), and compile.
Here is an interesting table:
http://en.wikipedia.org/wiki/
To learn a ton about PEG:
http://pdos.csail.mit.edu/~
In a nutshell, a Context-Free Grammar parser like yacc is meant for natural language, based on Chomsky's work, not for an unambiguous computer language. PEG simplifies the parser by eliminating ambiguity in the grammar.
No comments:
Post a Comment