Produce the collection of sets of lr

Assignment Help Computer Engineering
Reference no: EM131265622

Assignment - cparse

Your assignment is to read in a start symbol of a set of productions followed by the set of productions from stdin and produce the collection of sets of LR(0) items to stdout. An example input file is given on the next page and is in the ˜cop4020p/LIB/proj3/cparse.in file. The program makes the following assumptions about the input.

(1) The start symbol is the first character on the first line.

(2) Productions start at the beginning of each of the following lines and are of the form N->rhs, where N is a non-terminal and rhs is a string of non-terminals and terminals. A "|" representing alternative rhs's is not allowed.

(3) A non-terminal is a single uppercase letter.

(4) A terminal is a single character that is not an uppercase letter, "@", or a "'".

The output consists of two parts. First, the augmented grammar should be printed. Next, the sets of LR(0) items will be printed. An example output file is given on the next page and is in the ˜cop4020p/LIB/proj3/cparse.out file. The form of your output should match my output exactly, which will facilitate grading.  The program makes the following assumptions about the output.

(1) The position is represented with a "@".

(2) The augmented grammar start symbol is represented by a "'".

(3) A set of items is represented by the form I#, where # is a number.  Sets are numbered starting from zero. 

(4) The size of an item is no more than 20 characters (including a NULL character).

You can use the following printf strings to format your output:

"I%d:\n" - set of items number

" %-20s goto(%c)=I%d\n" - item with a goto

" %-20s\n" - item without a goto

You may not assume any limit to the number of productions, items in a set, or the number of sets.

Submit your *single* source file cparse.c (or cparse.cpp) using the following submit.sh command on

shell.cs.fsu.edu

% submit.sh deliverables.sh

Attachment:- Project Assignment.rar

Reference no: EM131265622

Questions Cloud

State the six management functions : 1. A primary responsibility of any manager is to monitor change. How do managers monitor change? Please be specific. 2. State the six (6) management functions and how each plays a role in a manager's daily routine?
Overcoming stage fright team : Discuss the previous questions as a class. - Then, in groups of three or four talk about ways to overcome these fears.
Analyse challenges in accounting facing the industry : Analyse challenges in Accounting facing the industry using quantitative and qualitative analytical tools - write a detailed analysis of the strengths and limitations of your entire project
Calculate the phase current in the second machine : Two star-connected generators are connected in parallel and supply a balanced load of 1500 kVA at 11 kV line voltage and 0.8 lagging power factor.
Produce the collection of sets of lr : COP 4020 Assignment - cparse. Your assignment is to read in a start symbol of a set of productions followed by the set of productions from stdin and produce the collection of sets of LR(0) items to stdout. An example input file is given on the nex..
The amount to be reported as an investment in helbert stock : On January 1, Zabel Corporation purchased a 25% equity in Helbert Corporation for $181,000. At December 31, Helbert declared and paid a $47,000 cash dividend and reported net income of $176,800. Journalize the transactions. Determine the amount to be..
Problem regarding the friedman assessment : After watching the video, The World Is Flat, discuss whether or not you agree with Friedman's assessment that the world is flat. While there is no correct answer to this question, you must justify your point of view.
Determine the output torque of the prime-mover : A 3-phase hydroelectric synchronous generator is read to be 110 MW, 0.8 pf lagging, 6-kV, Y- connected, 50 Hz, 100-rpm.
Explain the type of direct reading instrument : Discuss the type of direct reading instrument that you would need to use as part of an OSHA compliant confined space atmospheric testing program.

Reviews

len1265622

11/4/2016 4:44:35 AM

The due date for the project will be announced in blackboard course website. A grade of zero will be recorded for missed exams and late assignments unless prior arrangements are made. Assignments turned in after the due date, but by the beginning of the next schedule class will be penalized 10%. Assignments will not be accepted that are more than one class period late.

Write a Review

Computer Engineering Questions & Answers

  Rsa cryptosystem

Assume that we tried to simplify the RSA cryptosystem by making use of just a prime p in place of the composite modulus N = pq. As in RSA, we could have an encryption exponent e which is relatively prime to p − 1.

  Prepare a set of nonfunctional requirements

Prepare a set of nonfunctional requirements, including operational requirements, performance requirements, security requirements, and cultural and political requirements. Much information is incomplete, but do your best.

  Define a way to insert a row

How do I insert a row in multiple tables on different sheets in the similar workbook? I have 12 sheets, one for every month, and the sheets are exactly the same. Is there a way to insert a row and value on one sheet and have this apply to all sheet..

  Explain time and space complexity in details

What do you mean by performance of algorithm explain time and space complexity in details?

  Design microcontroller-based string matching detector

how you would design this microcontroller-based string matching detector. Which peripherals would you be using? What considerations would you take into account?

  Assume that some nodes in an n-node binary tree

Consider an n-element list in an n-processor EREW parallel random-access machine, where some elements of the list are marked as being blue. define an efficient parallel algorithm to form a new list consisting of all the blue elements.

  Advantages of technologies

List some of the advantages of some of current technologies explained in our reading this week involving VoIP, Virtual Private Networks, Unified Communications, Wi-Fi and wireless technologies such as RFID.

  Take a position on the idea of ipv6 being hailed as the

take a position on the idea of ipv6 being hailed as the next generation of the internet. support your response with

  Imagine you are asked to head a non-computerized department

Now assume you would like to connect the internal network you devised in Q1 to the outside world. What are the steps you consider to follow? And what are the additional equipment/software you would purchase and why?

  What are three levels of concurrency in programs

can someone please explain to me what are the three levels of concurrency in programs.

  How did you benefit from taking algebra class

How did you benefit from taking algebra class? how you will apply this method in your life? How has your perception of WAN technology changed as a result of what you have studied in this course?

  Write a short memo explaining the concept to your boss

Using the Web, investigate the term, virtual desktop infrastructure (VDI). Write a short memo explaining the concept to your boss.

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