Assignment Instructions

Write a program that does the following: 1. Reads a grammar. 2. Finds all FIRST(X) sets, following algorithm on pg. 189 of text. 3. Finds all FOLLOW(A) sets following algorithm on pg. 190 of text. You may write the program in any language that is supported by the computers in the lab, but C++ is preferred. INPUT: A grammar G. OUTPUT: The list of all productions in G The FIRST(X) and FOLLOW(A) sets of G DELIVERABLES: Program source code, with internal documentation Test results for grammar G417 and at least one other grammar. NOTES: ===== Follow the textual conventions on pg.198 of text. (additionally follow algorithms described in First/Follow link on the Compilers web page or section 4.4.2 of text). A is a non-terminal. X is a grammar symbol (terminals or non-terminal). In addition we will use the following conventions: 1 – all terminals will be single characters. 2 – all non-terminals will be single letters. 3 – epsilon (the empty string) is: e 4 – the “produces” symbol in productions is: -> 5 – end of input / end of section symbol is: $ The format for a grammar is as follows: terminal terminal .. terminal $ production production production $ A first section with one terminal per line, ending in $, and a second section with one production per line, ending in $. The format of a production is: A->string where the string represents a single produciton with no whitespace or “or” symbols, and A is a single non-terminal. Sample grammar: ============== Example 4.27 from the book is in ~egomez/cs570/first/g417. The following modifications are made, to conform to the format above: epsilon is replaced with e. E’ is replaced with D. T’ is replaced with U. id is replaced with I. I-> x|y|z is added; x y and z are the only identifiers. You should modify the FIRST and FOLLOW sets for this grammar accordingly (see page 222). At least one more sample grammar will be placed in the same directory. Optional features: ================= You may choose to write your gramman interpreter so that it understands the “or” symbol: | You may choose to ignore whitespace for better readability. *** This assignment should be programmed in C++. and if you finish this I can give some assignments in series to you. ** What I attached is page 222. It will be helpful for this work. attachment pag222.png attachment page2222.png. Write a program that does the following:
1. Reads a grammar.
2. Finds all FIRST(X) sets, following algorithm on pg. 189 of text.
3. Finds all FOLLOW(A) sets following algorithm on pg. 190 of text.
You may write the program in any language that is supported by the
computers in the lab, but C++ is preferred.
INPUT:
A grammar G.
OUTPUT:
The list of all productions in G
The FIRST(X) and FOLLOW(A) sets of G
DELIVERABLES:
Program source code, with internal documentation
Test results for grammar G417 and at least one other
grammar.
NOTES:
=====
Follow the textual conventions on pg.198 of text.
(additionally follow algorithms described in First/Follow link
on the Compilers web page or section 4.4.2 of text).
A is a non-terminal.
X is a grammar symbol (terminals or non-terminal).
In addition we will use the following conventions:
1 – all terminals will be single characters.
2 – all non-terminals will be single letters.
3 – epsilon (the empty string) is: e
4 – the “produces” symbol in productions is: ->
5 – end of input / end of section symbol is: $
The format for a grammar is as follows:
terminal
terminal
..
terminal
$
production
production
production
$
A first section with one terminal per line, ending in $, and
a second section with one production per line, ending in $.
The format of a production is:
A->string
where the string represents a single produciton with no whitespace
or “or” symbols, and A is a single non-terminal.
Sample grammar:
==============
Example 4.27 from the book is in ~egomez/cs570/first/g417. The
following modifications are made, to conform to the format above:
epsilon is replaced with e.
E’ is replaced with D.
T’ is replaced with U.
id is replaced with I.
I-> x|y|z is added; x y and z are the only identifiers.
You should modify the FIRST and FOLLOW sets for this grammar accordingly
(see page 222).
At least one more sample grammar will be placed in the same directory.
Optional features:
=================
You may choose to write your gramman interpreter so that it
understands the “or” symbol: |
You may choose to ignore whitespace for better readability.
*** This assignment should be programmed in C++. and if you finish this I can give some assignments in series to you.
** What I attached is page 222. It will be helpful for this work.
attachment
pag222.png
attachment
page2222.png

Write a program that does the following: 1. Reads a grammar. 2. Finds all FIRST(X) sets, following algorithm on pg. 189 of text. 3. Finds all FOLLOW(A) sets following algorithm on pg. 190 of text. You may write the program in any language that is supported by the computers in the lab, but C++ is preferred. INPUT: A grammar G. OUTPUT: The list of all productions in G The FIRST(X) and FOLLOW(A) sets of G DELIVERABLES: Program source code, with internal documentation Test results for grammar G417 and at least one other grammar. NOTES: ===== Follow the textual conventions on pg.198 of text. (additionally follow algorithms described in First/Follow link on the Compilers web page or section 4.4.2 of text). A is a non-terminal. X is a grammar symbol (terminals or non-terminal). In addition we will use the following conventions: 1 – all terminals will be single characters. 2 – all non-terminals will be single letters. 3 – epsilon (the empty string) is: e 4 – the “produces” symbol in productions is: -> 5 – end of input / end of section symbol is: $ The format for a grammar is as follows: terminal terminal .. terminal $ production production production $ A first section with one terminal per line, ending in $, and a second section with one production per line, ending in $. The format of a production is: A->string where the string represents a single produciton with no whitespace or “or” symbols, and A is a single non-terminal. Sample grammar: ============== Example 4.27 from the book is in ~egomez/cs570/first/g417. The following modifications are made, to conform to the format above: epsilon is replaced with e. E’ is replaced with D. T’ is replaced with U. id is replaced with I. I-> x|y|z is added; x y and z are the only identifiers. You should modify the FIRST and FOLLOW sets for this grammar accordingly (see page 222). At least one more sample grammar will be placed in the same directory. Optional features: ================= You may choose to write your gramman interpreter so that it understands the “or” symbol: | You may choose to ignore whitespace for better readability. *** This assignment should be programmed in C++. and if you finish this I can give some assignments in series to you. ** What I attached is page 222. It will be helpful for this work. attachment pag222.png attachment page2222.png

Calculate Price


Price (USD)
$

Why Choose Us For Your Assignment?

Privacy

We value all our customers' privacy. For that reason, all information stays private and confidential and will never be shared with third parties.

Punctuality

With our service you will never miss a deadline. We use strict follow-ups with our writers to ensure that all papers are submitted on time.

Authenticity

We have no tolerance for plagiarism. All papers go through thorough checking to ensure that no assignments contain plagiarism.

Money Back

You feel unsatisfied with your results? No worries. We offer refunds to our customers if any paper is not written according to the instructions.

Clients Love Us

Client #121678
Client #121678
Read More
This is by far the best I have ever scored in a custom essay. I am surprised the writer handled this assignment so well despite the short notice. I will definitely use your service next time.
Client #21702
Client #21702
Read More
When I was recommended to you by my friends, I wasn't sure you could deliver excellent results for Masters research papers until I submitted my first order. I am all yours now.
Client #20730
Client #20730
Read More
Excellent Services! You are the only assignment helper I can rely on. I have worked with many before and your services are exceptional. I have recommended you to my friends and the results are similar.
Client #20387
Client #20387
Read More
I rarely write reviews online but your services are worth promoting. My paper was so urgent I was sure I was gonna miss the deadline but you turned things around. You are awesome!
Client #20189
Client #20189
Read More
I am a satisfied customer. I know I should have given a 5 star because you deserve it but I will give 4.6 because I almost missed a deadline because of a revision. Luckily it was minor and the writer acted promptly.
Client #20187
Client #20187
Read More
Great paper but there is still some room for improvement. I am impressed by your fast responses and how you tacked my concerns professionally. Thank you for being among the few genuine essay writing service providers.
Client #19783
Client #19783
Read More
I can't thank you enough for being a great part of my college life. I recommended you to two more of my friends. I am sure they will be making their orders soon. I love the fact that you offer free pages for referrals. I will be referring a few more and maybe I won't have to pay for my next two paper, LOL.
Previous
Next