Search code examples
bnfscripting-language

describing something, should i use Backus-Naur Form?


I want to describe a complex script and possibly programming language. i was thinking of describing it in Backus-Naur Form before doing anything (excluding dummy/sample script code)

Is there another form to describe a language then Backus-Naur Form? What alternatives should i consider?


Solution

  • The obvious alternative would be extended Backus-Naur form, however there are few others that can be used, and I found a couple of links with some quick searching:

    Augmented BNF

    Wirth syntax notation

    Van Wijngaarden grammar

    Personally I would stick with BNF / EBNF due to the prevalence of information and tools which use it in some form. Tools like bison or yacc can help with the generation of a parser from such a grammar and make it quite trivial to produce an interpreter.