Question 6 Two grammars are given: S :: = SS | 0 | 1 T :: = OT | 1T | 0 | 1 The
ID: 3534493 • Letter: Q
Question
Question 6
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:
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.