A syntax parser for the MIPS Instruction Set Architecture.
Project description
tree-sitter-mips
Tree-sitter grammar for the MIPS assembly language.
Getting started
Building with npm
First, run npm install to install the tree-sitter cli. Next, build the grammar using npm run build, which generates the necessary parser files, or use it to parse a file with npm run parse $file.
Building without npm
Install tree-sitter (e.g. nix-shell -p tree-sitter).
Build the grammar using tree-sitter generate and parse a file with tree-sitter parse $file.
Integration in Neovim
To use tree-sitter-mips in neovim, the plugin nvim-treesitter is required.
Installing the lastest grammar from this repo involves the following three steps:
- Update your Neovim config for nvim-treesitter to refer to tree-sitter-mips. Add this to your tree-sitter config in neovim:
local parser_config = require('nvim-treesitter.parsers').get_parser_configs()
parser_config.mips = {
install_info = {
url = 'https://github.com/omeyenburg/tree-sitter-mips', -- You can use a local path
branch = 'main',
files = { 'src/parser.c' },
generate_requires_npm = false,
requires_generate_from_grammar = false,
},
filetype = 'asm',
}
- Tree-sitter should automatically install tree-sitter-mips for you when you open a
.asmfile. If not, run:TSInstall mipsinside Neovim. - Copy the files from
./queries/to the neovim config directory at$XDG_CONFIG_HOME/nvim/queries/mips/- see the Adding queries section of the nvim-treesitter README. They are required to enable highlighting.
mkdir -p $XDG_CONFIG_HOME/nvim/queries/mips/
cp ./queries/* $XDG_CONFIG_HOME/nvim/queries/mips/
Alternatives
If you are looking for a more general grammar for assembly, check out tree-sitter-asm which supports features of other instruction sets, yet it lacks some specific features of MIPS.
Further resources
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tree_sitter_mips-0.1.3.tar.gz.
File metadata
- Download URL: tree_sitter_mips-0.1.3.tar.gz
- Upload date:
- Size: 30.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7d0bc0141569a5ee1a354bf0756ba99a5bf1e27771e35500b514cc38f8dbeec
|
|
| MD5 |
7dd075ad1ed9f3245878a3364ea4d1e1
|
|
| BLAKE2b-256 |
7b6e8cb23d2636328c9d1ff8196168e9b8a09ba3979503fe66a7afefeb0236e0
|
File details
Details for the file tree_sitter_mips-0.1.3-cp39-abi3-win_arm64.whl.
File metadata
- Download URL: tree_sitter_mips-0.1.3-cp39-abi3-win_arm64.whl
- Upload date:
- Size: 22.0 kB
- Tags: CPython 3.9+, Windows ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ef300795ab30bf9fce363ecb9afab9ab10252582b7765e19578a737893b003a
|
|
| MD5 |
154f0274924c321cca9735b03d8f160f
|
|
| BLAKE2b-256 |
f421286c6f858d0d37431ea4d2a5c5c2d5424956cd242dc36904d4fbdf5e28fd
|
File details
Details for the file tree_sitter_mips-0.1.3-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: tree_sitter_mips-0.1.3-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 23.0 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a610e0ed4cdbc515d34584cafcd6974dad3605ff0c35e33814c2e519edd22d4
|
|
| MD5 |
157a0c55c4b4705f56916673e34e9383
|
|
| BLAKE2b-256 |
cb8fbfe37cfdf944c9aa1c440155f8fc809ad545dea1988cc7ed06e9b502838b
|
File details
Details for the file tree_sitter_mips-0.1.3-cp39-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: tree_sitter_mips-0.1.3-cp39-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 40.1 kB
- Tags: CPython 3.9+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
583ca8582470b011643e656aae049ba188b8224b17e1604a009783f3992d7bef
|
|
| MD5 |
f85828015eda3b4a5a69abd1bb694241
|
|
| BLAKE2b-256 |
13f0c62781d3fa9559a4c0948aff23b35ca79e9d86f5a3f8a2d86ae49a9de936
|
File details
Details for the file tree_sitter_mips-0.1.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: tree_sitter_mips-0.1.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 43.4 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2a411b68d727e44909cd99f87e5ff165e769fe326880ad609d947318c283289
|
|
| MD5 |
866e7f962216826c95b89a74a6926986
|
|
| BLAKE2b-256 |
1cbe650ef2a7917314d2408a2137879acb23e723038d02ac47f8c68fd70c300a
|
File details
Details for the file tree_sitter_mips-0.1.3-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: tree_sitter_mips-0.1.3-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 40.8 kB
- Tags: CPython 3.9+, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b08aa4fb94830a00b31125fe520827fbf4e8858426cf0314433e37a63a22593b
|
|
| MD5 |
4c0478b790b505bf7369f4228a1fef7d
|
|
| BLAKE2b-256 |
490e9906457a3dc431f3531a6775e00d77b9895396642234bdda375dc4739bb3
|
File details
Details for the file tree_sitter_mips-0.1.3-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: tree_sitter_mips-0.1.3-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 22.3 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a93c312425caca6ce6e9d452be234c6b50863009a01773ee5a3dc5a08a97f73
|
|
| MD5 |
fa0bb270eb32b700cc0c6a9fa7e05863
|
|
| BLAKE2b-256 |
b5ce3d0927bdf574b87e19c52f58db05eaa5eaa7ab58a9309b0e7c9fe984db4e
|
File details
Details for the file tree_sitter_mips-0.1.3-cp39-abi3-macosx_10_9_x86_64.whl.
File metadata
- Download URL: tree_sitter_mips-0.1.3-cp39-abi3-macosx_10_9_x86_64.whl
- Upload date:
- Size: 21.7 kB
- Tags: CPython 3.9+, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
760f56aa85ff985a9a7376036772debb2aadc2f1fe61b2a668bced5286ac761a
|
|
| MD5 |
43fcf5ee97d5ba1a87c794dbfb765de2
|
|
| BLAKE2b-256 |
e6fb134de166d6777b306bdaec92758d09a2abcc7127ddf979d46c824004f856
|