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

  Discuss the solar eclipse experiment

Discuss the solar eclipse experiment. What is it trying to determine? What does is conclude and imply? Draw an H-R diagram. Be sure to label the axes, the main sequence, and the location of giants and white dwarfs.

  Convergence in recent decades, economic downturn

Despite the general shift towards convergence in recent decades, economic downturn and uncertainty is now likely to lead to greater divergence at the national level and a strengthening of the role of the state.

  Personal values-philosophies or experiences

One's desire to be an advocate is often tied to personal values, philosophies, or experiences. Is there a particular client population or client issue that you envision yourself advocating for?

  Define personality according to various perspectives

Define personality according to various perspectives. Describe Freud's theories of personality parts and the stages of development. Describe the humanistic theory of personality including Carl Roger's views

  Draw a cross-sectional profile of stream channel using excel

Draw a cross-sectional profile of the stream channel using Excel. Label both axes with appropriate units and give it a descriptive title. Take a screen capture and upload this image file to Blackboard Learn.

  Explain the methods and steps in the nursing process

EXPLAIN NURSING PROCESS IN TERMS OF STEPS AND COMPONENTS AND SELECT AND APPLY APPROPRIATE INSTRUCTIONAL MEDIA/ TEACHING AID.

  Brief discussion of the results of their leadership

A detailed description of how the theory applies to this individual's leadership approach (e.g., if choosing transformational leadership, you should analyze and report on idealized influence, individualized consideration, etc.)

  The travel agent

Write short notes on the following (a) The travel agent (b) Carrying capacity (c) The different basics of  market segmentation

  Difference in mean systolic blood pressures

Generate a 95% confidence interval for the difference in mean systolic blood pressures between groups. Generate a 95% confidence interval for the difference in proportions of patients with hypertension between groups

  Write a persuasive speech on why drugs should be leaglized

Write a persuasive speech on why drugs should be leaglized.

  Study and understanding of public policy

Identify two or three academic disciplines, other than political science, that contributes to the study and understanding of public policy. Explain their contribution.

  Discuss the legal ramifications of any legal subjects

Identify and discuss the legal ramifications and violations of any legal subjects and/or decisions related to any constitutional principles and/or administrative agency.

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