SkillAgentSearch skills...

Sgp

Solidity ANTLR4 grammar Python parser

Install / Use

/learn @OpenZeppelin/Sgp
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Lint and test + coverage ANTLR4 test

Solidity Grammar Parser

SGP - is a Python package that allows to build an AST for a given Solidity source code.

Kudos

Build

Run build.sh that does the following:

  • checks if Python is installed and downloads it if not
    • including pip
    • including antlr4-python3-runtime package
  • checks if Java is installed and downloads it if not
    • including jre
    • including jdk
  • checks if antlr4.jar is downloaded and downloads it if not
  • runs the ANTLR jar file and compiles the Solidity.g4 file.

The output result can be found in the ./out directory

Tests

Run:

  • python -m coverage run -m unittest discover -v && python -m coverage report for the Python tests
  • run-tests.sh to execute antlr4 parse testing

License

MIT

View on GitHub
GitHub Stars13
CategoryDevelopment
Updated8mo ago
Forks4

Languages

Python

Security Score

87/100

Audited on Jul 27, 2025

No findings