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

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.2.tar.gz (208.6 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.2-cp39-abi3-win_arm64.whl (82.1 kB view details)

Uploaded CPython 3.9+Windows ARM64

tree_sitter_zeek-0.2.2-cp39-abi3-win_amd64.whl (84.9 kB view details)

Uploaded CPython 3.9+Windows x86-64

tree_sitter_zeek-0.2.2-cp39-abi3-musllinux_1_2_x86_64.whl (90.5 kB view details)

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

tree_sitter_zeek-0.2.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (122.7 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

tree_sitter_zeek-0.2.2-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (97.4 kB view details)

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

tree_sitter_zeek-0.2.2-cp39-abi3-macosx_11_0_arm64.whl (86.4 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

tree_sitter_zeek-0.2.2-cp39-abi3-macosx_10_9_x86_64.whl (79.6 kB view details)

Uploaded CPython 3.9+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: tree_sitter_zeek-0.2.2.tar.gz
  • Upload date:
  • Size: 208.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for tree_sitter_zeek-0.2.2.tar.gz
Algorithm Hash digest
SHA256 32c19909fc77c72ce11dc3b39d94d768dafdf2d8176d4f9e6fe495ae9489e640
MD5 7126a29ac8cd81f9b0b0d9d5eafe78ae
BLAKE2b-256 3952da99cb05d7633f8b43638ebe043f6478e0a81c6b1df2d79d7551c28b4049

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.2-cp39-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.2-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 3df6ac9cd515e558af51806644006d9596af16533f79d50c98abed03856d8d4e
MD5 e26c84241356fad4aa42a57c7e9cbd9e
BLAKE2b-256 449893097bf2f906b3790977b2bb457c0ae30a972c0314d6246c1f66133a4114

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.2-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 700c0e7a665f0c4a9568088740b4e61e9e89d3189b2232618e64143f47d5db94
MD5 56d3cb3d7ecf6bb9463535feb0fcc6f1
BLAKE2b-256 c514e8f2522d7cf5c6aaf9c6541ac1dd0f2c19052fea00069941b980545ec6ae

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.2-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.2-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8e60120a1b1d30f02b33fb5661957eeeffb24e8ae1d3ced1de5c70ed84a0a040
MD5 11d382e589ca53d84808b95ace346f6b
BLAKE2b-256 abc3476024ad44f51e0bdd81b7c62e2c3f1729007d2586b2f84ee7ef99578659

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 619da269150feb2a531b6772aaed98a7898e1858bb97cf27d7da77423fb49580
MD5 d2eb78abae899ef842198784689e3443
BLAKE2b-256 4d6877da48b67f2870fe60e064e3bedf348704578db9ec57adc5f767b6089def

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.2-cp39-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.2-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bfb3c6b0250126938834ea942e4f4ba0211ed998a4e509bb1f4e09c245f8304f
MD5 9e691c4f7c769e44dc69bcd2e6585448
BLAKE2b-256 c3d2b097cc99dbca5b6d8fdddf9e9c8bcf1efc5d16569d566b007ff092e2422f

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5112f88b829e1b4dce69ddb7a38d7c668d8378a10035aae983528b6cad2eee11
MD5 b56836481164cff2a59320061a4292fd
BLAKE2b-256 9ed228938184020d95ad8c14c29f4ab9519942d7ee5a1b3eab3c1fddf32d0664

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.2-cp39-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.2-cp39-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 82e07b1ea9f3f345e66380a83dc0bee9138b5226cc1a27b3394bf56ee8737400
MD5 f0d0bbca3cd9129468540fa64306fab1
BLAKE2b-256 98fa5518649ac882de928abbd7427e5cc168b9c5dcc2d0f677e22047bbd6b237

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