Solidity grammar for tree sitter
Last updated Jun 11, 2026
186
Stars
56
Forks
4
Issues
0
Stars/day
Attention Score
84
Language breakdown
No language data available.
▸ Files
click to expand
README
🌴 tree-sitter-solidity
💡 this grammar is still in development, the structure of the generated AST is not stable
This repository contains a grammar for tree-sitter.
The goal of this project is to provide an parser efficient low-dependency parser for solidity which targets most solidity versions in use and is designed for enabling metaprogramming.
Navigating this repository
The primary file in this repository isgrammar.js which describes the tree-sitter grammar.
# Primary file:
grammar.js
Tests:
/test/*/
Auto generated:
/src/*/
index.js
binding.gyp
References
-> Ethereum solidity grammar:- https://github.com/ethereum/solidity/blob/develop/docs/grammar/SolidityParser.g4
- https://github.com/ethereum/solidity/blob/develop/docs/grammar/SolidityLexer.g4
- https://docs.soliditylang.org/en/latest/grammar.html?#
-> Solidity antlr grammar: https://github.com/ConsenSys/solidity-parser-antlr
Major inspriration & some structures have been taken from tree-sitter-javascript, a big thanks to the contributors to this repo!
🔗 More in this category