Consider the following grammar.
S → ( S )
S → x
Which of the following statements is (are) true?
S → ( S )
S → x
I. The grammar is ambiguous.
II. The grammar is suitable for top-down parsing.
III. The grammar is suitable for bottom-up parsing.
(A) I only (B) II only (C) III only (D) II and III only (E) I, II, and III
1
Expert's answer
2013-01-30T08:11:05-0500
It's ambiguous, because for any word we have only one wayto create it. Example: ((((x)))){S->(S),S->(S),S->(S),S->(S),S->x} It isn't suitable for top-down parsing, because by termsto use we must have either grammar only as A->a or only as A->ab, but not A->aAb (a="(", b=")" ) So answer is (A), because II doesn't suit.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment