ColinKennedy / tree-sitter-objdump

Parse objdump files using tree-sitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tree-sitter-objdump

This library parses objdump text using tree-sitter to produce a light-weight grammar of the file.

tree-sitter-objdump-highlights

Disclaimer

This repository's parsing rules are subject to change.

Building + Using

Neovim

Make sure you include the following somewhere in your init.lua file.

require("nvim-treesitter.configs").setup {
    ensure_installed = {"objdump"},
    parser_install_dir = installation_directory,
    highlight = { enable = true },

    -- More stuff
}

Testing

Unittests

cd {root}
tree-sitter test

All tests should pass.

Actual Objdump Files

The best way to test tree-sitter-objdump is to parse Objdump files in-action.

A quick way to do that is to run check.sh

check.sh  # Searches the current directory
check.sh  /path/to/place

This outputs objdump text to /tmp/objdump_files

Then run

cat /tmp/objdumps | xargs -I{} sh -c 'tree-sitter parse {} > /dev/null || echo "{}"' > /tmp/fails

If all is going well, the output file /tmp/fails should be empty!

About

Parse objdump files using tree-sitter

License:GNU General Public License v3.0


Languages

Language:C 87.9%Language:JavaScript 6.3%Language:Rust 3.1%Language:C++ 1.0%Language:Shell 0.6%Language:Scheme 0.6%Language:Python 0.4%