Question

Consider the alphabet Σ = {a, b, c, $, #} and let G be the following...

  1. Consider the alphabet Σ = {a, b, c, $, #} and let G be the following grammar, where S is the start symbol.

    S→T
    S → T#S T→E
    T → T$E E→a E→b E→c

    a) Draw a parse tree for a#b#c.

    b) What is the associativity of the # operator? a) left b) right c) neither

c) What is the associativity of the $ operator? a) left b) right c) neither

d) Which operator has higher precedence? a) # b) $ c) neither

e) G is a) left recursive b) right recursive c) both left and right recursive d) neither left nor right recursive

f) G is

a) ambiguous
b) not ambiguous

Homework Answers

Answer #1

Please find the answers below.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Given an alphabet Σ = {a, b, c, d} Use Lecture definition to construct a nondeterministic...
Given an alphabet Σ = {a, b, c, d} Use Lecture definition to construct a nondeterministic automaton M such that L = {w ∈ Σ ∗ : at least one letter from Σ is missing in w} 1. (5pts) Draw the diagram Just draw the diagram, do not list the components 2. (2pts) Explain shortly why your M is nondeterministic and why it is correct 3. (3pts) Show that (s, accabb) `M ∗ (q, e) by constructing a computation of...
1. Assume the following rules of associativity and precedence for expressions: Precedence           Highest                 *
1. Assume the following rules of associativity and precedence for expressions: Precedence           Highest                 *, /, not                               + , - , &, mod                               - (unary)                               = , / = , 6 , 6 = , 7 = , 7                               and Lowest                              or, xor Associativity         Left to right Assume the only operands are the names a,b,c,d, and e. Write a BNF description of the precedence and associativity rules defined for such expressions.
Assume the following rules of associativity and precedence for expressions: Precedence: Highest *, /, not+, –,...
Assume the following rules of associativity and precedence for expressions: Precedence: Highest *, /, not+, –, &, mod– (unary)=, /=, < , <=, >=, >and Lowest or, xor Associativity Left to right Show the order of evaluation of the following expressions by parenthesizing all subexpressions and placing a superscript on the right parenthesis to indicate order. For example, for the expression a + b * c + d the order of evaluation would be represented as: ((a + (b *...
Given the following grammar and the right sentential form, draw a parse tree and then specify...
Given the following grammar and the right sentential form, draw a parse tree and then specify and write the phrases, simple phrase(s), and the handle. Grammar: S → AbB | bAc A → Ab | aBB B → Ac | cBb | c Sentential form: AbcacAbcbccb
Consider permutations of the 26-character lowercase alphabet Σ={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}. In how many of these permutations do a,b,c...
Consider permutations of the 26-character lowercase alphabet Σ={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}. In how many of these permutations do a,b,c occur consecutively and in that order? In how many of these permutations does a appear before b and b appear before c?
Question 1 Consider the following grammar G: S ➝ A B C | A C |...
Question 1 Consider the following grammar G: S ➝ A B C | A C | A | B A ➝ a B B ➝ b C | a C ➝ c D D ➝ d A Recall that a non-terminal A is reachable if there is a derivation starting from S in which A appears: S ⇒* x A y holds for some x and y which are sequences of terminals and non-terminals (possibly empty). For example, if there...
Given the following grammar G = (V, T, S, P) where S is the starting symbol....
Given the following grammar G = (V, T, S, P) where S is the starting symbol. (1) S → aS (2) S → aD (3) D → bD (4) D → λ (a) Give two strings of different lengths that are generated from G (b) Give two strings that cannot be generated from G (c) What is the language generated by G, that is L(G)
Let f : A → B and g : B → C. For each of the...
Let f : A → B and g : B → C. For each of the statements in this problem determine if the statement is true or false. No explanation is required. Just put a T or F to the left of each statement. a. g ◦ f : A → C b. If g ◦ f is onto C, then g is onto C. c. If g ◦ f is 1-1, then g is 1-1. d. Every subset of...
SYMBOLIC LOGIC QUESTION- Translate the following sentences into symbolic logic notation. 1.Unless c is to the...
SYMBOLIC LOGIC QUESTION- Translate the following sentences into symbolic logic notation. 1.Unless c is to the right of a, it is small. 2. a is large if and only if it’s a cube that is to the left of b. 3. a is to the left or right of d if it’s not a cube. 4. If b and d are cubes, then either a or c is a tetrahedron. 5. e is a tetrahedron if and only if it...
Consider the proposed two-step reaction mechanism: A + B + C → D (slow) D →...
Consider the proposed two-step reaction mechanism: A + B + C → D (slow) D → A + E (fast) Which statements regarding this mechanism are true? C. A is an intermediate because it is neither produced nor consumed during the chemical reaction. B. A is a catalyst because it is produced in one step in the mechanism and consumed in a subsequent step. E. D is an intermediate because it is produced in one step in the mechanism and...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT