In this assignment, you will draw the automaton for a Canonical LR(1), also called CLR(1), parser for a reference grammar. You should define the production rules and alphabet of terminals for the grammar following the process described below. To learn how to construct the automaton of a CLR(1) parser, read Sections 4.7.1 to 4.7.3 of the reference textbook. Draw the automaton exactly in the way shown in the reference textbook. Note that your submission must be a handwritten version, a typed submission will get a 0 out of 10. Grammar Construction Process (note that & means empty): A -> BAC A -> DE B -> the last digit of your student ID C -> the second last digit of your student ID D -> the third last digit of your student ID E-> the fourth last digit of your student ID Then, if your student ID is odd then add the following rules: B-> ε D-> ε Otherwise, add the following rules: C -> ε E-> ε An example: Suppose your student ID is 20130165. Then your grammar is as follows A -> BAC A -> DE B -> 5 C -> 6 D -> 1 E-> 0 B-> ε D -> ε Alphabet of terminals is {5,6,1,0}

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Student ID is 24241357
In this assignment, you will draw the automaton for a Canonical
LR(1), also called CLR(1), parser for a reference grammar. You
should define the production rules and alphabet of terminals for
the grammar following the process described below. To learn
how to construct the automaton of a CLR(1) parser, read
Sections 4.7.1 to 4.7.3 of the reference textbook. Draw the
automaton exactly in the way shown in the reference textbook.
Note that your submission must be a handwritten version, a
typed submission will get a 0 out of 10.
Grammar Construction Process (note that & means empty):
A -> BAC
A -> DE
B -> the last digit of your student ID
C -> the second last digit of your student ID
D -> the third last digit of your student ID
E-> the fourth last digit of your student ID
Then, if your student ID is odd then add the following rules:
B-> ε
D-> ε
Otherwise, add the following rules:
C -> ε
E-> ε
An example: Suppose your student ID is 20130165. Then your
grammar is as follows
A -> BAC
A -> DE
B -> 5
C -> 6
D -> 1
E-> 0
B-> ε
D -> ε
Alphabet of terminals is {5,6,1,0}
Transcribed Image Text:In this assignment, you will draw the automaton for a Canonical LR(1), also called CLR(1), parser for a reference grammar. You should define the production rules and alphabet of terminals for the grammar following the process described below. To learn how to construct the automaton of a CLR(1) parser, read Sections 4.7.1 to 4.7.3 of the reference textbook. Draw the automaton exactly in the way shown in the reference textbook. Note that your submission must be a handwritten version, a typed submission will get a 0 out of 10. Grammar Construction Process (note that & means empty): A -> BAC A -> DE B -> the last digit of your student ID C -> the second last digit of your student ID D -> the third last digit of your student ID E-> the fourth last digit of your student ID Then, if your student ID is odd then add the following rules: B-> ε D-> ε Otherwise, add the following rules: C -> ε E-> ε An example: Suppose your student ID is 20130165. Then your grammar is as follows A -> BAC A -> DE B -> 5 C -> 6 D -> 1 E-> 0 B-> ε D -> ε Alphabet of terminals is {5,6,1,0}
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education