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

Uploaded CPython 3.10+Windows ARM64

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

Uploaded CPython 3.10+Windows x86-64

tree_sitter_zeek-0.2.9-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.9-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.9-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (94.7 kB view details)

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

tree_sitter_zeek-0.2.9-cp310-abi3-macosx_11_0_arm64.whl (85.2 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_zeek-0.2.9-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.9.tar.gz.

File metadata

  • Download URL: tree_sitter_zeek-0.2.9.tar.gz
  • Upload date:
  • Size: 238.5 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.9.tar.gz
Algorithm Hash digest
SHA256 83d8a74e2bf943f1228a704842acac8b81eeec08b889f2a93975e447f4fd39b7
MD5 144d48624d546216500e878a3d749d06
BLAKE2b-256 aff6b037788770b5ec496d0fe561b732ffad53ceab7469450d05beae182c0f68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.9-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 074322bdb31e6fe32fdb0050605f14c883f55b2e7716f8888719b9e81ebd277f
MD5 f61323d2fdcce7f084acd2b498e8ba04
BLAKE2b-256 a3c824a27d3d037cfa79b343f7aa4fc943a38c2ff4e461725d3b5353826b0940

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.9-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2589465af89cb8f748560035c0cdc28cda1f458a6ceb7ec9fcee2bb5bdffa5d4
MD5 b819d7c0e708213ab8ce4b0b69a8c699
BLAKE2b-256 652a92d242f7becd4b80551ede072333eb78de42d67e430dd9056a85070faecc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.9-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 45f38cc5ffdf459aafd88755bf9cc388ee01e9afd8220c403fe38769aa7671c3
MD5 524eaee52307ce15aa18cdeb0d0103b7
BLAKE2b-256 3e16fe54a0904d666db079bb29a4fadbcffbd27132717cd3aa1e5a7736590469

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.9-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b723e67a0903fd38e69470302110e2ad0a889884004b2982bd8c0409d091d701
MD5 2855b44eef0ada3d2e6dd01feab5281b
BLAKE2b-256 c4c36584640dfdee1ca355424c3422c685c314da82442b588faa32fcd894bd98

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.9-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.9-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bf74b7e9ae6cadb541e252b5cdf83c54d425ab029ca3986b700b5e8ad92dea27
MD5 52456a8532ae309f1c06d0784b63552b
BLAKE2b-256 214bfd830c7442416507beaaab0f55c391a0d3199cb8b047698ea5f9d89a36b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.9-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8be9dc9e6196451150e3609af0cc3c24b9232fafcfa0eac840650e1ffa12b135
MD5 565fba10291d458ce2a46965064b3d63
BLAKE2b-256 593f51056458848d2430ddc9920646000cd2a54002cf7ef606b429c7bb29ee67

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.9-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d10b316eb4dd03eed661657bca0478064f349bc08141e8a1fdb72e8d6748b1b2
MD5 b86e7d61bb30b1388c57e8714d6b2bf5
BLAKE2b-256 978cfc41e477dae9708b534686b6ba7590150c7e12588e1ca54c47c63156b3f8

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