Midterm 4 Practice Questions
11 flashcards · Other · by Logan Pollack
Let L(G) be the language of all strings consisting of zero or more a’s
Let L(G) be the set of strings consisting of one or more a’s with a comma between each a and the next.
Let L(G) be the set of all strings consisting of one or more digits 0 – 9
Given: Write the parse tree for the expression "a + b"
Is the following grammar ambiguous?
Yes, you can make multiple parse trees
Is the following grammar ambiguous?
Yes
Is the following grammar ambiguous?
No
Let L(G) be the set of all strings that start with an a followed by zero or more b’s and end with the character c. Design grammar G.
Given the following grammar Q: Q: <A>* ::= <A> @ <A> | * What are some of the strings in L(Q)?
Given: Do the following statements belong to this grammar? s = 1 + 2 * 3 s = (1 + 2) * 3 s = a + 3