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.6.tar.gz (242.8 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.6-cp310-abi3-win_arm64.whl (80.6 kB view details)

Uploaded CPython 3.10+Windows ARM64

tree_sitter_zeek-0.2.6-cp310-abi3-win_amd64.whl (83.6 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_zeek-0.2.6-cp310-abi3-musllinux_1_2_x86_64.whl (88.6 kB view details)

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

tree_sitter_zeek-0.2.6-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (119.8 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tree_sitter_zeek-0.2.6-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (94.8 kB view details)

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

tree_sitter_zeek-0.2.6-cp310-abi3-macosx_11_0_arm64.whl (85.3 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_zeek-0.2.6-cp310-abi3-macosx_10_9_x86_64.whl (78.3 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: tree_sitter_zeek-0.2.6.tar.gz
  • Upload date:
  • Size: 242.8 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.6.tar.gz
Algorithm Hash digest
SHA256 f7170b03e302032e199b2ce2aa70d947035e0e99b69bab112a20b8aa39e5b0b0
MD5 d2433971a16a5d245d816882c18489c4
BLAKE2b-256 6e29bf697fe52bb59daa7084c08f01f0f7cf078ddc927a8ff3a9ad97e6092511

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.6-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 a7c888472bbd4190c9ab7bd9da22f36a8b8ef68de1d530d923ecc12f16ed2310
MD5 683b8b038218ef2c4c86eebf21cac863
BLAKE2b-256 4f948fed35e3930e8f636e5bdce25b905b0d11512986b285da7676fc0bdd2ca1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.6-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d28a84aba1fa2b17ad4b093d233af2b4ee77c6dad32d902a6e2c2a17b62300fb
MD5 6d9bb25df9aef54b54eb8fbf4722072c
BLAKE2b-256 c1b8944f06bed35000668fbc0ca5f6edd76918eda8ad0c37b19dcbef4786318b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.6-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 658ba3f8ea8ecb34ded44b7eb71c728c7b5a46d74eb36845ccd85f657d6d0e3f
MD5 cecdaf8533a8f097407af094398964c0
BLAKE2b-256 b88f7e9bdb5664e7451bf4885d048613480de4d9475793e6ebc6c863e6e6a6e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.6-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 35006536b883c29a309a8a452f37ba8312863bf5308af9310ab6aacecebfae3a
MD5 cd26d84ea775bad2abee3b5267ca8621
BLAKE2b-256 3808979cefd9de477bb86caa85fe5cde5a0f5dd8c199041b0ec2eb86f47df6b0

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.6-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.6-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 87867040f492419cc3e3ef6f5ed6859ef77e5280035825359036e915ac21545d
MD5 45d2334c64c90985741fa95d6771b23f
BLAKE2b-256 5ac954bc51440ef02af63ceeef8c4a8f99454280cba984e60065442ce1830d1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.6-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2c08e2e35a053d1bd286fab65f4579db0667d47cff96614b28919cb8c973b80c
MD5 42d67021c9bcf0c7cca5778d9b1373f9
BLAKE2b-256 67aa36b0694d73f1fd1a7331ddf9abf5c6773c02b1fe0fad071191f844890b20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.6-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a9d1cb5f85ea061eb75ea12425228f56902224e77996cfae9d38bf0f0634e359
MD5 efc66a6dcc5dd6e7979ce9e6fec5f9b8
BLAKE2b-256 008ca01c1f13b6f4d879500e9a5f459e5eafe18ddda9b791ce5b96a2c8dd5dc0

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