Zeek grammar for tree-sitter
Project description
tree-sitter-zeek
A Zeek grammar for tree-sitter.
Background
This grammar parses scripts written in the Zeek scripting language.
The goal of this grammar is to facilitate tooling around Zeek
scripts. For that reason, its structure resembles Zeek's grammar but differs in
a number of ways. For example, it tracks newlines explicitly and relies more
strongly on precedence and associativity to resolve ambiguities. Like Zeek's
parser, this one currently doesn't name symbols deeply: for example, the grammar
features an expr rule that covers any kind of expression, but the choices
aren't currently broken down into, say, addition_expr, or_expr, and
similars.
Usage
To use the generated parser directly (e.g. via any of tree-sitter's
language bindings),
clone this repository recursively. Generated sources are tracked in the
src directory. You do not need the tree-sitter CLI to use those
sources in your tooling, but you'll likely want it anyway to explore the parser.
For example, tree-sitter parse <script> produces the script's syntax tree, and
tree-sitter highlight <script> shows syntax-highlighted sources.
Building the parser
- Install tree-sitter on your machine.
- Generate the parser: run
tree-sitter generate.
Testing
There's currently no tree-sitter test testsuite. Instead, a test driver runs
the parser on every Zeek script in the Zeek distribution, reporting any
errors. For CI, a Github Action workflow additionally clones the Zeek tree prior
to running this test, to ensure that those Zeek scripts are available.
Releasing a new version
To release a new version manually update the version number in the following ecosystem-specific files:
package.json: keyversionpackage-lock.json: updatepackage.jsonand runnpm installto update the lock file.
pyproject.toml: keyproject.versionCargo.toml: keypackage.versiontree-sitter.json: keymetadata.versionCMakeLists.txt:VERSIONinprojectcall
Once all versions are consistently updated create a version tag vX.Y.Z and
push it. We trigger automatic publishing of releases for all tags.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tree_sitter_zeek-0.2.13.tar.gz.
File metadata
- Download URL: tree_sitter_zeek-0.2.13.tar.gz
- Upload date:
- Size: 239.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
228f05d20bb90521cceebf653614b4ee0a828e166b266ca991893cad0c5ce8d3
|
|
| MD5 |
6ec900183fcc7ff9074ecc820551055a
|
|
| BLAKE2b-256 |
0fe14cae5e331829b8ced109c26669a07cf3966f85cdd41893b91afd77cf18db
|
File details
Details for the file tree_sitter_zeek-0.2.13-cp310-abi3-win_arm64.whl.
File metadata
- Download URL: tree_sitter_zeek-0.2.13-cp310-abi3-win_arm64.whl
- Upload date:
- Size: 81.7 kB
- Tags: CPython 3.10+, Windows ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
019a8ef63efcb17dabff6728a4f73e48b524fbc316b861fe35b52834e2f19472
|
|
| MD5 |
8c78ec942225a9ee002c0c5b70ffafcd
|
|
| BLAKE2b-256 |
291ebaba650bcab9c2d22db3a443d451f6eb71730fc1bca8d215efbb2a9bd789
|
File details
Details for the file tree_sitter_zeek-0.2.13-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: tree_sitter_zeek-0.2.13-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 84.3 kB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c6ef015eae19d57e61da02e7fa5e66484d546ee10fd8391ed735a2a79e11a39
|
|
| MD5 |
2171270d222cabf9e1e1110e73c3e429
|
|
| BLAKE2b-256 |
f615d3cfe347333173f052849dd5f212af4b84b94a96438c332f1d7ffa05e26b
|
File details
Details for the file tree_sitter_zeek-0.2.13-cp310-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: tree_sitter_zeek-0.2.13-cp310-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 89.5 kB
- Tags: CPython 3.10+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7e7cb815307753e9d693df83dea10c0a6453551a8d5442a4c9759411df0aed7
|
|
| MD5 |
384b25e0adc830e69a0153508f7215bc
|
|
| BLAKE2b-256 |
faba844a4f168ff15e28462115756acf991f49138be9061dcbdab7e821ba7a66
|
File details
Details for the file tree_sitter_zeek-0.2.13-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: tree_sitter_zeek-0.2.13-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 120.5 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cbc2625500f3ed3c12f10176eb9e7a4bc48c11ce5d498062455ee91b9c0bf02
|
|
| MD5 |
b497ff06b070ac5f2dc0e1446ef0a4fa
|
|
| BLAKE2b-256 |
656d4a6bc8fb793189ae3408333d5292e41c861379f071dd18137b36f64d51d0
|
File details
Details for the file tree_sitter_zeek-0.2.13-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: tree_sitter_zeek-0.2.13-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 95.5 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c529ce235b96a39ffb1800e7aec263d3bcb3bdf979c318c50688384f1d7d1176
|
|
| MD5 |
2b9453e1402af76b5ee189c4ea227bb8
|
|
| BLAKE2b-256 |
c14b278feadf1d76cf136d7cae9ec58a15f1fbb529dc48ea7954b7473c13f0a3
|
File details
Details for the file tree_sitter_zeek-0.2.13-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: tree_sitter_zeek-0.2.13-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 85.8 kB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08d83dfd79f31feb88a2630011ec22ef2f9570793e92d22f26af0699086a275b
|
|
| MD5 |
8127ecb27ddbbca629cdf2d9abdecb08
|
|
| BLAKE2b-256 |
f104ac54408bb055a75f346ba9ecb69ee485504a206d62da53e9162ec5109111
|
File details
Details for the file tree_sitter_zeek-0.2.13-cp310-abi3-macosx_10_9_x86_64.whl.
File metadata
- Download URL: tree_sitter_zeek-0.2.13-cp310-abi3-macosx_10_9_x86_64.whl
- Upload date:
- Size: 79.1 kB
- Tags: CPython 3.10+, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fca0b088b14218adce599a8bd7900a56d6fdc080095dd1590919b30849730b4
|
|
| MD5 |
5dcfe9da33f0a668be4db03baea6ca28
|
|
| BLAKE2b-256 |
5f40d1291affd2b8b0917d0af5b5c4cb2010f98e5dace968ca790c162ddfc6c8
|