Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Homework Help/Study Tips Expert

- 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

Homework Help/Study Tips, Others

  • Category:- Homework Help/Study Tips
  • Reference No.:- M92061268

Have any Question?


Related Questions in Homework Help/Study Tips

Primary task response within the discussion board area

Primary Task Response: Within the Discussion Board area, write 400-600 words that respond to the following questions with your thoughts, ideas, and comments. This will be the foundation for future discussions by your cla ...

Question two paragraphs eachseparate responds1the role of a

Question: Two paragraphs each Separate responds 1. The Role of a Systems Analyst" Please respond to the following: Use the Internet to research the role of a systems analyst. Next, imagine you're taking your first set of ...

Tpic health information technology and emrassignment

TOPIC: Health information technology and EMR Assignment . Roots of Organizational Policy The Comprehensive Final Project has been designed for the student to identify federal and state policy roots in a specific health s ...

Question after reading chapter 8 in the text and viewing

Question: After reading Chapter 8 in the text and viewing the Fixed, Variable, and Marginal Cost video, address the following in your initial post: • First, describe several different fixed costs and variable costs assoc ...

Question utilize the topic 6 readings to create a

Question: Utilize the Topic 6 Readings to create a PowerPoint presentation of five to six slides on the Progressive Era. Be sure to cite and reference all sources. Include slide notes in your presentation slides. Additio ...

Question what are the principles of the compstat strategic

Question : What are the principles of the CompStat strategic management process? Discuss crime rates in New York City before and after CompStat was implemented. Discuss the advantages of the CompStat paradigm. Your respo ...

Overviewthis course has three written assignments that

Overview This course has three written assignments that build upon one another and are designed to take you step-by-step through a process of writing a paper that identifies an ethical question, examines the context, iss ...

Question what effect have the federal courts had on the

Question : What effect have the federal courts had on the government's ability to enforce national security? Find a court case or news article from the last eight weeks illustrating the effects of the federal courts on t ...

Assignment contracts- choose one- typed pages between 2

Assignment : Contracts - Choose One - Typed pages between 2 and 3 pages double-spaced. Write an essay describing how you would advise a business with cash flow problems that wishes to break several unprofitable contracts ...

Question while it seems that college forces you to write

Question: While it seems that college forces you to write endless research papers and focuses on the importance of citing your sources...why do you need to know all of this? Even in the corporate world, you will need to ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As