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.1.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.1-cp39-abi3-win_arm64.whl (23.7 kB view details)

Uploaded CPython 3.9+Windows ARM64

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

Uploaded CPython 3.9+Windows x86-64

tree_sitter_mal-1.2.1-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.1-cp39-abi3-musllinux_1_2_aarch64.whl (34.7 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

tree_sitter_mal-1.2.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (35.3 kB view details)

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

tree_sitter_mal-1.2.1-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.1-cp39-abi3-macosx_11_0_arm64.whl (22.1 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

tree_sitter_mal-1.2.1-cp39-abi3-macosx_10_9_x86_64.whl (21.5 kB view details)

Uploaded CPython 3.9+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: tree_sitter_mal-1.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 7f7a29138e161a4c3f3b53635ee436ec0af0f0119f3911ed8b969fb549f6f2b2
MD5 413fb33e9246e37c2573711b7c0e9686
BLAKE2b-256 f72ba05672ef2889de3a8af0be7d18297527a95aa517f130bba81ec62d5a7e74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.1-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 cefe9dd4d7f27bf8293e0d2a3f4b32b8e4f5abb34a435b57dd88fc389be18176
MD5 6a42b475c7bb3e297b52179f9dc293e9
BLAKE2b-256 f51a52b22b129bebc5caca198191889e5b3cddd9cfe80f202f1c600afeb1230f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 47ce7fe80c70f1186eb31697492193062697820af1406b3955baf9b97e5293dd
MD5 f57ffd7521f73d7fe8d04c8689b14a3e
BLAKE2b-256 c8c501c477d42fed3b4fa29eb6e97ef2ab09f826c871de9bc88a449653f259b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.1-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 bb9790df8cf5e78cf5af6dbd61bdf801db72e0b5067a7e2de75c80c82ce4cd5f
MD5 ed2236aea4872cc82757777a8c323b90
BLAKE2b-256 e8df5b0426b3a9951a0b40b245c5c0a5b9f0a7246ed22d9f01e7894a82d742aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.1-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7ec5c1854c01dac511ad54256b167abff063f2557773a06cbb39c54d69b472e2
MD5 6425c8cf64f6d41a48b8cc9a91f3562b
BLAKE2b-256 2c407d471bb386e2024721662e35dc4a1d47433298936227b673dc31e9e6f9a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 39035d49c12396be2a7b5f534ac09340f371e44f1640d5a6f05dda95946ee158
MD5 0ff4ede2a9fc2ea861c885a2ef0ed905
BLAKE2b-256 93dbae08602edb8230f04c821387bba3e4b3fb674ba4efdf78156128227b01cd

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.2.1-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.1-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 6e77c9c0540626fe50344e1fb4f47b8cf79ca76e3c2c5f91a120bb3404a567a1
MD5 5d22dff70c504b3a9fe970a6ab247f79
BLAKE2b-256 2f02271a3e2c56112ca323dce101bd077e163e0c0a0257dd997c8e349e5d17cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e27fdf4ec94b51e5fb30a7fb99f5e79865b64d8c6b98caea558840e213c9e9f
MD5 a4a7d3ade8e153d81c8abd28a6b3a30e
BLAKE2b-256 84c8f87872caec1c68a5c6c2b3c9e11a543fdd1b3693932bbf7d8c934fe4696d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.1-cp39-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c8f606a19f6f7175d31738ae944b680bae854a67d850dfb407307cafccc3f1d4
MD5 a66910479270181bad711d6212936575
BLAKE2b-256 e2d9316dd5a680aad1b255dfeb76b709ccb2c26b15fb2397951488c251a27ecb

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