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.10.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.10-cp310-abi3-win_arm64.whl (81.7 kB view details)

Uploaded CPython 3.10+Windows ARM64

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

Uploaded CPython 3.10+Windows x86-64

tree_sitter_zeek-0.2.10-cp310-abi3-musllinux_1_2_x86_64.whl (89.4 kB view details)

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

tree_sitter_zeek-0.2.10-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (120.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tree_sitter_zeek-0.2.10-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.10-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.10-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.10.tar.gz.

File metadata

  • Download URL: tree_sitter_zeek-0.2.10.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.10.tar.gz
Algorithm Hash digest
SHA256 5f81ce3045d4266626ed92a04c3fa70059c9762df9381254664076024077989e
MD5 11b9319d07b479c922e4e40ee2fe8af6
BLAKE2b-256 1c9e359cc5dabbdb0516e52dcdd62d01c103e98844293e197282099851903a37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.10-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 d1f9b7904a01f5320f14bcd334516977353ac4674046d001b0281739a8e4388b
MD5 4550f7fe976b203d184d6faae5bfacc9
BLAKE2b-256 e898a2b521570b8b9746b20348cde510070c23580c9b525856cbeba7f2a89bde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.10-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d0d43e01d0b7975c2cc567d0b1bb6da73bb4ad473d74052630d316f32eb30194
MD5 f6d0abb7ed6383c7abfff638e7e4f8e5
BLAKE2b-256 b010a1a2603fe61aa7a9ec6db25c96dc0e1580f78cdbbaeabe1da9f1fb5b80b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.10-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 20ed3c84a09673a09a631894de015978751eb931c6ff2628756eb494ca4b59b4
MD5 bee9bcbb415f6c94ba4b90eced2102f4
BLAKE2b-256 dec7b252761344abd77febc577063c08b002028bf6dde95b357850c8d0813148

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.10-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cd5e5297dd1fcd9fda475225a798154fec3c28e8a29a9de73f82a0cbf1c6ac46
MD5 67f7d45dbea2daee4650b0a24d70204b
BLAKE2b-256 8804385b298d8768b7c264044b1d7002cfddc171bb850d3b392769f0540159d9

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.10-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.10-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 66fa3707efc9b028f4512f18e5a034fb4c708ddaa4772c9db4feb9057076503d
MD5 546d74377ddd8154a25f0ee8455b251d
BLAKE2b-256 a3676a3d0a2f52d1e4daaf701962757daf15d6e671c562ed29c980667450fb58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.10-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 95f9b03b851afe03f6bb2b6580f6d778926773357ca12b46b5938558987ca01a
MD5 ad441650d4c175aff7d7db5c0d391191
BLAKE2b-256 01b7ed1da61184326041e29ec788a1b26d6097dad77ee546297e4bf6f74af6c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.10-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c015b8448ca80efc41550a8df9801230686535095b6212a93b40ad132b7a033d
MD5 69e6517eef5f632f8c8f1a7ef15aa6cd
BLAKE2b-256 2efa95be3dd27db16e67da256cc6068cf825fad284de564f7db46d389d384bf7

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