Concepts Of Programming Languages
12th Edition
ISBN: 9780134997186
Author: Sebesta, Robert W.
Publisher: Pearson,
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 3, Problem 10PS
Explanation of Solution
Consider the following grammar:
<S> -> <A><B><C>
<A> -> a <A> | a
<B> -> b <B> | b
<C> -> c <C> | c
In the given case, <A><B><C> generates all sentences which consists one or more than one a's followed by one or more than one b's followed by one or more than one c's.
<A> generates one or more than one consecutive a's.
<B> generates one or more than one consecutive b's.
<C> generates one or more than one consecutive c's...
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Describe, in English, the language defined by the following grammar:<S> → <A> <B> <C><A> → a <A> | a<B> → b <B> | b<C> → e
1a. Fill out the following blanks to make it a context-free grammar for the given language over the alphabet {a, b}:
1b. Fill out the following blanks to make it a context-free grammar for the given language:
Describe the language defined by the following grammar:
<S> à <A> <B> <C>
<A> à a <A> | a
<B> à b <B> | b
<C> à c <C> | c
Chapter 3 Solutions
Concepts Of Programming Languages
Ch. 3 - Prob. 1RQCh. 3 - Prob. 2RQCh. 3 - Prob. 3RQCh. 3 - Prob. 4RQCh. 3 - Prob. 5RQCh. 3 - Prob. 6RQCh. 3 - Prob. 7RQCh. 3 - Prob. 8RQCh. 3 - Prob. 9RQCh. 3 - What is the difference between a synthesized and...
Ch. 3 - Prob. 11RQCh. 3 - Prob. 12RQCh. 3 - Prob. 13RQCh. 3 - Prob. 14RQCh. 3 - Prob. 15RQCh. 3 - Prob. 16RQCh. 3 - Prob. 17RQCh. 3 - Prob. 18RQCh. 3 - Prob. 19RQCh. 3 - Prob. 20RQCh. 3 - Prob. 21RQCh. 3 - What does partial correctness mean for a loop...Ch. 3 - Prob. 23RQCh. 3 - Prob. 24RQCh. 3 - Prob. 25RQCh. 3 - Prob. 26RQCh. 3 - Prob. 27RQCh. 3 - Prob. 28RQCh. 3 - Prob. 29RQCh. 3 - The two mathematical models for language...Ch. 3 - Write EBNF descriptions for the following: a. A...Ch. 3 - Prob. 3PSCh. 3 - Prob. 4PSCh. 3 - Prob. 5PSCh. 3 - Prob. 6PSCh. 3 - Prob. 9PSCh. 3 - Prob. 10PSCh. 3 - Prob. 12PSCh. 3 - Prob. 15PSCh. 3 - Prob. 16PSCh. 3 - Prob. 17PSCh. 3 - Prob. 18PSCh. 3 - Compute the weakest precondition for each of the...
Knowledge Booster
Similar questions
- Define denotational semantics for the language of octal (base 8) numerals. Use the definition to find the value of “752”. You must define M_dec as a semantic function that maps syntactic objects written as octal numbers (with no decimal points, i.e., no fractions) to a set of non-negative decimal integer values. For Example, given the octal string “752” then: M_dec(“752”) would return 490 as its equivalent decimal value.arrow_forwardProvide the rules for context-free grammars that generate the following languages. L5 = {aibjck | i, j, k ∈ Znonneg, j 6= i + k}arrow_forwardThe following shows a simple context free grammar (CFG) : Which of the following sentences are recognized by this grammar: 5+9+5, 2+8*(4*9)*4*(7+6), 3+7-2arrow_forward
- Problem 3 Design context-free grammars for the following languages: a) The set {a^i b^j c^k| i does not equal j or j does not equal k}, that is, the set of strings of a’s followed by b’s followed by c’s, such that there are either a different number of a’s and b’s different number of b’s and c’s, or both. b) The set of strings over 0 and 1 with “even” length.arrow_forwardWhat is the purpose of normalization? Construct the CNF and GNF for the following grammar and explain the steps. S→aAa | bBb |€ A→C|a B→C|b C→CDE | € D→A|B|ab.arrow_forwardGiven Σ={a,b}, Create a Context-Free Grammar for each of the following language a. Language with a string such that number of a is twice the number of b. b. {a^n b^n c^m d^m,n,m≥0} c. {a^n b^m where n>m}arrow_forward
- Topic: Concepts of programming Language For the following grammar, draw the parse tree of aaAbBbS → aAb|bBA A → ab|aAB B → bB|barrow_forwardTopic: Compiler Construction Syntax Analysis Show that the grammarA → −AA → A − idA → idis ambiguous by finding a string that has two different syntax trees.Now make two different unambiguous grammars for the same language:a) One where prefix minus binds stronger than infix minus.b) One where infix minus binds stronger than prefix minus.Show the syntax trees using the new grammars for the string you used to prove theoriginal grammar ambiguous.arrow_forwardWrite a BNF grammar for simple phone numbers e.g. (9)123-4567 (21)987-1234 The number must start with a left parenthesis, followed by 1or 2 digits, followed by a right parenthesis, followed by 3 digits, followed by a hyphen, followed by 4 digits. All digits, including 0, can be used anywhere a digit is required. There must be at least 3 rules in your grammar. The goal non-terminal should be called <phone>.arrow_forward
- a) Identify the Following productions whether they are CFG, CSG or Unrestricted Grammar (2)a. abB → bbb. Ac → CCc. A → aAd. Bs → ε b) Construct CSG for the language, L = {1p 2p 3p | where p ≥ 1} c) Construct LBA for the language discussed in PART (b) Please solve the above three parts, Thank you :)arrow_forwardDescribe in English, the language defined by the following grammar.<S> → <X> + <Y><X> → x <X> | x<Y> → y A.It means that one x followed by a plus and one y. B.It means that one x followed by a plus and one or more y. C.It means that one or more x followed by a plus and one or more y. D.It means that one or more x followed by a plus and one y.arrow_forwardDesign a context-free grammar for the following language. Use S as the start variable. Explain your CFG in brief (in not more than 3 sentences). L={w∈{a,b,c}^*:w=(a^p)(b^q)(c^r),p,q, r>0, p=2r+1, q is divisible by 3}arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education