Question

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

Homework Answers

Answer #1

1.The Parse tree for the right Sentential form: AbcacAbcbccb for the given grammar is:

The Parse Tree is as follows:

2.Phrases is a subsequences of a sequential form that is eventually reduced to a single non-terminal.

Phrases of a parse tree are:

AbcacAbcbccb, cacAbcbccb, acAbcbc, cAbcb, Abc, Ab, c.

3.A simple phrase is a phrase that is reduced in a single step.

Simple Phrase(s) are:

Ab, c

4.The handle is the left-most simple phrase.

Handle are:

Ab

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
Ex#5: Given the following grammar for a simple assignment statements. <assign> --> <id> = <expr> <id>...
Ex#5: Given the following grammar for a simple assignment statements. <assign> --> <id> = <expr> <id> --> A | B | C <exp> --> <id> + <expr> | <id> * <expr> | (<expr>) | <id> Show a leftmost derivation and a parse tree of the following statement: A = A *(B + (C * A))
Assignment-I Do the Lexical Analysis and draw the parse tree in the syntax analysis for the...
Assignment-I Do the Lexical Analysis and draw the parse tree in the syntax analysis for the following source code statement                        “ Sum : = PI + r1 * r2*80 “ Draw the transition diagram and transition table for NFA that recognizes the language:                     (a | b)* aabbb If x and y are strings ; write the answers for the following if x=”Hello” and y=”Welcome” : x2y4= xy2  =   x5 y.epsilon =
10. Draw and decorate the parse tree for the following Attribute Grammar for the following statement:...
10. Draw and decorate the parse tree for the following Attribute Grammar for the following statement: word = 2.0 ∗ (5 − 10) *** Assign is your STARTING SYMBOL Assign =: identifier = Expr Expr =: Expr + Term | Expr - Term | Term Term =: Term * Factor | Term / Factor | Factor Factor =: "(" Expr ")" | integer | float | identifier Assign =: identifier = Expr [ identifier.value <= Expr.value ] Assign =: identifier...
1. Draw a GTG (generalized transition graph) for the following right-linear regular grammar. S -> abA...
1. Draw a GTG (generalized transition graph) for the following right-linear regular grammar. S -> abA A -> baB B->aA | bb a)  Find a left-linear grammar for the language in the previous question.
Convert the grammar G = ({S,A,B,C},{a,b},P,S), where P is given below, into the Chomsky Normal Form....
Convert the grammar G = ({S,A,B,C},{a,b},P,S), where P is given below, into the Chomsky Normal Form. S −→ AaA | AB A −→ BB | bAA | ε B −→ bS | b | ε
QUESTION 1 Specify the general form of the equation for each of the following models: a....
QUESTION 1 Specify the general form of the equation for each of the following models: a. A simple regression model within the OLS framework b. A multiple regression model within the OLS framework c. The three equations of the ADF test of unit root
Draw the predominate form(s) of tyrosine at the following pH values a. pH 5.0 b. pH...
Draw the predominate form(s) of tyrosine at the following pH values a. pH 5.0 b. pH 10.0 c. pH 10.9
Write a BNF grammar for a new language called 4040. It should include the following rules:...
Write a BNF grammar for a new language called 4040. It should include the following rules: Variable definitions should start with var. There must be only single space after var. Variable names should come after the var and single space. Variable names should start with a letter or underscore(_). Starting with a digit is not allowed. Variable names can have digits after the first letter. There can be multiple variable names separated by comma. Between variables, spaces are allowed. There...
Given the following, calculate the total conductance (or resistance as specified) in the following configurations. Draw...
Given the following, calculate the total conductance (or resistance as specified) in the following configurations. Draw an element combination diagram of the pathways in each case (combinations of elements as we discussed in class). g1 = 1 mol m-2 s -1 g2 = 2 mol m-2 s -1 g3 = 3 mol m-2 s -1 r4 = 0.25 m 2 s mol-1 (note the last one is specified as a resistance) a) the conductance of g1 and g2 in series...
1. Write the following sets in list form. (For example, {x | x ∈N,1 ≤ x...
1. Write the following sets in list form. (For example, {x | x ∈N,1 ≤ x < 6} would be {1,2,3,4,5}.) (a) {a | a ∈Z,a2 ≤ 1}. (b) {b2 | b ∈Z,−2 ≤ b ≤ 2} (c) {c | c2 −4c−5 = 0}. (d) {d | d ∈R,d2 < 0}. 2. Let S be the set {1,2,{1,3},{2}}. Answer true or false: (a) 1 ∈ S. (b) {2}⊆ S. (c) 3 ∈ S. (d) {1,3}∈ S. (e) {1,2}∈ S (f)...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT