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.0.tar.gz (33.7 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.0-cp39-abi3-win_arm64.whl (23.4 kB view details)

Uploaded CPython 3.9+Windows ARM64

tree_sitter_mal-1.2.0-cp39-abi3-win_amd64.whl (24.7 kB view details)

Uploaded CPython 3.9+Windows x86-64

tree_sitter_mal-1.2.0-cp39-abi3-musllinux_1_2_x86_64.whl (33.6 kB view details)

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

tree_sitter_mal-1.2.0-cp39-abi3-musllinux_1_2_aarch64.whl (33.9 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

tree_sitter_mal-1.2.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (34.8 kB view details)

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

tree_sitter_mal-1.2.0-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (33.6 kB view details)

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

tree_sitter_mal-1.2.0-cp39-abi3-macosx_11_0_arm64.whl (21.8 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

tree_sitter_mal-1.2.0-cp39-abi3-macosx_10_9_x86_64.whl (21.2 kB view details)

Uploaded CPython 3.9+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: tree_sitter_mal-1.2.0.tar.gz
  • Upload date:
  • Size: 33.7 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.0.tar.gz
Algorithm Hash digest
SHA256 e2ce5b8e8461daf93e91ed4438fbd8375f0821ec0f17adba490fe74a3dfa6e36
MD5 34021c4a03e9c1712a4fb267fb273a66
BLAKE2b-256 f11bb6820899c21b489d12fe8d378f0c0c3a446f6974a398f2490dec9c2717f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.0-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 d620276570f866fa1eeb8370d39a7f526950faa1960e3567549faf525c11c4e3
MD5 02e7cbd752e0e9456bfeefbae4246a49
BLAKE2b-256 218658c06b4b2ee2929d28d142c995b970524668807587ac8b142786b10d8218

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 66eb352403588d3eae65ed80855dc5af4ca9a406d9730f97efc13fdfb4127a40
MD5 f7fb6a01fc18a5a19c356a9c8f3854e3
BLAKE2b-256 75d0965493e7c17ce82dc49d436ff09a49aa36f894a08d164bc472d268a6e0f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 07f5d3ea66e5329dd1226d155b33ccc51a977b041db039351593daa25190e6b3
MD5 c92a3a7d91c633b1d38e62226e19be11
BLAKE2b-256 506dbc71fe2438c13af8c85f42ddd7585beacc3056a569979b1ebe027a24f86d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 0ff7a66fd61b4ed1375bf212b2f15e781ec49a1ba8d7281fa40e9f7dfbd939c5
MD5 12249b7fd34913fb84cc76aca6059c67
BLAKE2b-256 5b322ba2caa25154b8496857140691d8b5064f3bd95df566e2ba133dc0f0eb45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 84a09fbd95be4d00b61a55c7595a8c08492a2ff0a0503796de6e26df3f51e370
MD5 d083591619f2346cb2e1ca2e7072c218
BLAKE2b-256 18c318255f38a939932251877b23a867b012bf6316f7790da24c3b984ec8f062

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.2.0-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.0-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 8b8b172a3a99da34dff424e48fb25320be851cf6f7dea2d895ef81e7c921eabd
MD5 cbc517eaa283cfe790c08d55af63afc0
BLAKE2b-256 02aff09211986fb6050413f245daef08f5f351d41f52c0acf672f2a3d75b88ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f01c9d5894d639969035c874d14479e860e3a09d9fe1707a56d3bab3b824e894
MD5 c3dcb7cd5154203d4f0ba74ac89ce261
BLAKE2b-256 f73829adddaa1ede2d4732fcce3e41287925cd6c06253bebc611f7efec79551e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.0-cp39-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f9366efbc918b343b8218e8d1361bc37890db8befe0377575b73d781dbac6871
MD5 5359b1ef88180133fba1eb5dc5f71f27
BLAKE2b-256 a71dc1e11593f9ea9007a687b6798d9930dae68f6df97ef4230d0d64f7458eb4

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