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

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

Uploaded CPython 3.10+Windows ARM64

tree_sitter_zeek-0.2.11-cp310-abi3-win_amd64.whl (84.3 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_zeek-0.2.11-cp310-abi3-musllinux_1_2_x86_64.whl (89.3 kB view details)

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

tree_sitter_zeek-0.2.11-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (120.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tree_sitter_zeek-0.2.11-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (95.4 kB view details)

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

tree_sitter_zeek-0.2.11-cp310-abi3-macosx_11_0_arm64.whl (85.8 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_zeek-0.2.11-cp310-abi3-macosx_10_9_x86_64.whl (78.9 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for tree_sitter_zeek-0.2.11.tar.gz
Algorithm Hash digest
SHA256 4686ae9c93b0c538e9644ac0d41f57e495485369cb5c56ffb448b163b142a06d
MD5 4102d96f550bc78b1d60a763a2b33fe4
BLAKE2b-256 9f3b0ed9ac151b68a936ff3e32e18dba777a77d58cb029fa4fbfedb3d97192b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.11-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 dbc48df40fed16db6f692712bac5c5a38f2bb644d91c7206cf85fcfdae70872b
MD5 50a2ec85e3af418981c2d3120c16bbf7
BLAKE2b-256 763d571000fe0c7b2ce3bc9a06bf3e930d2ccc4ffda26c0c87b3e37e0b029520

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.11-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a436bb7acd934bafa1df25148e5fecbdc058998f9e694d7d13634a4f21ca2d6c
MD5 12f9e60750dfdc760e5e5c34b4ff42d5
BLAKE2b-256 317137789707f9c0635f6fcc56ea06b3001dc91df043e5251c0d86cf8bc3c3ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.11-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 fe62aec16e967e2a978176aac979a35c9217270a85e0bab6caf02f5ead8e2822
MD5 fd86b0a90ec1e55c936b229933dd6c23
BLAKE2b-256 31f2961498d9f4aa6381fb63c6645855d51d8b0fb379776019982096730a3a6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.11-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7a489ceda66cdce86b04c8a52bd64d5740007c67fe69dc181c4ec3e03266b2e2
MD5 70fa7c86f20afd01ae42f17041dde168
BLAKE2b-256 01d4719fc47686f53b993419f9091eae7e13c71083a1fd6b01a1792a729eccca

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.11-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.11-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 70ac9eafbf6fba86d7dae7975083082934352ea116aa68981a547a75bcbb5f42
MD5 8dc13c41c07ce4debe6557a605ab60c6
BLAKE2b-256 e7c4f3f81a00d4a70dff1ce01f555988de60496d84304c5e6548a4ac9560eecb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.11-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 13ba579dc13f464ee13395633b510bf40e2a0640697881f5b55005aaa3683b2d
MD5 9479b885b54ba0e7b763c3bc8db28305
BLAKE2b-256 87e72b308822f38e3b0647cf106db57cadc3ec0c0bfa1ca709ce6e37adb8ee24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.11-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 25009fd82ee3faf84af053b59443a1e97ab43639f86bfb8a685873b1cc4471d1
MD5 c2a7030cc2d5f6b989d052e645cec6b7
BLAKE2b-256 860fda1697b71c2d8cb1526f9e2caf9cb4ec13e0c52eed564931b78f202372f0

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