Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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 post

Explanation / Answer

Syntax of IF statement:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote