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

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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