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.2.tar.gz (33.0 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.2-cp39-abi3-win_arm64.whl (22.9 kB view details)

Uploaded CPython 3.9+Windows ARM64

tree_sitter_mal-1.0.2-cp39-abi3-win_amd64.whl (24.3 kB view details)

Uploaded CPython 3.9+Windows x86-64

tree_sitter_mal-1.0.2-cp39-abi3-musllinux_1_2_x86_64.whl (33.0 kB view details)

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

tree_sitter_mal-1.0.2-cp39-abi3-musllinux_1_2_aarch64.whl (33.2 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

tree_sitter_mal-1.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (34.1 kB view details)

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

tree_sitter_mal-1.0.2-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (33.1 kB view details)

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

tree_sitter_mal-1.0.2-cp39-abi3-macosx_11_0_arm64.whl (21.4 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

tree_sitter_mal-1.0.2-cp39-abi3-macosx_10_9_x86_64.whl (20.7 kB view details)

Uploaded CPython 3.9+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: tree_sitter_mal-1.0.2.tar.gz
  • Upload date:
  • Size: 33.0 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.2.tar.gz
Algorithm Hash digest
SHA256 e6cb89924088fbcc0adc990ab7618c03c7451866f4c742a3cf65164e0249fe5a
MD5 7823644ee96c0ec143b221724e0e867e
BLAKE2b-256 a8d5428ffef7f0d0e82c03cc2d0157a0774a4b0250dcff22df8af593c67009f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.2-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 9e40274aec6db135002129acec47808c3c92cb8594693232c6075f288eedf136
MD5 804ca3b45b0eb14d664520aaec8426eb
BLAKE2b-256 24728d054b6f5c6b9f3dfb5444d60744bd1f0338256f54f8cc8cf37d375655b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 27ecf0d5087878bb5cfc0e5be7ae0b60657db8744926544c36f3b649a34e34dd
MD5 46362051e06621e303084d105d0c70c1
BLAKE2b-256 17e4c54d59ed79f0b1f20ea37fd27662b15dc486019eb1041f7ef4fba0744247

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.2-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f6e02fb4f9057306ad6a7969c8330217a1269de1712179120913be10ae93ca1b
MD5 995a97aa20e0d5c051dd7323508d8ef8
BLAKE2b-256 bc435bfb5b413039c16d3301da694d8535f8f5724b825553d816107d17d3414b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.2-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8ea2bfff6b2c6da768e84108f1e0733292537eda48873fc139ed01c6436fb61d
MD5 a75e6ad28beb3e9ff1fa8ca660f89fa3
BLAKE2b-256 1d8d6ba17fab8ef9d98a5074b5f84e330f98ae88cbecf4223a4ff2f8ea83521e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 81200bb899b9388242ee9a8263cf8d092f7243152a7680ed905b864073bb522e
MD5 72038cb37f902ed37e3e8fcf176ad383
BLAKE2b-256 0bdd2439efeb066f46fab40cdfc834294b228bd17d361ad7bd8fb6430b19451a

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.0.2-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.2-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 756b55c7d6dfc2987cbef4fec55bc1e454e75a430657a3082a45e05cdca76db0
MD5 e13a1feaeec3114b9c818ad9c5f6d968
BLAKE2b-256 33797bb2048a5b39b750dcbb70c0a9583e695ab749cb215528719056e8602fb2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 df2b1303d05dcf249afd73f8056e6bd5cdf63f787b766fc50bcb27b8f35e2ab1
MD5 c3818a362d98f6f22d8b18858331b16f
BLAKE2b-256 ce072fa5ed826b1940a426bb368ebcf2f6d432b50d0490aff8b09e7fce5fbef5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.0.2-cp39-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 27e94453999729ce75bea722f4fa632863756170c058363edcbd45d78b7c2dfa
MD5 6bc2e4cf5f36ced87336350405ec9830
BLAKE2b-256 fd0195766331e4e7126bd756c9a18cec9760921be1db979d54ff49549f971ad0

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