Write the syntax of BNF in EBNF (and the other way round). Produce the grammar for a simple language specifying conventional arithmetic expressions involving integer constants, brackets and the four...



Write the syntax of BNF in EBNF (and the other way round).



Produce the grammar for a simple language specifying conventional arithmetic


expressions involving integer constants, brackets and the four binary operators


+, -, * and /. Make sure that expressions of the form 1+2*3 are interpreted


correctly by the grammar. Then extend the grammar to allow the unary operators


+ and -. Make sure that the grammar correctly interprets expressions of the form


-1-2. Maybe produce an implementation, although this will be much easier


once material in later chapters has been read!



Dec 01, 2021
SOLUTION.PDF

Get Answer To This Question