Skip to main content

VHDL grammar for tree-sitter

Project description

Tree-sitter-vhdl

CI Fuzz matrix pypi

A VHDL parser for syntax highlighting.

References

Screenshots

Neovim, using nvim-treesitter and a Catppuccin colour scheme:

Screenshot

Other colour schemes

Neovim, using nvim-treesitter and a Tokyo Night colour scheme:

TokyoNight

Neovim, using nvim-treesitter and a One Dark colour scheme:

OneDark

If you'd like your favourite colour scheme to be listed here, issue a PR with a new screenshot of the screenshot example in the same style and composition as the other screenshots.

History

This version started off as a fork of alemuller/tree-sitter-vhdl, but ended up as a complete rewrite of the parser and highlighting scripts. It has very little in common with the original.

Limitations

This parser uses a simplified grammar, because the full formal grammar in the VHDL standard is highly ambiguous without compiling the entire code-base into a symbol table. In many cases, invalid syntax will parse into a valid tree.

For the same reason, there might be cases where valid syntax does not map to a valid tree. In this case, please log a bug report.

In addition, the following features are not implemented, and are considered outside the scope of this project.

  • IEEE Property Specification Language
  • VHDL Procedural Interface

Neovim Setup Process

This parser has been merged into the official nvim-treesitter, so it should work out of the box after adding it to the list of languages to install.

If you would like to use the develop branch instead (because it contains the latest features that might not have been merged upstream yet), configure your treesitter.lua (or equivalent) as follows:

local parser_config = require('nvim-treesitter.parsers').get_parser_configs()

parser_config.vhdl = {
  install_info = {
    url = "https://github.com/jpt13653903/tree-sitter-vhdl.git",
    files = { 'src/parser.c', 'src/scanner.c' },
    branch = 'develop',
    generate_requires_npm = false,
    requires_generate_from_grammar = false,
  },
  filetype = 'vhdl',
}

local treesitter = require('nvim-treesitter.configs')

treesitter.setup {
  ensure_installed = {
    -- Some list of languages...
    'vhdl',
    -- Some more languages...
  },

  -- Some other options and configuration...
}

Then copy the contents of the queries/Neovim folder to your after/queries/vhdl configuration folder, typically ~/.config/nvim/after/queries/vhdl on Linux and ~/AppData/Local/nvim/after/queries/vhdl on Windows.

Finally, run :TSUpdate.

If this does not work, change the url to a local clone of this repo instead. The nvim-treesitter installer doesn't always follow the override if the url points to an online repository.

Helix Setup Process

This parser has been merged into the official Helix repo, so it should work out of the box.

Building

  • Follow the instructions here to setup your development environment.
  • Run npm install --save-dev tree-sitter-cli
  • Add node_modules/.bin to your environment path
  • Run tree-sitter generate
  • Run tree-sitter test

Contributing

Contributions are welcome. Read Contributing.md for more information.

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_vhdl-1.3.1.tar.gz (396.8 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_vhdl-1.3.1-cp310-abi3-win_arm64.whl (181.4 kB view details)

Uploaded CPython 3.10+Windows ARM64

tree_sitter_vhdl-1.3.1-cp310-abi3-win_amd64.whl (192.4 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_vhdl-1.3.1-cp310-abi3-musllinux_1_2_x86_64.whl (262.4 kB view details)

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

tree_sitter_vhdl-1.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (265.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

tree_sitter_vhdl-1.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (258.1 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tree_sitter_vhdl-1.3.1-cp310-abi3-macosx_11_0_arm64.whl (190.5 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_vhdl-1.3.1-cp310-abi3-macosx_10_9_x86_64.whl (178.9 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

Details for the file tree_sitter_vhdl-1.3.1.tar.gz.

File metadata

  • Download URL: tree_sitter_vhdl-1.3.1.tar.gz
  • Upload date:
  • Size: 396.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tree_sitter_vhdl-1.3.1.tar.gz
Algorithm Hash digest
SHA256 bf9f26d39bfaa0f37e843c3d7ca847fcf34fbf791687318faf91b9492e2174e9
MD5 b262b4799bc39585dcb973dbb11d3e99
BLAKE2b-256 63428fae9110352ec88d126e8b520f43d558c7a7fa2661ecdd64cce2ca1631c7

See more details on using hashes here.

File details

Details for the file tree_sitter_vhdl-1.3.1-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.1-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 550e743126462f56d646f1780e1ec2699a29602f546c011ce38438f367dfb775
MD5 170706664e31f11816e98ecacc98f754
BLAKE2b-256 5bf82e8935f2445e47e657c34d8724260c25084daaf6bfcb3f7de74e9ae7ba86

See more details on using hashes here.

File details

Details for the file tree_sitter_vhdl-1.3.1-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 48b14a7a65e260f696a049d9c3fed9ce60794a4d21ab4675ea860be6aae95543
MD5 4160e792a704a6ea19d074d703956328
BLAKE2b-256 0afb46ffb9e36806ddb205394e662a3c6e067ca2997c155b82d0a24da9e2b0be

See more details on using hashes here.

File details

Details for the file tree_sitter_vhdl-1.3.1-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.1-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 08f874f77f121ff523e2c5afdf132b5434d37cd62fc72eeb9166565f37e963e4
MD5 87df408ea5ad64b9d74e644c27126804
BLAKE2b-256 2c7211943ef8edfdfc678e55616b3bc73c850cb73d95324dcfe8626b4479ed4d

See more details on using hashes here.

File details

Details for the file tree_sitter_vhdl-1.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09537e88ca81afea94bbac83a193d24dd3621e0d0319b52b486520a953da738d
MD5 462e486c110167cd89d2f1a51a036601
BLAKE2b-256 8d20a9f9f3d535604832b67319355ff5e91e83d2ac1531328f1873c54081c421

See more details on using hashes here.

File details

Details for the file tree_sitter_vhdl-1.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3339701382586cad4706b4e9f25ed7be5fb7b976c54496fac6207c55e3d4c40c
MD5 d9072b64fb793183e342f49bff9947e9
BLAKE2b-256 9d62cbc94006252a72f961c2e4f7fae83e6fbf31394fb984bcceee03f1f1abed

See more details on using hashes here.

File details

Details for the file tree_sitter_vhdl-1.3.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc2fd69b05fde1203908297278518281d2b8bbe3b3a3e94bc95aafdf8cf8d86f
MD5 8df9a4bb433d63b752fbb905ec38a111
BLAKE2b-256 aaa47a61cc9f7781a9b199327b5b90d9c843b06ede9645dc1b05d8ae7c913375

See more details on using hashes here.

File details

Details for the file tree_sitter_vhdl-1.3.1-cp310-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.1-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3c264b63d2c0281e5fe3c3a69892ef8f1c1041df3cb50aca03c743e4fa5196ec
MD5 bd26e25889985a18a50cb3b8afe5faa7
BLAKE2b-256 442ec9f84aeb3d22cf95fa8264de2e3d0d3ca44c5c8f1ccf7f2caf90a4a1f892

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