An exploration of parsing techniques in r7rs scheme.
The parsing target are math expressions following this grammar:
expr -> expr ('+' | '-') term | term
term -> term ('*' | '/' | '%') factor | factor
factor -> power '^' factor | power
power -> ('-' | '+') power | base
base -> '(' expr ')' | number
number -> [0-9]+
For now these are the parsing techniques I used:
- recursive descent ->
rec-desc.sld
- recursive ascent ->
rec-asc.sld
- pratt ->
pratt.sld
These are the resources I used for learning about parsers:
recursive descent parsing:
- Parsing Expressions . Crafting Interpreters
- Let's Build a Simple Interpreter
- Create a programming language [part 3] - The Parser
- Recursive Descent Parser in OCaml
recursive ascent parsing:
- Writing a recursive ascent parser by hand
- lalr1-table-generator
- Recursive Ascent: An LR Analog to Recursive Descent
- Recursive-Ascent Parsing
pratt parsing:
Distributed under the MIT License. See LICENSE for more information.