Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92020376

Have any Question?


Related Questions in Computer Engineering

Please solve the following question using java format

please solve the following question using java format (*Solution can include*if needed* ( if statement, switch, while ) not arrays*) Write a program which performs the following: a) Prompts the user to enter a number N b ...

In linux what synchronization methods they use within the

In Linux what synchronization methods they use within the kernel, please dig into your findings for Linux.

1 what would be the purpose for a user to protect a

1. What would be the purpose for a user to protect a file from "read" or "write" access by other users? 2. Is there a reason why it would be safer for administrators to use two different accounts when working with a comp ...

Question suppose you are building a java application for

Question : Suppose you are building a Java application for storing the names and ages of children in a family. Describe the strategy that you would use in order to determine the data types you would need for your applica ...

Structured programming is a subset of procedural

Structured programming is a subset of procedural programming. If structured programming promotes the creation of good code and procedural programs are easier to maintain, why do you need to shift to OOP? What are the pro ...

What are the differences between the federal deficit and

What are the differences between the Federal deficit and Federal Debt? How does a government budget deficit affect the economy, specifically the unemployment rate and job creation? Identify two periods in recent history ...

Python programmingplease i would like some help in checking

Python programming Please I would like some help in checking if my source code for is susceptible to short-circuit evaluation.I don't need answers, I just need corrections. The source code is to check the integer parts o ...

What is the types of cost fixed variable and marginal in

What is the types of cost: fixed, variable, and marginal in economics, and methods that market power alters the relationship between a firm's costs and the price at which it sells its product?

A chemistry student needsnbsp700 ml of dimethyl sulfoxide

A chemistry student needs 70.0 mL of dimethyl sulfoxide for an experiment. By consulting the  CRC Handbook of Chemistry and Physics , the student discovers that the density of dimethyl sulfoxide is 1.10 g.cm^-3. Calculat ...

A report claims that for the investment portfolios with a

A report claims that for the investment portfolios with a single stock had a standard deviation of 0.57, while the returns for portfolios with 31 stocks have a standard deviation of 0.325. Explain how the standard deviat ...

  • 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