Bison grammar for tree-sitter. Created from the official documentation and from examples.
It also supports embedded languages in grammar files (C, C++, D and Java).
This parser requires a semicolon between different grammar rules. While not in official documentation (as far as I know), it seems to be possible in practice to omit these semicolons.
For instance, while theoretically valid, this parser cannot parse this:
first_rule: token1 token1
second_rule: token3 token4If you want to use this parser, you will need to add semicolons, like this:
first_rule: token1 token1
;
second_rule: token3 token4
;- LGPL v3 or later:
grammar.jsand the generated parser artifacts (for example the files undersrc/such asparser.c,scanner.c,grammar.json, andnode-types.json). - GPL v3 or later: Test corpora derived from GNU projects, specifically the
files in
test/corpus/such ascomplete.txtandbash.txt. - MIT: The remaining tree-sitter support code and bindings (the contents of
bindings/, language-specific build helpers, and other infrastructure files that are not generated fromgrammar.js). These parts follow thelicensefields declared in the various package manifests.