Skip to main content

IT systems are growing in complexity and the threat from cyberattacks is increasing. Threat modeling is a process that can be used to analyze potential attacks to IT systems in order to facilitate secure design. Meta Attack Language (MAL) is a threat modeling language framework for the creation of domain specific languages (DSL). MAL is developed at KTH Royal Institute of Technology.

Project description

tree-sitter-mal

MAL grammar for tree-sitter.

References

Usage

Install tree sitter CLI to be able to use this grammar. Then, run tree-sitter generate to generate the parser from the grammar and tree-sitter test to test the parser, as well as the syntax highlighting and code navigation queries.

To see the parse tree the parser generates, use the command tree-sitter parse.

To use the highlight through the command line, make sure you have a config file initialized. Then, you can use your own highlighting colors or copy the ones in the repository, specialized for MAL. Lastly, use tree-sitter highlight to generate an output, see the docs for more information.

For more commands see tree sitter CLI docs.

NeoVim Manual Installation

[!NOTE] Tested for NeoVim v0.11.1.

Using nvim-treesitter

  1. Install the grammar. Simply add the following Lua snippet to your configuration (init.lua or respective package config)
    local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
    parser_config.mal = {
      install_info = {
        url = "https://github.com/Tobiky/tree-sitter-mal", -- local path or git repo
        files = {"src/parser.c"},
        branch = "main",
        generate_requires_npm = false,
        requires_generate_from_grammar = false,
      },
      filetype = "mal",
    }
    vim.filetype.add({
        extension = {
            mal = "mal",
        },
    })
    
  2. Install the queries. Find the query installation folder (it will be in your runtime path, :h rtp). You can find various locations by using e.g. find ~ -type d -and -iname "queries" (NOTE: This example only looks at files installed in your home directory). An example of the path can be $HOME/.local/share/nvim/lazy/nvim-treesitter/ if you are using the Lazy PM. Install the files from queries into a directory named after the language (cp -r queries $NVIM_TREESITTER_QUERIES/mal/).
  3. Verify that everything is installed by running a healthcheck :checkhealth nvim-treesitter, the table will list if the grammar and highlighting has been found.
  4. Configure Nvim to start tree-sitter. Here is an example using auto-commands:
    vim.api.nvim_create_autocmd( 'FileType', { pattern = 'mal',
        callback = function(args)
            vim.treesitter.start(args.buf, 'mal')
        end
    })
    

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_mal-1.0.3.tar.gz (33.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_mal-1.0.3-cp39-abi3-win_arm64.whl (23.2 kB view details)

Uploaded CPython 3.9+Windows ARM64

tree_sitter_mal-1.0.3-cp39-abi3-win_amd64.whl (24.5 kB view details)

Uploaded CPython 3.9+Windows x86-64

tree_sitter_mal-1.0.3-cp39-abi3-musllinux_1_2_x86_64.whl (33.4 kB view details)

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

tree_sitter_mal-1.0.3-cp39-abi3-musllinux_1_2_aarch64.whl (33.4 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

tree_sitter_mal-1.0.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (34.3 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

tree_sitter_mal-1.0.3-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (33.5 kB view details)

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

tree_sitter_mal-1.0.3-cp39-abi3-macosx_11_0_arm64.whl (21.6 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

tree_sitter_mal-1.0.3-cp39-abi3-macosx_10_9_x86_64.whl (21.0 kB view details)

Uploaded CPython 3.9+macOS 10.9+ x86-64

File details

Details for the file tree_sitter_mal-1.0.3.tar.gz.

File metadata

  • Download URL: tree_sitter_mal-1.0.3.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tree_sitter_mal-1.0.3.tar.gz
Algorithm Hash digest
SHA256 7cf308c9442fd48bacef027c796bbab1160dfe25223c5cdc57ebe1a2c1a9ce17
MD5 31076a8934c5b95ac801e5acd2f0cda4
BLAKE2b-256 f5ceb159521cc5e208c2d2a42e551369c19f16354f0004da19f0a2aa12047f71

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.0.3-cp39-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.3-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 33b7c4e80675323dc0dd1f00d5878674599f990910117dade9f90da694b26d1a
MD5 a5b19e499f13fa1234dbb771e5249a77
BLAKE2b-256 6aff9805fd9568602dc534be61d2919385c170ae81e373becd6c1290d4d0c840

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.0.3-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f7238c7bd223cbdbaa0be60b405ee682a9683dde768eaebe25afbf2c5c42c97e
MD5 85e13a7a8a2d1c191425d9fb2ec2ff80
BLAKE2b-256 ae9c8f83452c2d0db3a447bb36e13860b80e1786965a85b9b6401fe9dcfcf585

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.0.3-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.3-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 37208e28511fb695a3edb74f1187bffd5bc1be3384bfbacf2ce35c7c045b7218
MD5 cb0b024376e7668d88ff50b768356b22
BLAKE2b-256 a7308675fe25f1e3f1ef19d9035d5b317c0ba952b770d8924f6b929a66f17cdf

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.0.3-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.3-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 be5d593036b0a84492b5763b4f4bd3a658496ea8208a0cb246a05848c808ba04
MD5 66dd122c7c386ba07fb7947bf04a28a7
BLAKE2b-256 72cd79b41dddc6754cbbb49702113dde6b9b496d4e4bc24d5d93409747d24414

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.0.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9fd9952a91f2e9f5b9b6117bc8f12d29e87665490722510fff6ee90d49864b3b
MD5 d60ebcd9df2e4317013877f0b41373e7
BLAKE2b-256 b4a9452573247639ad55e28c5635e219f345a753f83457f35049f5f78967c1f6

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.0.3-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.3-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 724216d77779b0a81dd7e4c04bffb310bed90872232028c16b0acaffc177721c
MD5 e158a5220e3f122a4afed4d0529277a7
BLAKE2b-256 a6d53fbff17c1390201900804373e19889d012722bf8c70ab66bcdecad156dd9

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.0.3-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 608c1d768588f81c3da567e2de9966b97a19436d918763a6872f556a634ce70c
MD5 bc32ec6803571cd1cfe43a54d3cd3c3f
BLAKE2b-256 b5eae97c23eb5c8169be254a9c6124797af359b544ca917a5fc25e314eaa2405

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.0.3-cp39-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.3-cp39-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 27b28cb14368540105c7287ac8d0c9f7b2e03f50c3655041d355fb8fa1a44ce5
MD5 184759137e9d8e871f20a09c287858da
BLAKE2b-256 7ad5642ae9a7d758f18501cc6fbb214e12a2d848c761cae8de73d9504cd7f65f

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