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.0.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.0-cp310-abi3-win_arm64.whl (181.4 kB view details)

Uploaded CPython 3.10+Windows ARM64

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

Uploaded CPython 3.10+Windows x86-64

tree_sitter_vhdl-1.3.0-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.0-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.0-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.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: tree_sitter_vhdl-1.3.0.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.0.tar.gz
Algorithm Hash digest
SHA256 dbcb476dda05458a32cd1aee64bb20892c3d1a18da5aed21d51f4f938b25fce2
MD5 1d2b812b6fcc43980a35b33679672cf2
BLAKE2b-256 0ac1ace6d157b55302d968c158a8107df7ede5959725c6981eadb9881bc8a4f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.0-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 79c41d704b9d5063c1217d402e956ccf447139f59128bd96ce5f61077565f275
MD5 5da82dd16fb9ee4bb867d46cf0cd48df
BLAKE2b-256 8a41e8c603491649c5cf4ccdde5f864f0376443268a6e143ecd13cfaec861f5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4cd140cefcbffda246ac2173ac682a8d6eed9bcf9e1af5088fffdc60d79f80aa
MD5 6741a780f1ee9b1a28dffc373208f020
BLAKE2b-256 f2c8fe1d6d52d7b0012cfa23dd9dcb1719e24e36eca1b8565e00b5ec0965e4ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.0-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 17de76bced84496fce66fe3a1e36cc58bd7199aaeb6a74f9bc48109fe2f97528
MD5 4a578f9791a08804872e6cb8bf372ac0
BLAKE2b-256 9429b90d55a67df2fdcc265d18959c73574aeb751490fa6239084ef440c2a709

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7b35cdffce8c005d1603684d4e8d67c676dd36d2d448da8c3cd2a27ad34507f6
MD5 df89f0cc31a44b8b7db6931cb2ae139d
BLAKE2b-256 0d74c20017870c5b37662280a2909b206d82b84fd16b64a8783336d1cde20027

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 afd02b9e03a29001126fc4479869c0aaa31f841f7d821fe4d83a7d2dda2dd375
MD5 5cc1abb4140cfe24b78770eaf88bbb05
BLAKE2b-256 684d57f50865199342259794677f3bd1bb4bd8ac2fba86369fd40709bf7a7bbf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3805611025146cb4e74bad70d938b85e6ae788c4d73c7447ce906864979ed629
MD5 c1c1a60c88ed6607dbfdc2df12689779
BLAKE2b-256 d0b4d8c2064d38549c26e39711078fa7095be11277b4d1630c0c7737190bacdd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_vhdl-1.3.0-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4a0b1eecd40f9e511ab2580244ca5256cff0256007c7ef00f7f02868b52d2188
MD5 0b72124839a379b5b4f6952739256c96
BLAKE2b-256 a033557a0a441b77e7fe42b353d37278fdecd213f9b84cf75222a28545a3fc6a

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