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

Uploaded CPython 3.9+Windows ARM64

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

Uploaded CPython 3.9+Windows x86-64

tree_sitter_mal-1.2.2-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.2-cp39-abi3-musllinux_1_2_aarch64.whl (34.5 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

tree_sitter_mal-1.2.2-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.2-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.2-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.2-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.2.tar.gz.

File metadata

  • Download URL: tree_sitter_mal-1.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 d2c877805e28693749ddfd39857afec99ae253305094d1a0e8ab842aeb844a09
MD5 dc9cce406b5b0068e00b9dec2cbba35e
BLAKE2b-256 31e44ca1da0926e8c29549b618382a89038be4c3cd49e23266f3fcde4a47ee93

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.2-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 a2d3af794c18d99284aaa197bcb5d849847fd40c039fdee3a0ebb87e47fecd21
MD5 b62358a9110cf3d9fa3db13b488f9049
BLAKE2b-256 6d36e78da6c067ecf7f8bb85347b641f42453aa3f68062550915358f50f18d0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e3f25e5392536b68f2ed4af3b669b30c828cfda9d70e6a2c9a09620037628836
MD5 fa46d81da9ddbd90c3d26ff4f94ce72c
BLAKE2b-256 456e88d4f518f167f3841896584be2ca6b0560efd9975d371aa33e0614614def

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.2-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 633d4e64b03f748c7043119dcbbc370e309a91447d03d7d1f518cefca231cab4
MD5 350d97e675608a8220c30768101ef1fa
BLAKE2b-256 7c76117b72a6fa70f00c48b32a4dfde10c8dd71f357add72e0b77714bbd4f0c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.2-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 5e84998eb8cee3f7f46e413b195728482b3e67f161f39c34c1af31d5d69aea83
MD5 95a3b161e45e2ea3e47d0390d4621fc4
BLAKE2b-256 d9598389d73fc8b45adc2e8cc74b6c4fc17ca4ccd0becd6e9b6ce71f18283c85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1e7c9e5ff4c46f3d2eb597672145c7111b046053b762bf71322522fca5e8ca40
MD5 d08ee44000de446ca10b8cb8aa272757
BLAKE2b-256 fc14c42496b9db04d8e714d6285091ddb8d35d0dde944be5c680f63db43f05d8

See more details on using hashes here.

File details

Details for the file tree_sitter_mal-1.2.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.2.2-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 f8a0f6fb0ce6e3cc51d55ffd5b374edb02cb6da67972f848c90101e04568483d
MD5 72e01a6f373002f3745ccac2045ba015
BLAKE2b-256 ea8fdd1a03d62fbb487870ebe67391d67d6526c62eeb6cc7bfb2e63d4e1f1dfc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 384ba354201c068f430a28060d0e5b0af294a1b10abef958f9dde4a19eda004b
MD5 11ccaf133bc72b8294464a2120340ea8
BLAKE2b-256 65b9e925343f44653a09b3fc2d166d55514dab71fbd8738c38b0c87ba977ee24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_mal-1.2.2-cp39-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 70455330aa10a1262a3a7edaa532c44f511435308a4ca95c1cfe6922ba70c9e0
MD5 e0f79ad3610d31b45d0a5d88c0863a1c
BLAKE2b-256 25f5e40ffad7eb66ee50bdc8ec14a4e8c2a9148c856cede0985c36c005ceadca

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