Skip to main content

Zeek grammar for tree-sitter

Project description

tree-sitter-zeek

Tests

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.1.1.tar.gz (199.7 kB view details)

Uploaded Source

Built Distributions

tree_sitter_zeek-0.1.1-cp38-abi3-win_amd64.whl (86.0 kB view details)

Uploaded CPython 3.8+ Windows x86-64

tree_sitter_zeek-0.1.1-cp38-abi3-musllinux_1_2_x86_64.whl (91.6 kB view details)

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

tree_sitter_zeek-0.1.1-cp38-abi3-musllinux_1_2_aarch64.whl (91.3 kB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARM64

tree_sitter_zeek-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (132.4 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

tree_sitter_zeek-0.1.1-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (97.6 kB view details)

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

tree_sitter_zeek-0.1.1-cp38-abi3-macosx_11_0_arm64.whl (89.1 kB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

tree_sitter_zeek-0.1.1-cp38-abi3-macosx_10_9_x86_64.whl (82.1 kB view details)

Uploaded CPython 3.8+ macOS 10.9+ x86-64

File details

Details for the file tree-sitter-zeek-0.1.1.tar.gz.

File metadata

  • Download URL: tree-sitter-zeek-0.1.1.tar.gz
  • Upload date:
  • Size: 199.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for tree-sitter-zeek-0.1.1.tar.gz
Algorithm Hash digest
SHA256 946710d3f9116e2a23d1618ac3a2ec72167d76612a37d02e3c0dc515a8bd79d1
MD5 e267b9c7c0a4b8ff2bff28cb2927ba1b
BLAKE2b-256 7a88d61cc009884d67b5046cf7462ddc39f673f86f085632a65b031f456be56d

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.1.1-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.1.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2e194d44172543a7f28cbd2293839a6d9072d831c23ece7c034b86badebee65a
MD5 b6d9b1276a7685246a1fc6360bd8d837
BLAKE2b-256 2d69228fe2e2c7478f088dd5b7b56380684012fd82223b95e3c4b01d16e64c5e

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.1.1-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.1.1-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 110ce0c59a4ee0694771b3cc5e1070d7f4efc9ef60de02e6203f6077992c1cdf
MD5 ad8f916a6f2c2a1fa4f2e7864dad6989
BLAKE2b-256 ccf94009d6207b5967983c6ae75c0e79b6f072b83a8e34d6eac3d7782b749895

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.1.1-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.1.1-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8c854c95580412d0bf04614be5bdc5f73449040bada9865ef3864326b9b64029
MD5 449508e55f392d9e80310017279b12c6
BLAKE2b-256 6c5fe7a31df1cf2c9b3a6b5ce73457b67109440cdf7962e52239d62c19944215

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 75d5490a5424af8f6e165fd045b3b590fb379c9624be57ce43ec2c446833ee91
MD5 4389ee993c719db14f81e5adecd5be5c
BLAKE2b-256 1dc734fed2ffa1bfb014e7447706eefd33b1f7f34ecd54237afd476ef4f9679e

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.1.1-cp38-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.1.1-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b2ac5d8b679cdaf9ed753a1520ab99e3988e1b7a1c0aa30a586377859eadca66
MD5 0147ea68316568e856542b7e4c21c5cd
BLAKE2b-256 d42f12ffc707af4ec8cb5b7d6a21bc02f4f974cfc37af3e5bf9a15f51666dccc

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.1.1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.1.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 54e3de7d06b4d5c6fb3384b75010c813455f4f83f4e2a4323f5c8ede98dc5bed
MD5 5639dcfe0179307dbca8f5391265db59
BLAKE2b-256 528cafa17e2ef4f580fa0d6cf6e934547429c82a04d49c5f66c8c02916538298

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.1.1-cp38-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_zeek-0.1.1-cp38-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 881c6a50746368e8b5ccc742155c563c1561b7d02939bbfe60867878a1026a5b
MD5 2de0221c857fbb35fe7675c7bb721e18
BLAKE2b-256 26af242ce10aa3bd681b7ad9a7dd9a5e9a31b4d750dc892f03acf49844981be8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page