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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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