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 ~uh/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 ~uh/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).

Attachment:- Assignment File.rar

Computer Engineering, Engineering

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

Have any Question?


Related Questions in Computer Engineering

Question suppose that the coins of the fictional country of

Question : Suppose that the coins of the fictional country of Combinatoria come in the de- nominations, d1, d2, . . . , dk, where d1 = 1 and the other di values form a set of distinct integers greater than 1. Given an in ...

After sal aurigemma received his phd from the university of

After Sal Aurigemma received his PhD from the University of Hawaii, he became an assistant professor at the University of Tulsa. There, he introduced the school to Aloha Friday, when people come to work in their colorful ...

Make a function first-char that consumes a nonempty string

Make a function first-char that consumes a nonempty string and produces a string consisting of the first character in the original string. Do not use string-ref.

Quesiton direct manipulation and virtual environments

Quesiton: "Direct Manipulation and Virtual Environments" Please respond to the following: • Your software development company has been contracted to build a tool that will manage user accounts and rights in an Active Dir ...

Despite being noble gases xenon and radon actually form a

Despite being noble gases, xenon and radon actually form a small number of compounds. What is the partial pressure in atmospheres of radon in a mixture at STP composed of equal masses of xenon and radon?

Question suppose we run dfs on a undirected graph g that

Question : Suppose we run DFS on a (undirected) graph G that has edge weights and is connected (there is a path connecting any two vertices of G). (a) Prove that the DFS tree is a spanning tree of G. (b) Recall that the ...

Subject digital securitycompared to android what are the

Subject: Digital security Compared to Android, what are the main differences of security provided by IOS? Your answer is expected to at least cover encryption ciphers, protocols and technologies used in data and network ...

Question specify design implement im c a class for a card

Question : Specify, design implement im c++ a class for a card in a deck of playing cards. The object should contain methods for setting and retrieving the suit and rank of the card. Make sure to separate your work on s ...

Terry amp sons makes bearings for autos the production

Terry & Sons makes bearings for autos. The production system involves two independent processing machines so that each bearing passes through these two processes. The probability that the first processing machine is not ...

A compute the sumnbsps1nbsp 1 2 3 nbsp nbsp 9999 the sum

(a) Compute the sum S1 = 1 + 2 + 3 + . . . + 9999 (the sum of all integers from 1 to 9999). Do not use a program. (b) Compute the sum S2 = 1+3+5+...+9999 (the sum of all odd integers from 1 to 9999). Do not use a program ...

  • 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