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
  • 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.4.tar.gz (211.0 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.4-cp310-abi3-win_arm64.whl (77.8 kB view details)

Uploaded CPython 3.10+Windows ARM64

tree_sitter_zeek-0.2.4-cp310-abi3-win_amd64.whl (80.7 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_zeek-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl (85.6 kB view details)

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

tree_sitter_zeek-0.2.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (112.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tree_sitter_zeek-0.2.4-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (90.8 kB view details)

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

tree_sitter_zeek-0.2.4-cp310-abi3-macosx_11_0_arm64.whl (82.2 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_zeek-0.2.4-cp310-abi3-macosx_10_9_x86_64.whl (75.2 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: tree_sitter_zeek-0.2.4.tar.gz
  • Upload date:
  • Size: 211.0 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.4.tar.gz
Algorithm Hash digest
SHA256 9420a17460e37ab6997289dc87caeddaef88f5839fce344391cf675e5f10a5bc
MD5 638945ce563f3409dda78ab7820e2c3c
BLAKE2b-256 0d0923e92f3135aa45b49cc06931d8c6ecde9f4c74ddf0176cf5c2d913432c73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.4-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 95ee91038b3a58545f948e9d3aeab5b103b97e21b0a48825b14782352612afdb
MD5 2ed1fc4de56487169a033823dcac930d
BLAKE2b-256 f53c10f32bbe521ce6a83feed21a88001ac3ebfcf7b129bea5ab48a3e4e8e02c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4269d89cdc794325f2fb61ec139da0aa4a9ee38c23dbf2d2d11156f6b048f787
MD5 b70de57afe699cee69854af89ef30c1b
BLAKE2b-256 c0bf11579eca31f3c482ea6a4c4f53e2f06dbfbf4d93575e24bf50605c8906b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 91efc6397b1e5404e1c30ac956ee79e12b9592e4491a1ce73c48653615061e5b
MD5 e09f8bc895cb58665a69bd5ad0902e0a
BLAKE2b-256 cf504db5051f6e49e18a509e122e84ea167022cc811bcfc196f243fbe41ace64

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0430576ea1db17e0222daeec2247e86c579e833e465679c63620167b41ef7d29
MD5 a9f122153c392308e6b8b240a5f4bcbd
BLAKE2b-256 5ffb409f5803bdc9e1ccb3d1afd3d0632c8c2111257078139365a6ed37520a38

See more details on using hashes here.

File details

Details for the file tree_sitter_zeek-0.2.4-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.4-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e0910aef71946f9fcec439167acf05c3ffa8402b41aad7a86e329f48ebcf5ab1
MD5 49390f1b53fa8be8107659e90431f255
BLAKE2b-256 820703c2eb27aaef2f23c8993672afdf19b5418eda84ee7f0379077845a6dc93

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed21e14bf0c7595492e26faadc3b8ddb0fdd051777e597abf895017d608e8baf
MD5 2c715b1638cf8aea261bd3a3165e8607
BLAKE2b-256 3d43d6f12dddca7e1cd899559f2421f8deeae5a0e7c2c92f7f7c1aaca924084b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_zeek-0.2.4-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 65d3fb55f726d2e0b3f92857a31d4c8b782cbff7bc1ff5aa1535678cf3b0d34e
MD5 d0aad3983be8ff9d5d338091c7229e77
BLAKE2b-256 92cce817f0d2bec308efc4f36fbd2974a43b82edba5e2b300d73369fb14e6938

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