2

Where can I find a machine readable grammar for EVM? (and for Solidity)

Also, apart from Solidity, what other high-level languages currently exist that compile to EVM opcodes?

The reason I am asking is I'm looking for (or trying to create) some static analysis tools that look at EVM or Solidity and find exploits like TheDAO.

3

The question of grammar - specifically for Solidity - has come up before:

...as has the question of what languages are available for writing smart contracts:

In addition to the languages mentioned in the previous (rather old) answer, there is also an experimental language based on Python called Viper.

Finally, I believe static analysis is something that the Browser Solidity folks have been looking at (see here), which together with the EVM enhancements outlined in issue #3404 will supposedly make code more easily statically analysed.

Edit:

Solidity's grammar.txt file has moved since the linked answer was posted. It can now be found here: https://github.com/ethereum/solidity/blob/develop/docs/grammar.txt

3

There is also a xText project and the xText gramma description is quite similar to BNF:

Solidity.xtext

xText uses ANTLR in the background.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.