Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following is a specification for a very simple programming language. Stmt Iist Stmt | Stmt_list ; Stmt Stmt Variable assignop Expression Variable id I

image text in transcribed
image text in transcribed
The following is a specification for a very simple programming language. Stmt Iist Stmt | Stmt_list ; Stmt Stmt Variable assignop Expression Variable id I id [Expression] Expression Simple expression | Simple_expression relop Simple expression Simple expression Term I Simple_expression addop Term Term Factor | Term mulop Eactor Factor id I num | (Expression) | id [Expression] | not Eactor 1. Write a program demonstrating the capability of the given specification. Name this file yourname-input.txt. [10] 2. Create a parser for this language using Flex and Bison, and give the file created for the previous question (1) as input to it. Given that the file is correct as per the specification. your parser should be able to parse it successfully. Your parser should either say "parsed" or "error" upon completion. No further details are required. [10] 3. Create 3 erroneous versions of your input file (yourname-error1.txt, yourname-error2.txt, yourname-error3.txt) such that your parser gives an error. [5] Submission guideline Submit the following - You Flex file - Your Bison file - Your make file - Your correct input file and screenshot proving it parses correctly - Your incorrect input files (3) and screenshot(s) proving that your parser catches the error

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

How is the mating type of a yeast cell determined?

Answered: 1 week ago