Formal grammars of the input languages in the BNF are defined below. Characters in the (bold typeset are a part of the syntax of the input language.