Produce the collection of sets

Assignment Help Other Subject
Reference no: EM131306637

- 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 nonterminal and rhs is a string of nonterminals and terminals. A "|" representing alternative rhs's is not allowed.

(3) A nonterminal 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

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.

- Below is an example input file (cparse.in).
E
E->E+T E->T T->T*F
T->F
F->(E) F->i

- The following output will appear when the above program is input to ~uh/cs450exec/cparse.exe on onyx as follows.

% cparse.exe < cparse.in

Below is the corresponding example output file (cparse.out).

Attachment:- Augmented Grammar.rar

Reference no: EM131306637

Questions Cloud

What is the cost-benefit ratio of this training : A program has an annual cost of $70,000 and is expected to generate in return a savings of $80,000. When would the break-even point occur, given steady savings and costs?Why is it important for trainers to be able to estimate the ROI, cost-benefi..
Discuss concept of leadership and importance of leadership : Discuss concept of leadership and the importance of leadership, and explain why you selected the style you chose for your leader. Discuss appropriateness or inappropriateness of the style exhibited by the leader you selected.
Community efforts and managing public relations : Community Efforts and Managing Public Relations (PR)" Please respond to the following: You are a new PR intern at Apple. Apple is donating 200 iPads to a local inner-city school to promote technology in education.
Describe how writers chose to express themselves : How writers chose to express themselves. Elements of style include word choice, sentence construction, and clarity. Style elements can vary according to the audience and purpose of the writing.
Produce the collection of sets : COP 4020 - 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.
Comment on mia and jasons decision : Comment on Mia and Jason's decision not to provide the information underlying their cash flow statement. What potential problems could result from their decision?
What plies in the panel contain group 2 species : How are the species of wood used in the fabrication of plywood classified?
What if immigrants did not embrace american life and culture : What continuities and what discontinuities (similarities and differences) can you see between this nineteenth century apprehension about immigrants and the attitudes of many people towards immigrants today?Is there anything you think we can or sho..
How is equilibrium interest rate determined in bond market : How is the equilibrium interest rate determined in the bond market? Explain why the interest rate will move toward equilibrium if it is temporarily above or below the equilibrium rate.

Reviews

Write a Review

Other Subject Questions & Answers

  Real world consumption activities

Aiscusses your own consumption practices over the last ten years. List and explain the ways that online consumption activities have replaced or modified your real world consumption activities.

  Major change in political culture related issues

Explain the relevance of this statement to a major change in political culture.

  Complex issue of ageism in the workplace

The purpose of this discussion is to give you the opportunity to apply ethical theories to the complex issue of Ageism in the workplace, particularly in the area of employment.

  Analyze issues involved in controlling costs for disabled

Analyze the issues involved in controlling costs for disabled and chronically ill employees. Discuss two major challenges and recommend two strategies your agency will implement.

  How can sound science and the scientific method be used to

how can sound science and the scientific method be used to help evaluate and solve an environmental issue? give 1

  Question 1tourism by its very personality is considered to

question 1tourism by its very personality is considered to be a fragmented business where its development and

   marketing elements that distinguish services from products

Identify and explain the four (4) marketing elements that distinguish services from products. No copy and paste garbage, all answers must be original! If not orginial than don't waste your time or my time because I will get points back!

  Reasons behind the growth in services

Mention and discuss at least five of the reasons behind the growth in services. Which of these do you consider to be the most important? Why?

  Develops the defense mechanism of dissociation

Discuss how an individual might develops the defense mechanism of dissociation. Relate this to early childhood experience and list everyday occurrences of dissociation that are not considered abnormal

  Theories of crime causation

For this Assignment, you will be examining the major theories of crime causation. Write a minimum of 5 pages supporting why crime occurs according to certain theories.

  Discussion-evaluating twelve-step programs

The twelve-step program has been a cornerstone of substance abuse treatment for decades. Proponents and opponents of the twelve-step program debate its effectiveness at treatment of substance addiction. These programs are typically supplements to ..

  Explore the stereotyping and communication problems

How can managers overcome obstacles to diversion such as mistrust and tension, stereotyping, and communication problems?

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