Language parsing
BNF for specific URL schemes RFC 1738 - A Gopher URL Format (see also RFC updates RFC 1738)
Parsing and transpiling
esbuild/architecture.md at master · evanw/esbuild - esbuild bundler architecture
Concepts
Long switch in a loop, can be used for state machine, but it's not adviced to use long switch for parsing, because it's often need multiple states (to restore previous ones). Use recursive descent parser instead.
Generators
Jison - Bison in JavaScript / JavaScript parser generator. See https://github.com/zaach/jison
Parser examples
Tokenizer + parser
tree-sitter/tree-sitter: An incremental parsing system for programming tools - Create a grammar and generate a parser
retextjs/retext: Natural language processor powered by plugins based on @unifiedjs (and @vfile, @syntax-tree) - Natural language parser (latin, english, etc.)
Esprima - ECMAScript parser written in ECMAScript. See https://github.com/jquery/esprima
JSCSSP written by Daniel Glazman
https://dxr.mozilla.org/mozilla-central/source/layout/style/nsCSSParser.cpp
https://dxr.mozilla.org/mozilla-central/source/layout/style/nsCSSScanner.cpp
Use goto
s, "This is called computed (or assigned) goto and is a GCC extension"
https://github.com/quartzjer/js0n/blob/master/src/js0n.c
https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
https://news.ycombinator.com/item?id=4387156
Syntax exemples:
Syntax formats
Backus-Naur (Backus–Naur) form:
Augmented Backus-Naur form (Augmented BNF):
Railroad diagram
Last updated