The lexer takes the mode parameter and has extra logic for disambiguation. There are multiple parsers for multiple dialects, and they're both hand-written and generated.
Feel free to follow up if this catches your interest. I'm looking for feedback on both Eggex and Oil!
Comments
I call the technique "lexer modes" but it's trivial:
When Are Lexer Modes Useful? http://www.oilshell.org/blog/2017/12/17.html
Overview of the parser:
How to Parse Shell Like a Programming Language http://www.oilshell.org/blog/2019/02/07.html
You could look at the architecture like this:
The lexer takes the mode parameter and has extra logic for disambiguation. There are multiple parsers for multiple dialects, and they're both hand-written and generated.Feel free to follow up if this catches your interest. I'm looking for feedback on both Eggex and Oil!
more posts:
http://www.oilshell.org/blog/tags.html?tag=eggex#eggex
http://www.oilshell.org/blog/tags.html?tag=parsing-shell#par...