What’s the difference between BNF, EBNF, ABNF, ASN.1 ?

Abstract Syntax Notation One (ASN.1) is mainly for binary protocol, it is a standard and notation that describes rules and structures for representing, encoding, transmitting, and decoding data intelecommunications and computer networking.. A good tools like asn1c can convert ASN.1 to C structure, encoder/decoder.

BNF, EBNF, ABNF are for text format parsing. In terms of power, they are all equivalent.

BNF is the original, most simple, mostly used in academic papers of theoretical context, for communicating to humans. (as opposed to being used in compiler/parser.).

bnfc is a good tools to convert bnf into C/C++, Java, C#, Haskell parser.

EBNF means Extended BNF. There’s not one single EBNF, but many.

ABNF (augmented BNF) is a rather very different format that BNF, but is more standardized. It is harder to read, but is most used in parsers. Many IEFT standard are defined using ABNF.

APG is a ABNF Parser Generator,  parse2 produces the aParse parser generator that reads Augmented BNF grammars and produces Java, C++ or C# classes that can build parse trees for valid instances of those grammars.

There are many parser generators at:

https://en.wikipedia.org/wiki/Comparison_of_parser_generators

References:

http://xahlee.info/parser/bnf_ebnf_abnf.html

https://en.wikipedia.org/wiki/Comparison_of_parser_generators

 

Please rate this


Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>