Skip to content

OpenZeppelin/sgp

Repository files navigation

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