Skip to main content

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. 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

You can find the tests in test. This contains a separater corpus directory for tests with tree-sitter test. You can update the baselines with tree-sitter test -u.

There is also a script called parse-zeek-tree.sh which runs the parser on every Zeek script in the Zeek distribution, reporting any errors.

Releasing a new version

To release a new version manually update the version number in the following ecosystem-specific files:

  • package.json: key version
    • package-lock.json: update package.json and run npm install to update the lock file.
  • pyproject.toml: key project.version
  • Cargo.toml: key package.version
  • tree-sitter.json: key metadata.version
  • CMakeLists.txt: VERSION in project call

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree_sitter_zeek-0.2.16.tar.gz (245.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tree_sitter_zeek-0.2.16-cp310-abi3-win_arm64.whl (92.4 kB view details)

Uploaded CPython 3.10+Windows ARM64

tree_sitter_zeek-0.2.16-cp310-abi3-win_amd64.whl (95.6 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_zeek-0.2.16-cp310-abi3-musllinux_1_2_x86_64.whl (102.9 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

tree_sitter_zeek-0.2.16-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (146.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tree_sitter_zeek-0.2.16-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (111.9 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

tree_sitter_zeek-0.2.16-cp310-abi3-macosx_11_0_arm64.whl (98.1 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_zeek-0.2.16-cp310-abi3-macosx_10_9_x86_64.whl (90.1 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

Details for the file tree_sitter_zeek-0.2.16.tar.gz.

File metadata

  • Download URL: tree_sitter_zeek-0.2.16.tar.gz
  • Upload date:
  • Size: 245.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tree_sitter_zeek-0.2.16.tar.gz
Algorithm Hash digest
SHA256 e57fcc7b19c3b156cdcdb69e05cb73e7923c182b556265e102441dc83023d806
MD5 854f74ea9b2fb05eccbce38e47abb441
BLAKE2b-256 d0b82f91209a958710772dc6a1c1e060f56193e73196b06d15d146f60727ed33

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.16-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.16-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 7228d9df6c0eae00f671770fa7e9e41200f09ccecbe0b1720374f7709330d9a1
MD5 260ae26f49a43820892376ff9f27061f
BLAKE2b-256 acc11ee28bf3954da14895a89cac9e062f1cd22f0ab1ea65bd80a405ffdb13b9

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.16-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.16-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b7f1b1342ec1e2be65dba5d08396a883583bf26f8850a50eb35a19d963c6ade3
MD5 114a7db7353b59610ec5ce17058c3e9a
BLAKE2b-256 75809fdf5a13569e2856e848f7d7d70846c2c0fbefb6d107cfb74a074dd01f8f

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.16-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.16-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f389ba7148bf8eac5f37afb184c8c6a1c79f8a10fb4cb81cbab4fe9356b5217c
MD5 7c885d47084ad27d46f3cb1362948dd4
BLAKE2b-256 4c8a42bca1df671f75f021a1f7920ee0b7b8b23084d7e2d7020b4ebc8f456a02

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.16-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.16-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 74571fd5e533a53f83847003bb6b1aa4afcb92bc0781b303ec3240d3e7e6489c
MD5 cd3f1930b615773dd0bfa298f6ee3a51
BLAKE2b-256 00c2fb37f997a74d5ef743bc559af6d3b5ffec2e39b2c99bd635baf536f24d72

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.16-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.16-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 85163b2869fe7fe002e23c63b2a2aabbddadc7c3abe0de3005a10cb54ff1ef86
MD5 575c92641ba4cf0ab3c93c1f9ca70ce2
BLAKE2b-256 f0f7d29b9e57c7ce73c738e07423ed747591077e733e9fec8c232aa91d9e208d

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.16-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.16-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d48ed5383a1b5accd2a13143d11c76fc7e41292146cb2b32ff05eecf3c9687c7
MD5 e042e55c85ae93bede4b806cacd0d4b0
BLAKE2b-256 ba756d3633f61733fe4e7407b466ec8df3afa66180aacb01dcc76adcfac0299c

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.16-cp310-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.16-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1baa7a8ab5713a9b8b1a442e13f4c6e9961bfa04d39ff133f11e0d045f3872dd
MD5 c7736f46eb5e6d69a0887c395452c103
BLAKE2b-256 f900e07bd1bcc8e68f7c299d544e0f3d9b6f9261c2a1e2bba4fd39a6790ca3cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page