Write regular expressions and grammar

Assignment Help Programming Languages
Reference no: EM133030759

System Programming

Consider a csv file (comma separated values) which contains a header followed by five-tuples
A, B, C, D, E
a1,b1,c1,d1,e1

a2,b2,c2,d2,e2

a3,b3,c3,d3,e3
...

the values in csv file have the description:
ai stands for a row number (integer)
bi stands for a column number (integer)
ci stands for a description string (alphanumeric) which is row-name
di stands for a description string (aphanumeric) which is column-name
ei is the value at row number ai, having row-name ci, and column number bi, having column- name di

This file is to be converted into an HTML table code with usual tags <table>, <thead>,<th>,
<tr>,<td>,<tbody>, and <tfoot>

You need to:

1. Write regular expressions and Grammar for the purpose

2. Use lex and yacc (flex and bison) to generate a translator that reads the csv file and generates the correponding HTML code, if the csv file is in proper format (i.e., header and each row is a 5 tuple, no extraneous/dirty data, and datatypes of values as described), or print appropriate error message.

3. Upload the following:
(a) lex and yacc code files you made
(b) your translator (executable file)
(b) Document explaining you design, code and usage
(c) Input file(s), generated HTML output and screen-shots of the execution

Important: The table may be such that m x 5 table may not have all cells with a value, in such case, <td></td> signifies an empty cell. The row/column numbers in csv file need not be in proper (ascending or right-to-left) order, but will uniquely resolve to a table cell. In case uniqueness is not there (i.e. duplicate specification), an error needs to be flagged.

data.csv (cross check with HTML table carefully to understand the data)

RowNo,ColNo,RowName,ColName,Value 1,1,RowHeader,ColHeader,Y.No 1,2,RowHeader,ColHeader,Year 1,3,RowHeader,ColHeader,January-April 1,4,RowHeader,ColHeader,May-August 1,5,RowHeader,ColHeader,September-December 2,1,,Y.No,1
3,1,,Y.No,2
4,1,,Y.No,3
5,1,,Y.No,4
6,1,,Y.No,5
7,1,,Y.No,6
8,1,,Y.No,7
9,1,,Y.No,8
10,1,,Y.No,9
11,1,,Y.No,10
12,1,ColFooter,Y.No,, 3,2,1,Year,2001-02
4,2,2,Year,2002-03
5,2,3,Year,2003-04
6,2,4,Year,2010-11
7,2,5,Year,2011-12
8,2,6,Year,2012-13
9,2,7,Year,2016-17
10,2,8,Year,2017-18
11,2,9,Year,2018-19
12,2,10,Year,2019-20
2,3,1,January-April,3000 2,5,1,September-December,750.85 3,3,2,January-April,9115 3,4,2,May-August,815 3,5,2,September-December,400 4,4,3,May-August,662 4,5,3,September-December,0.75
5,3,4,January-April,Not Applicable 5,4,4,May-August,190 5,5,4,September-December,2200 7,4,6,May-August,1190 8,5,7,September-December,6133 10,3,9,January-April,510 10,4,9,May-August,Not Applicable 11,4,10,May-August,443 12,2,ColFooter,Year,,
12,3,ColFooter,January-April,Trimester-1 12,4,ColFooter,May-August,Trimester-2 12,5,ColFooter,September-December,Trimester-3

Note that:

1. RowHeader,ColHeader,ColFooter are special names

2. where empty string is meant comma repeats, that is each line is 5-tuple

3. empty cells are not included in file, except if they are in header or footer (this keeps csv short for sparse tables. You might decide to add these as a preprocessing step, but it may actally be unnecessary)

4. Row and Column names can be seen as additional check to verify correct placement of data using row and column numbers. You may, however, sacrifice these for first prototype, but need to include them eventually.

Attachment:- System Programming.rar

Reference no: EM133030759

Questions Cloud

Calculate how much must set aside now : You are the finance manager for Olympia Industries. The company plans to purchase $1,000,000 in new assembly line machinery in 5 years.
Prepare the Asset Register record for the forklift : The forklift was registered for road use with registration no. ABC-123. Prepare the Asset Register record for the forklift
How much revenue is to be recognized : AB regularly sells the products separately. How much revenue is to be recognized if AB delivered 15,000 boxes of chocolate to satisfy the original obligation
Determine the total revenue after the modification : B Corporation has a contract to sell 50,000 boxes of chocolate to a customer for P 20 million or P 400 per boxes. Determine the total revenue after modification
Write regular expressions and grammar : Write regular expressions and Grammar for the purpose - Row and Column names can be seen as additional check to verify correct placement of data using row
What is the yield to maturity on this bond : The Saleemi Corporation's $1,000 bonds pay 7 percent interest annually and have 14 years until maturity. What is the yield to maturity on this bond
Compute Fred gross pay and Regular pay : Fred worked 48 hours during the week. Assume Fred has earned $15,000 year to date. Compute Fred gross pay and Regular pay
Calculate the employment insurance premium : The employee's bi-weekly earnings are $1,250.00. Calculate the Employment Insurance premium for the pay period
How much can you withdraw each year : You have an IRA worth $200,000 and want to start to make equal, annual withdrawals for 15 years. How much can you withdraw each year

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd