
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Subject: Compiler Design
Consider the following grammar and input string,
S → S+S
S → S*S
S → (S)
S → a
Input string: a1*(a2+a3)
Find out the parsing table using shift reduce parsing.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Please help 8. The known Grammar as follows: S à AX X à or AX | ️(epsilon) A à CY Y à and CY | ️(epsilon) C à not C | (S) | 0 | 1 Question C. Please do a stack implementation for strings: (0 or 1) and 1arrow_forwardWrite regular expression for the following languages, alphabet {0,1}a. The set of strings that do not end with 11b. The set of strings that do not contain substring 01c. The set of strings having 0 at every 3rd position.d. Describe the language given by the regular expression 0*10*10*1(1|0)* e. Set ofall strings that are at least of length 4 and contains an even number of 1’s.arrow_forwardhelp fill out the tablearrow_forward
- Use the CYK algorithm to determine whether the strings abb, bbb, aabba andabbbb are in the language generated byS → AB,A → BB|a,B → AB|b.arrow_forwardfrom the following grammar write a program to validate the string fast or fat . A--> fSt S--> as | aarrow_forwardWhat you need to do:1. Type that code up and run it to make sure that it is doing what it is supposed to do. Provide the strings in the header of the program when prompted.2. Use the logic in that program to design your own Recursive Descent parser in C for the following grammar:S →aABA →Abc | bB →d3. Make sure that you choose at least two strings that pass the grammar and one string that does not pass the grammar just like I did in the model program4. Submit both the code and a screen shot of your results for the choice of strings that you provided. Below is the C code that can be used to implement a Recursive Descent parser for the above grammar/* Recursive Descent Parser for the Expression Grammar:S → (L) |aL' →,SL'|εL → SL'Valid inputs: (a,(a,a)) and (a,((a,a),(a,a)))Invalid inputs:(aa,a)*/#include <stdio.h>#include <string.h>int S(), Ldash(), L();char *ip;char string[50];int main() {printf("Enter the string\n");scanf("%s", string);ip =…arrow_forward
- What language does the following grammar generate? Use set notation, English or regular expression to describe it. S->bA | b A->abA | abSarrow_forwardThe following YACC snippet is used to implement a grammar of an expression. The expressions are : E-> E +E E-> E'E E-> id program: program expr '\n' { printf("Kd\n", S2); ) expr: { SS - $1; } i ss - s1- $3; } { $S - $1 - $3; } INTEGER I expr + expr I expr expr Modify the above code to handle the following grammar rules: E-> Add EE E -> Sub EE E-> Mul EE E-> Div EE E-> id, where Add, Sub, Mul, and Div are used to implement Addition, subtraction, multiplication, and division operations respectively.arrow_forwardRE to RG Conversion Please solve....arrow_forward
- d. Write a Lisp program that verifies if a list of symbols is correct from the point of view of this grammar. For example, (check-A '(y w z w y)) (check-A '(y z w w)) should return true (t) and should return false (nil).arrow_forwardDesign a context-free grammar that accepts the language of all binary strings with at most one occurrence of 000. Please type answer no write by hend.arrow_forwardRewrite the grammar so that it is not ambiguous any more. <S> -> <A> <A> -> <A> + <A> | <id> <id> -> a | b | carrow_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