Question 7 Two grammars are given: S :: = SS | 0 | 1 T :: = OT | 1T | 0 | 1 The
ID: 3534494 • Letter: Q
Question
Question 7
Two grammars are given: S :: = SS | 0 | 1 T :: = OT | 1T | 0 | 1 The first grammar is ambiguous. This means that for some expression in the language (not necessarily for all), the expression has more than one parse tree. Give an expression that is in the language and give two different parse trees for it. The second grammar is unambiguous. This means that every expression in the language has exactly one parse tree. Show the parse tree for the expression 110. Find BNF or EBNF grammars for Ada (available on the web). What is the syntax of the IF statement? Write a legal Ada if statement that will look at the integer variables a and b, and if a is 1, will increment a ( a := a + 1;) if b is 3, will decrement b (b : = b-1;) otherwise, will multiply b by 2 (b := 2*b; R Compute the weakest precondition for the following assignment statement and the postExplanation / Answer
Syntax of IF statement: