points) Consider the following ammar: Terminals are in case and terminals are lo
ID: 3761276 • Letter: P
Question
points) Consider the following ammar: Terminals are in case and terminals are lower. All sentences strings) start at S P-- alb Ya A) (3 pts) Rewrite the grammar into EBNF B (2 pts) Describe the language (set of all sentences) defined by the grammar above. C) (6 pts Which of the following sentences are in the language generated by the grammar (D1) aaa (D2) ba (D3) aab (D4) bab (D5) baaa (D6) aa D) (6 pts) For each of the sentences above, U prove or disprove it is in the language by demonstrating its derivation way (s) OR parse tree(s) E) (3 pts) Is the grammar above ambiguous? Why or why not?Explanation / Answer
Answer:
According to given sentences, the grammar can be given as,
A)
The EBNF of the above grammar is given as,
C)
D1) Given sentence is aaa.
Therefore, it is not in grammar.
D2) Given sentence is ba
Therefore, it is not in grammer.
D3) Given sentence is aab.
Therefore, it is in grammar.
D4)
The given sentence is bab.
Therefore, it is in grammar.
D5)
The given sentence is baaa.
Therefore, it is not in grammar.
D6)
The given sentence is baab.
Therefore, it is in grammar.
Thus, the sentences, D3, D4, and D6 are in grammar.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.