Question

Question #1: The BNF grammar rule A-> B C means A can be replaced by one or more Bs, followed by one or more Cs A can be replaced by one B, optionally followed by one C A can be replaced by one B, followed by zero or more Cs can be replaced by one B, followed by one C A can be replaced by either one B or one C

programming languages

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

Option 4 correct.

A ->BC

  • It means A can be reolaced by the one B foolowed by one C
  • It meas replace A whenever exist with the BC
  • If it is A ->BC* means B followed optionally C.
Add a comment
Know the answer?
Add Answer to:
programming languages Question #1: The BNF grammar rule A-> B C means A can be replaced...
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
  • Give a context free grammar for the language L where L = {a"bam I n>:O and...

    Give a context free grammar for the language L where L = {a"bam I n>:O and there exists k>-o such that m=2"k+n) 3. Give a nondeterministic pushdown automata that recognizes the set of strings in L from question 3 above. Acceptance should be by accept state. 4. 5 Give a context-free grammar for the set (abc il j or j -k) ie, the set of strings of a's followed by b's followed by c's, such that there are either a...

  • Research to write down the rule of a variable identifier in the following programming languages and...

    Research to write down the rule of a variable identifier in the following programming languages and write down the regular grammar for that rule. For example, as elaborated in the class, the rule of a variable identifier in C is "start either by_, or any alphabetic character, and then follow either by_, any alphabetic character, or number", and its regular grammar is: La-zA-Z][a-zA-ZO-9]* a. JavaScript i. Rule: ii. Regular grammar b. PHP i. Rule: ii. Regular grammar: c. Python i....

  • 1. Give a context-free grammar for the set BAL of balanced strings of delimiters of three...

    1. Give a context-free grammar for the set BAL of balanced strings of delimiters of three types (), and . For example, (OOis in BAL but [) is not. Give a nondeterministic pushdown automata that recognizes the set of strings in BAL as defined in problem 1 above. Acceptance should be by accept state. 2. Give a context free grammar for the language L where L-(a"b'am I n>-o and there exists k>-o such that m-2*ktn) 3. Give a nondeterministic pushdown...

  • 2. Research to write down the rule of a variable identifier in the following programming languages...

    2. Research to write down the rule of a variable identifier in the following programming languages and write down the regular grammar for that rule. For example, as elaborated in the class, the rule of a variable identifier in C is "start either by or any alphabetic character, and then follow either by_, any alphabetic character, or number", and its regular grammar is: [_a-zA-2] [a-zA-ZO-9]* a. JavaScript i. (5 points) Rule: Solution: ii. (5 points) Regu grammar: Solution: b. PHP...

  • (8) (3 marks) Write BNF grammar rules for a language that is comprised only of sentences described as follows: symbol,...

    (8) (3 marks) Write BNF grammar rules for a language that is comprised only of sentences described as follows: symbol, fol symbols orjust onéx symbol, A sequence of one or more occurrences of an a lowed by either zero or morez followed by a sequence of one or more b symbols. (9) (1 mark) The following fragment of grammar describes the syntax of the exponentiation operator. What is the associativity ot the operator as detined here? factor | expr factor...

  • Question 3 Give a context-free grammar for each of the following languages over = {a,b,c}. 1....

    Question 3 Give a context-free grammar for each of the following languages over = {a,b,c}. 1. {a^jen: n >0}. 2. {animck : k=n+m} 3. Strings of a's and b's that contain twice as many a's as b's (for example, aba).

  • 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.

  • 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" |...

  • Part C Only Let Σ = {a,b}. For each of the following languages, find a grammar...

    Part C Only Let Σ = {a,b}. For each of the following languages, find a grammar that generates it. (a) Li {a"6" : n > 0,m< n}. (b) L2 = {ang 2n: n > 2). (c) L3 {an+35" : n > 2}.

  • 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.

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