Motoko Syntax in EBNF Format


I’m looking for the syntax of the Motoko programming language, preferably in EBNF format. I recall reading that the code is closed source, but accessing its grammar would really help me visualize programs and systems in Motoko. I’m currently developing a programming assistant for Motoko, so accessing the syntax would be extremely beneficial. If it’s not possible to get the grammar, I’d appreciate being pointed to resources where I can find Motoko code samples of different complexity levels.



Motoko is open source. The repo is here: GitHub - dfinity/motoko: Simple high-level language for writing Internet Computer canisters
IDK if it’s EBNF, but we have a grammar available here: Motoko grammar | Internet Computer

1 Like