Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider a simplified CFG for the set language: (1) exp ? exp MINUS term (2) | term (3) term ? term UNION factor (4) |

Consider a simplified CFG for the set language:

(1) exp ? exp MINUS term (2) | term (3) term ? term UNION factor (4) | factor (5) factor ? LPAREN exp RPAREN (6) | LCURLY LIST RCURLY 

Note: lower-case symbols are nonterminals, upper-cases symbols are terminals

Answer the following questions related to LR parsers, show all works of how you get these answers.

a. Write all possible items for production rule (5): factor ? LPAREN exp RPAREN

b. I1 = { term ? term UNION . factor }. Find out Closure(I1)

c. I2 = { factor ? LPAREN . exp RPAREN }. Find out Closure(I2)

d. I3 = { exp ? . exp MINUS term; exp ? exp . MINUS term ; exp ? exp MINUS . term }, X = MINUS. Find out Goto(I3, X)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

fscanf retums a special value EOF that stands for...

Answered: 1 week ago

Question

Know how to use reservations systems to inventory demand.

Answered: 1 week ago