Skip to main content

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. We maintain a separate git repository to track generated sources. 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: 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.

Project details


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.5.tar.gz (211.0 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.5-cp310-abi3-win_arm64.whl (77.6 kB view details)

Uploaded CPython 3.10+Windows ARM64

tree_sitter_zeek-0.2.5-cp310-abi3-win_amd64.whl (80.5 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_zeek-0.2.5-cp310-abi3-musllinux_1_2_x86_64.whl (85.5 kB view details)

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

tree_sitter_zeek-0.2.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (112.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tree_sitter_zeek-0.2.5-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (90.7 kB view details)

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

tree_sitter_zeek-0.2.5-cp310-abi3-macosx_11_0_arm64.whl (82.0 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_zeek-0.2.5-cp310-abi3-macosx_10_9_x86_64.whl (75.1 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: tree_sitter_zeek-0.2.5.tar.gz
  • Upload date:
  • Size: 211.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tree_sitter_zeek-0.2.5.tar.gz
Algorithm Hash digest
SHA256 51ace30f8d430143cffbc4cc47942cb69c21e93f59c01e13972ef34bb163a1c9
MD5 7301512db2219b5986c8eca888543bdf
BLAKE2b-256 1a4698797c8743c524eacb271206fce3ab5c1d83cd26f88fe4c540026923a06c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.5-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 3dca304efcb8d2d369ed43cb4b762f9d8d43ef4725e67d6663b45c3c6688ace7
MD5 443041ae7c10ff246cf66f37c7847726
BLAKE2b-256 173384bd6a3bdc74ed66c041f8d49624e02471e6ae85a3626358589dac9b4cc9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c96b2c1f3ff5c991c5dcd8ea38929463fdc39183dabbcbab70d76611885412c0
MD5 91dd212ab5ea2336f2e44181bfbf0697
BLAKE2b-256 e45459a8e4c29f53fb789c949cb92b7486d9bb2cfbd3ff96bc0ac42838a3bc97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.5-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7dbe749da6b932e4bd628d587b4bf151da972a6c207fd436bafc64ee903ca7f3
MD5 6bb40e78e3a43648df698ef444b878c8
BLAKE2b-256 e2bfddb31827749e0a66ff2f243970c10ad776bd0c0d4a24f2488a14dcdc9913

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0195ed7223410a379195298305d842f46fb74a81fe0d86f9c9c9d85bd22e0aa4
MD5 2fe5d482388e0e65693b44b575a1019e
BLAKE2b-256 d21bf72c0ddfe8180f712ec5283fe88c74759b2d919a661fba83b84f23feabfd

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.5-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.5-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7b476a7adf4e4e06b6157807f090082e7fbe686bf7f82b53c3a0155b8fcd7b6b
MD5 a038ff550b6cbc8417355f4f139ddc04
BLAKE2b-256 774390477718f2c5c5fa69b6919e768a4c08839e44ce5e685bf5c4a4ceea8474

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3f48b1245b0d19663273465d6fa6320496c998ad17723a8fc0eb607d5c1b95f1
MD5 64fa704d2ca7f38bb19428c82cb9ac35
BLAKE2b-256 51c3769b5f39523f557487c8a16c24a00a315d61bf895cabbef33a125f7f99ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.5-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 89bbeec6130f14ed8b86d0c2b55fd547cc9ed94990e1a3604b715ac446af92d3
MD5 a22c123ec9c47a731bdeea3a9c2eb160
BLAKE2b-256 a94ba910d6a85e62a6f6e95c275367bc090edade243c2d4d9a36130bed57e91e

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