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.2.3.tar.gz (34.4 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.2.3-cp39-abi3-win_arm64.whl (23.7 kB view details)

Uploaded CPython 3.9+Windows ARM64

tree_sitter_mal-1.2.3-cp39-abi3-win_amd64.whl (25.0 kB view details)

Uploaded CPython 3.9+Windows x86-64

tree_sitter_mal-1.2.3-cp39-abi3-musllinux_1_2_x86_64.whl (34.1 kB view details)

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

tree_sitter_mal-1.2.3-cp39-abi3-musllinux_1_2_aarch64.whl (34.4 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

tree_sitter_mal-1.2.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (35.1 kB view details)

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

tree_sitter_mal-1.2.3-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (34.1 kB view details)

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

tree_sitter_mal-1.2.3-cp39-abi3-macosx_11_0_arm64.whl (22.0 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

tree_sitter_mal-1.2.3-cp39-abi3-macosx_10_9_x86_64.whl (21.4 kB view details)

Uploaded CPython 3.9+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: tree_sitter_mal-1.2.3.tar.gz
  • Upload date:
  • Size: 34.4 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.2.3.tar.gz
Algorithm Hash digest
SHA256 233ee144a7585fd97ff1a925cea17c01a9d6900435e013f090dd47f7ebef747a
MD5 f2ae79eec40921948dfb6e438cb8cfc2
BLAKE2b-256 82576fcd8584b3424aa0b32716ed99ea84b923ca8f51abab75db766536cb901d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.3-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 3040be608f1862bc819de40daab7b3d38e7fdd5ca7fc06c33036790dba91144b
MD5 51143144900b8a072dc9f8c32acf66ef
BLAKE2b-256 9bb92f075398383301c2ec6ca142736fd7fa9f391a4b088fc23c36d36eff8a53

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b81f0eb0959e73dda46c4eb172cf8c74b651e582110228bdbde044994b5562d8
MD5 389c0915040eadc7f39fafd4dbd128f9
BLAKE2b-256 9cdd2e2771174b9f5cf7bdb28f0f31f7efe89bca837d07ff49b2c7813160919f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.3-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 46302d490e0f59b54e4f816d6bcbe5e0dbb2bd0838c670bca2f53ae1d2be36a7
MD5 8f687a0e4542b48d749bf512a9da95f0
BLAKE2b-256 6485653e9931d679d75c685039e23214e1f48100d979a80dc79aa4fb9c4c6106

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.3-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 04ef32b3fe365d9ce902e8e526a0e13831a5d00d1bf40daed2870f27023120e9
MD5 b4df8905a1de80e6572db6337e1703af
BLAKE2b-256 7552a09d35e30e753a792698449be454000b29427bf2dcb2682c9189027267b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6241b02be30ab7f159771e947ba4d44358c70d899cb3ada44b1f3faf5fd61663
MD5 8d48ffb61a154a231234a17b62da8729
BLAKE2b-256 9bbcf60692dc4b14bf30579da637a672943c38393b0f0b4646e2fbc978be420d

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.2.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.2.3-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 3a55064b3b82cdb32a650e6ab11931c9af2b7d5059ade3251c412efc370ab3e6
MD5 98c3c19ed5293fd1c217117c934bf6eb
BLAKE2b-256 b181799f94abd201567fa5c079f201d5b8ca0e2c8af0b53dbfb7400da536565e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 11ad695949bc96e7d71336acf4909f876088d981fab8c7ca80d5338a8004ecbf
MD5 8ef1c38c9d56423394cf7abe6be45ed3
BLAKE2b-256 250db0d7c7da1781fb5a97f1557fe7ad9e1090b7464d11f6162e305398b6f2a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.3-cp39-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7cf73248205ea054a30c0831b2d6af9bff2739aec1c61ee22fb0bc7b049ab7de
MD5 52c40fcb07548c0a8fbd7848d7e2b18e
BLAKE2b-256 8caf135e5f03add73669995c6ae6a6c741fac767fb67b4a5293ab144163a41f7

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