Kalpana Kalpana (Editor)

Translational Backus–Naur form

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

Translational Backus–Naur form (TBNF, or translational BNF) refers to Backus–Naur form, which is a formal grammar notation used to define the syntax of computer languages, such as Algol, Ada, C++, COBOL, Fortran, Java, Perl, Python, and many others. TBNF goes beyond BNF and extended BNF (EBNF) grammar notation because it not only defines the syntax of a language, but also defines the structure of the abstract syntax tree (AST) to be created in memory and the output intermediate code to be generated. Thus TBNF defines the complete translation process from input text to intermediate code. Specification of the output intermediate code is optional, in which case you will still get automatic AST creation and have the ability to define its structure in the grammar.

The TBNF concept was first published in April 2006 in a paper at SIGPLAN Notices, a special interest group of the ACM.

Here is a sample grammar specified in TBNF:

References

Translational Backus–Naur form Wikipedia