I scoured the Mix and Solidity repos for something like a formal definition of the language's grammar, so that one may generate parsers using tools like GrammarKit, but couldn't find anything.
Any pointers?
I scoured the Mix and Solidity repos for something like a formal definition of the language's grammar, so that one may generate parsers using tools like GrammarKit, but couldn't find anything.
Any pointers?
There's a file called grammar.txt in the Solidity repo:
https://github.com/ethereum/solidity/blob/develop/docs/grammar.txt
That's probably what you're looking for?
I wrote an ANTLR4 grammar for Solidity that you may find useful:
https://github.com/solidityj/solidity-antlr4
It can generate parsers in any of the ANTLR supported targets and it has full support for the Solidity language as of today.
Here's yet another link pointing to the solidity documentation:
http://solidity.readthedocs.io/en/develop/miscellaneous.html#language-grammar
There is also a xText grammar, https://github.com/webdaford/smart-contract-tools/blob/master/workspace/com.dell.research.bc.eth.solidity.editor/src/com/dell/research/bc/eth/solidity/editor/Solidity.xtext which is quite similar to BNF.