-
-
Notifications
You must be signed in to change notification settings - Fork 166
ParsingCaseStudies
andychu edited this page Dec 10, 2016
·
16 revisions
What algorithms and tools do production-quality languages use for parsing?
- lexing
- parsing, including operator precedence parsing
- AST representation
TODO: Add links
- bash: multiple parsers.
- dash: hand-written lexer, recursive descent parser, generated AST nodes
- mksh: stateful lexer
- zsh:
PowerShell?
- Ninja: re2c for lexer (for speed, used to be hand-coded), recursive descent for parser.
- Python
- hand-coded lexer with indentation stack
- generated parser
- generated AST, with Zephyr ASDL
- Ruby
- Perl
- Julia: lexer and parser are hand-written in femtolisp! Enables Julia macros.
- v8
- Clang -- hand-written parser, enormous hand-written AST with C++ classes
- Go: hand-written C that was automatically converted to Go
- CoffeeScript: hand-coded lexer with regexes, token "fixups", JISON bottom up parser