https://github.com/colinkennedy/tree-sitter-objdump
Parse objdump files using tree-sitter
https://github.com/colinkennedy/tree-sitter-objdump
neovim objdump tree-sitter
Last synced: 12 months ago
JSON representation
Parse objdump files using tree-sitter
- Host: GitHub
- URL: https://github.com/colinkennedy/tree-sitter-objdump
- Owner: ColinKennedy
- License: gpl-3.0
- Created: 2023-10-10T05:16:39.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-22T13:19:55.000Z (over 2 years ago)
- Last Synced: 2025-04-13T09:50:48.640Z (12 months ago)
- Topics: neovim, objdump, tree-sitter
- Language: C
- Homepage:
- Size: 183 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tree-sitter-objdump
This library parses objdump text using
[tree-sitter](https://tree-sitter.github.io/tree-sitter) to produce
a light-weight grammar of the file.

## 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.
```lua
require("nvim-treesitter.configs").setup {
ensure_installed = {"objdump"},
parser_install_dir = installation_directory,
highlight = { enable = true },
-- More stuff
}
```
## Testing
### Unittests
- Install the [tree-sitter-cli](https://www.npmjs.com/package/tree-sitter-cli)
```sh
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`
```sh
check.sh # Searches the current directory
check.sh /path/to/place
```
This outputs objdump text to `/tmp/objdump_files`
Then run
```sh
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!