Question

1. (15 pts) Consider the following BNF grammar: For each of the strings below, indicate whether or not the string can be derived from the grammar. ?f so, provide a derivation. (a) (5 pts) aabccd (b) (5 pts) accbcc (c) (5 pts) acccce

0 0
Add a comment Improve this question Transcribed image text
Answer #1

abcc Because e <Bzs and we dont need accbcc Tere is no way that a tingle 、a and terebebblw cs. acCcCC e- Dehivation svenabove

Add a comment
Know the answer?
Add Answer to:
1. (15 pts) Consider the following BNF grammar: For each of the strings below, indicate whether...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 1 Consider the following BNF grammar: Not complete Marked out of 3.00 p Flag question...

    Question 1 Consider the following BNF grammar: Not complete Marked out of 3.00 p Flag question <letter> ::= "a" | "b" | "C" | "d" | "e" | "F" | "g" | "h" | "1" ";" | "K" | "1" | "m" | "n" | "0" | "p" | "q" | "r" | "S" | "t" || "u" | "V" | "W" | "x" | "y" | "z" <digit> ::= "O" | "1" | "2" | "3" | "4" |...

  • Consider the following BNF grammar: S ::= A x | B y A ::= B y...

    Consider the following BNF grammar: S ::= A x | B y A ::= B y | C w B ::= x | B w C ::= y Which of the following regular expressions describes the same set of strings as the grammar? 1. xwxy + xww∗y + ywx 2. xwx + xww∗y + yw 3. xw∗y + xwxyx + ywx 4. xwy + xw∗xyx + ywx 5. xw∗y + xw∗yx + ywx 6. none of the above 7. all...

  • 1. For the following grammar: a) Give an example of a string accepted by the grammar. b) Give an ...

    Theory of Computation need ASAP 2-3 hours 1. For the following grammar: a) Give an example of a string accepted by the grammar. b) Give an example of a string not accepted by the grammar. c) Describe the language produced by the grammar. 2. Using the following grammar find a derivation for the string: 0001112 A0A1le C 0C2 | D Create a grammar for the language described by the following RE: Create a grammar for the following language: For the...

  • Recursive Descent Parsing Consider the following BNF grammar: A -> I = E E -> P...

    Recursive Descent Parsing Consider the following BNF grammar: A -> I = E E -> P O P | P O -> + | - | * | / | ** P -> I | L | UI | UL | (E) U -> + | - | ! I -> C | CI C -> a | b | ... | y | z L -> D | DL D -> 0 | 1 | ... | 8 |...

  • NEED THIS SOON. Recursive Descent Parsing Consider the following BNF grammar: A -> I = E...

    NEED THIS SOON. Recursive Descent Parsing Consider the following BNF grammar: A -> I = E E -> P O P | P O -> + | - | * | / | ** P -> I | L | UI | UL | (E) U -> + | - | ! I -> C | CI C -> a | b | ... | y | z L -> D | DL D -> 0 | 1 | ......

  • Consider the following BNF grammar that we saw in class:        EXP    ::= EXP + TERM  ...

    Consider the following BNF grammar that we saw in class:        EXP    ::= EXP + TERM   | EXP - TERM    | TERM        TERM   ::= TERM * FACTOR | TERM / FACTOR | FACTOR        FACTOR ::= ( EXP ) | DIGIT        DIGIT ::= 0 | 1 | 2 | 3    (a) Translate into EBNF.    (b) Draw syntax diagrams.    (c) What are the two requirements on a grammar for a predictive parser to be able to...

  • 1. Who are language descriptions intended for? Consider the following grammar: ab b | b a...

    1. Who are language descriptions intended for? Consider the following grammar: ab b | b a | a Which of the following sentences are in the language generated by this grammar? (DONE) a) baab ==> YES b) bbbab ==> NO c) bbaaaaaS ==> NO d) bbaab ==> YES 2. Write a BNF grammar for the language consisting of binary strings (any combination of 0s and 1s) of at least 2 digits.

  • For both of the following languages, provide a grammar that generates it, an intuitive explanatio...

    Please actually answer it For both of the following languages, provide a grammar that generates it, an intuitive explanation why this grammar generates this language, and a graphical representation of a push-down automaton that recognizes this language. (a) The language of properly nested sets of parentheses over the alphabet G)). Note that the string (COO))) belongs to this language, while the string (O) () does not because the third closing parenthesis does not have a matching opening parenthesis. Provide a...

  • Question Set 2 1. Given the following grammar dactor>-> ( <expr> ) a) What is the...

    Question Set 2 1. Given the following grammar dactor>-> ( <expr> ) a) What is the associativity of each of the operators? What is precedence of the operators? Show a leftmost derivation and parse tree for the following sentence: b) c) A-A(B(C A)) d) Rewrite the BNF grammar above to give precedence over and force to be right associative.

  • nsider the following grammar: tate in your own words what kinds of sentences (strings) these productions...

    nsider the following grammar: tate in your own words what kinds of sentences (strings) these productions describe. ive 3 examples of valid strings, and 3 examples of invalid strings, according to the gra rite a lexical analyzer (scanner) program for this BNF. (20 points) This scanner should prompt the user to input a string, then output a list of tokens a line, from the input string according to the above grammar. If something is "wrong should output an error message...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT