Semantic BNF

I will describe here a scheme that I learned from Freiburghouse’s PL/I manual for Multics. BNF originated to enumerate the possible programs in some language, thus providing the syntax of the language. As such it does not say in particular what these programs mean, the semantics, but generally the semantics of the languages are expressed conveniently with reference to the terminals and syntactic categories of the BNF.

The PL/I manual described the possible quality sets that a PL/I declaration statement might ascribe to a newly introduced variable.


These possible qualities formed of an infinite tree which was described in a form that looked just like BNF.
The semantic information that a declaration might convey about a new identifier would itself be a structured collection of simpler collections or primitive elements just as a statement in a programming language is such a structured collection. The textual order of these elements is of the essence in the syntax of the programming language but not so in the case of the elements of the semantics of the declaration. ‘That an identifier is a number’ comes neither before nor after ‘that it is static’. Where a BNF for syntax may be ambiguous when two productions yield the same text, a semantic BNF is never ambiguous for its production is a tree which manifests the BNF production that produced it. In this regard a semantic BNF is
Sematic BNF is a bit like abstract syntax and connected to Abstract Syntax Trees. I think it is not related to ASN1 (Abstract Syntax Notation number 1).