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.3.tar.gz (204.9 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.3-cp39-abi3-win_arm64.whl (77.5 kB view details)

Uploaded CPython 3.9+Windows ARM64

tree_sitter_zeek-0.2.3-cp39-abi3-win_amd64.whl (80.4 kB view details)

Uploaded CPython 3.9+Windows x86-64

tree_sitter_zeek-0.2.3-cp39-abi3-musllinux_1_2_x86_64.whl (85.2 kB view details)

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

tree_sitter_zeek-0.2.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (112.0 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

tree_sitter_zeek-0.2.3-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (90.4 kB view details)

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

tree_sitter_zeek-0.2.3-cp39-abi3-macosx_11_0_arm64.whl (81.7 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

tree_sitter_zeek-0.2.3-cp39-abi3-macosx_10_9_x86_64.whl (74.8 kB view details)

Uploaded CPython 3.9+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: tree_sitter_zeek-0.2.3.tar.gz
  • Upload date:
  • Size: 204.9 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.3.tar.gz
Algorithm Hash digest
SHA256 1737107645c4df5b71dff2c768e7b4310c950226157a791acbe714bcdb6e4417
MD5 6c270164ad6f944db66e4723dc0a265a
BLAKE2b-256 cd510769bd3671fa8e541e7ab4397df3642b161bdfdffd35a9d5385a4cd3766d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.3-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 aaa088add177951f637e05756b4864edba54c11d3e0856a5706091e7f64c5c45
MD5 ab29a38e45c91f008a92038c33b8631f
BLAKE2b-256 a24013e77f0ee2389c66366fb478344ca8bc7b0d8050e2ef1d32648d449e96b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3843ee5e5cf36cf0f1f80e3d82f582c5d6004a635270a2dbe8c4d52e7734d7d1
MD5 eb9b4b23c9ebfd29a70f0dd7ba8b6d12
BLAKE2b-256 9242f6eceeeb8d7df8c32c7a89f03639af2804429dcdfe61edd0b7da656aa6fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.3-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ee45e420149e218d1d1247013db36169cffbb45f4c0ebe3e034e51862dc492c2
MD5 15f74122e517bf53feb8ea35d86d3dab
BLAKE2b-256 3942fb4c971300a2f7813988370092187fff61af5bb88430c83d6221f4ba1409

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 71a89b9911d402e69b5b9bc9ef2988b9ce8d1ac0fd0928283811dcab73142aa3
MD5 9c6a08c089ca887f3faee0b51c292ee7
BLAKE2b-256 6b0682791e50e96b36606d08f8e03df62239d6d568fe20e06ed0eb54cb0e0a47

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.3-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.3-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fe3628266be04d0d1b50f24b1f7f490aca04ce4783f1c838ad6c7c827ce6643b
MD5 4323aed6e1b8047e1bed5be147240aea
BLAKE2b-256 0232698619b126e131d187bab5ba3d0472fd157a63fd92165e153832301ca657

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fd11ea68a47013fcd68f79d6de339b451a0bf894762cec52a9ce6c3a226ff579
MD5 e3de383d3fa97381427b1b893a2f68dd
BLAKE2b-256 cba4d3351562992a826ea4fede65876fc635089d8dbc48242a2e791900c239c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.3-cp39-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d152434761ffdf720b2520e98e3f8eded43a6e1eb70721e647ef8d501f62e35f
MD5 25bb4fed51de6a89480cb95d9d9cc525
BLAKE2b-256 50de22093c73fff068475a4e9f760d1b9d457ac80793a512e846509dee357dec

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