Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A tree-sitter grammar for the Zeek scripting language

License

NotificationsYou must be signed in to change notification settings

zeek/tree-sitter-zeek

Repository files navigation

AZeek grammar fortree-sitter.

Background

This grammar parses scripts written in theZeek scriptinglanguage.

The goal of this grammar is to facilitate tooling around Zeekscripts. For that reason, its structure resembles Zeek's grammar but differs ina number of ways. For example, it tracks newlines explicitly and relies morestrongly on precedence and associativity to resolve ambiguities. Like Zeek'sparser, this one currently doesn't name symbols deeply: for example, the grammarfeatures anexpr rule that covers any kind of expression, but the choicesaren't currently broken down into, say,addition_expr,or_expr, andsimilars.

Usage

To use the generated parser directly (e.g. via any of tree-sitter'slanguage bindings),clone this repository recursively. We maintain a separategit repositoryto track generated sources. You do not need the tree-sitter CLIto use those sources in your tooling, but you'll likely want itanyway to explore the parser. For example,tree-sitter parse <script>produces the script's syntax tree, andtree-sitter highlight <script>shows syntax-highlighted sources.

Building the parser

  • Installtree-sitter on your machine.
  • Generate the parser: runtree-sitter generate.

Testing

There's currently notree-sitter test testsuite. Instead, a test driver runsthe parser on every Zeek script in the Zeek distribution, reporting anyerrors. For CI, a Github Action workflow additionally clones the Zeek tree priorto 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 followingecosystem-specific files:

  • package.json: keyversion
    • package-lock.json: updatepackage.json and runnpm install to update the lock file.
  • pyproject.toml: keyproject.version
  • Cargo.toml: keypackage.version
  • tree-sitter.json: keymetadata.version
  • CMakeLists.txt:VERSION inproject call

Once all versions are consistently updated create a version tagvX.Y.Z andpush it. We trigger automatic publishing of releases for all tags.

About

A tree-sitter grammar for the Zeek scripting language

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp