This is a grammar for the SPARQL 1.1 definition, found here: SPARQL 1.1 Grammar - w3.org It's not complete, still a work in progress and what is implemented is not guaranteed to be without error. If you find an error or want to offer improvements please open an issue or PR with some details.
The files here are published under the unlicense, so use them however you wish. Acknowledgements are still appreciated.