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

Uploaded CPython 3.10+Windows ARM64

tree_sitter_zeek-0.2.7-cp310-abi3-win_amd64.whl (83.8 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_zeek-0.2.7-cp310-abi3-musllinux_1_2_x86_64.whl (88.8 kB view details)

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

tree_sitter_zeek-0.2.7-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (119.9 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tree_sitter_zeek-0.2.7-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (94.9 kB view details)

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

tree_sitter_zeek-0.2.7-cp310-abi3-macosx_11_0_arm64.whl (85.4 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_zeek-0.2.7-cp310-abi3-macosx_10_9_x86_64.whl (78.6 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: tree_sitter_zeek-0.2.7.tar.gz
  • Upload date:
  • Size: 240.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.7.tar.gz
Algorithm Hash digest
SHA256 e455e3a42dff0642bc485038b4839e743e731c7173af228da9d1a94f333668c3
MD5 1c1f0e38c273d7ef0aa22d3755cb7b76
BLAKE2b-256 537f93e90a400ae0c014468ef09e402d7e79bac8c1873cde4625579a19cf93ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.7-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 c34c16989273d08357fe6f4e34b4139fe89f254a765a672eec3c703d57fdf1bd
MD5 d2ce55b9ef944dc125349975639a1ca5
BLAKE2b-256 f6b94602396b9b1ad20886da9839f752f4f08df841348a260242d24349c4e515

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.7-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d8d087013090f5d8bfd98bb54334934f7e4e6b9a5333c3a2ffd2f7737733b84a
MD5 eb3a14107469cfdd8df784b20b47f7c5
BLAKE2b-256 3a9320ea5e1a130da0dd3f0c92c634ac0fb035ae8b1b37743ed5c475d078dfcd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.7-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c353d7f10670b9be2a7c188fd28f8d7d4d2f7d7b56fcb43eed9d050e5250a670
MD5 0f714307d04b9c11c85a86f2200b336e
BLAKE2b-256 d8024a05f628cb664f9500c6205015d5b1ff1128ec9f8b012151806111f72f73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.7-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 194f19e2619a0c2b2cf93c0e1d88f458d68d4512a0f695bd0717adf8264a15f3
MD5 0784929e81d7e7f9f3604e4b168df928
BLAKE2b-256 87bfec9485828f11a78cc58b3a675db03838d100306699d07792a4a84902461f

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.7-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.7-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c4f694a336f320e3ccbfaaeee4b7e37a7440613e991b8ea07c15685ce058833d
MD5 22495df51826dd57c517cd009ef690df
BLAKE2b-256 601fce01cbb188e639b584be04577b1030db45aed7d60568bdfacbbf54ca5165

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.7-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e69e2618f790bc074fd073fddae68b434d1b86f9e5c0fafbe6de9dd95bb2d43
MD5 15c44df63808950a7022cb2f97f7fb13
BLAKE2b-256 3db8f1a102d43a67459b85b35e35e26addee9af98ae44e2bede9132a55fd05c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.7-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d1463dcbc3b6cd2840eee40df30e1a177c19517fe85ea307180099e6833f59c0
MD5 6ccd3bb35408a9a99e9ba080c58a62b3
BLAKE2b-256 d4fc71623f2d0933062ee4f31103d8c255855867d2b65224b6429d588d3eafe6

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