Is there a publicly available grammar for the DQL language?

Hello everyone,

I have been looking for a formal specification of the DQL language in the form of a context-free grammar (for example, in EBNF notation), but I haven’t found it yet. Is there any document or file where I can find it? Could anyone provide it to me?

I noticed that since the beginnings of Dgraph there have been some comments about this (see ANTLR for parsing languages and specs, and I haven’t found anything in the repository regarding this (although I have found the parser, but I want to avoid reverse engineering to deduce the grammar, as well as automatic grammar inference from examples in the language).

Thank you very much.

Regards,
Omar.

Regrettably there is not. When DQL was first developed, the golang ecosystem lacked BNF-based or similar tooling to leverage a formal grammar, so it was developed differently.

Can you let us know what you would like to use the grammar for? We may be able to suggest workarounds.