Menu

(Solved) : Exercise 22 Given Following Ebnf Declarations Based Modula 2 Div Mod Construct Two Example Q44134002 . . .

Exercise 2.2* a) Given the following EBNF declarations (based on Modula-2) AND <factor> & <factor>} <simple expression> → [+

Exercise 2.2* a) Given the following EBNF declarations (based on Modula-2) AND <factor> & <factor>} <simple expression> → [+ |- ] <term> { + <term> | – <term> OR <term> } <term> + <factor> {* <factor> | <factor> DIV <factor> MOD <factor> <factor> + <number> | <ident> (<simple expression>) NOT<factor> <ident> – <letter> { <letter> | <digit> } Construct two examples of a <simple expression>, using only terminals in the language. Try to make each example significantly different from the other so as to illustrate the range of expressions which this definition encompasses. Assume simple definitions for <letter> (i.e., a..Z, A..Z), <digit> (i.e., 0..9), and <number> (i.e., <digit>{<digit>}) although the actual definitions in Modula-2 are more complex. [6 points] *exercise adopted from Jonathan Mohr Show transcribed image text Exercise 2.2* a) Given the following EBNF declarations (based on Modula-2) AND & } → [+ |- ] { + | – OR } + {* | DIV MOD + | () NOT – { | } Construct two examples of a , using only terminals in the language. Try to make each example significantly different from the other so as to illustrate the range of expressions which this definition encompasses. Assume simple definitions for (i.e., a..Z, A..Z), (i.e., 0..9), and (i.e., {}) although the actual definitions in Modula-2 are more complex. [6 points] *exercise adopted from Jonathan Mohr

Expert Answer


Answer to Exercise 2.2* a) Given the following EBNF declarations (based on Modula-2) AND & } → [+ |- ] { + | – OR } + {* | DIV M…

OR