Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started