Question: Q1: Create a context free grammar for the code which contains the following syntax: (Requirement: its not a programing task student you have to create

Q1: Create a context free grammar for the code which contains the following syntax:

(Requirement: its not a programing task student you have to create a CFG of the given possibility of code that can be in any programing language)

1: Program block (like, main ())

2: Variable declaration statement (at least accepts any four data types with arrays)

3: At least one looping statement

4: At least one decision statement

5: Expression Statement

6: Function declaration and definition

Q2: Create CLR Parser for the CONTENT FREE GRAMMER that you made in Q1 from above code.

Q3: Use any sample code according to the developed CONTENT FREE GRAMMER and generate a stack table to validate the code.

Hint:

First you have to create code of the 6 given possibilities in any programming language then this code will be converted into CFG then student you have to create CLR PARSER for the CONTENT FREE GRAMMER then you have to make another dummy code then validate it through stack table according to CFG created in Question 1.

All question with Link each other

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!