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.8.tar.gz (242.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.8-cp310-abi3-win_arm64.whl (80.8 kB view details)

Uploaded CPython 3.10+Windows ARM64

tree_sitter_zeek-0.2.8-cp310-abi3-win_amd64.whl (83.7 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_zeek-0.2.8-cp310-abi3-musllinux_1_2_x86_64.whl (88.8 kB view details)

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

tree_sitter_zeek-0.2.8-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (119.9 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tree_sitter_zeek-0.2.8-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (94.9 kB view details)

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

tree_sitter_zeek-0.2.8-cp310-abi3-macosx_11_0_arm64.whl (85.4 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_zeek-0.2.8-cp310-abi3-macosx_10_9_x86_64.whl (78.6 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: tree_sitter_zeek-0.2.8.tar.gz
  • Upload date:
  • Size: 242.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.8.tar.gz
Algorithm Hash digest
SHA256 a6da260c6e5d6dd6ff40fef5bcf8d0b036ad8b1b48c877e28a74ee08712ae96a
MD5 191f919856d81046ac66d822c01bdbaf
BLAKE2b-256 9e15e8de81a9662fa1254919f53e80729db491c79c053661be70df310176ee6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.8-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 10514ebf065a59c2d78802ba061f70030733d4e909abf1f4e523dae0845c14bc
MD5 10ea264d1d7c4bcc30bd83ee1b06ebb6
BLAKE2b-256 36905a1d7216b3871a322158f8f65fbf555c34133b29c4335fb8f83b3ca3c5d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.8-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a9524d5d51fae418fe23026922ea0c3580a0b163fb65f541770c8b4fe952db28
MD5 f904e2c9cd06aac7ab39123278e8c7d2
BLAKE2b-256 f040827d30771128ea0ee6ed909775c8067a3b722c9793e2702f6d2354ee96d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.8-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9dbf8d11deb607412e66495aa436b5f02c98f60c4d74ca14236c1fd0fc35addf
MD5 646ed323345fd31d91751075e9c1e968
BLAKE2b-256 73a138bbe459e1ab90b292b077ab1ae29e8bbf325668f6e624f808ff76b8144f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.8-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 673303daeb23466b7088f566c00bcfdc36e81fd98a063ac226728c8be7d40dd2
MD5 65e5593c7f1f0fe7426a662f43714bb5
BLAKE2b-256 0b84385525014b147b0aafc535e9af246e0c02ac18a55a7371a1e261b6c2c8b1

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.8-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.8-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 095b30f82692acda6fd31aa97b5b9d489f7ea82d1332d5af5e7c6e9c673410fc
MD5 73b3d6cf6a753688fa0e5795fce38b8d
BLAKE2b-256 3e2008f14aaf235432d5a5f4c23f2e115a5b2a4783d838dc0ea8a743b85a385f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.8-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c6df0c439cdf2dfe0b469f79f321176862dfc8200cf73de88767dce8cfd40913
MD5 d74edaf48776ff8feb356c0d58e5b74b
BLAKE2b-256 e8113f59c08e2240da35b56245be697cfb4d042cce3fbaa163793569e6f06611

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.8-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cc3b0c9b212c14d38007ce7a9ae5a5398f6fc385fd031d4011fddf09513a8563
MD5 29710c9048b5de85130656513a692888
BLAKE2b-256 cb90c998cd10fb9db02b3047425d0fdc850b454b0538964a5fc8cfd3ea9b8b7c

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