Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5. Consider the following augmented grammar G. S' -> S S -> A B -> a C -> x A C A -> a B

5. Consider the following augmented grammar G.

S' -> S

S -> A B

-> a C

-> x A C

A -> a

B -> b

->

C -> c

a) Compute the Follow sets for the nonterminals.

b) Construct the LR( 0) sets-of-items and the corresponding automaton

for G.

c) Construct the SLR( 1) parse table.

d) Is G an SLR( 1) grammar?

6. Consider the following augmented grammar.

S' -> S

S -> L = R

-> R

L -> *R

-> i

R -> L

a) Construct the DFA of sets of LR( 1) items for this grammar.

b) Construct the canonical LR( 1) parsing table.

c) Construct the DFA of LALR( 1) items.

d) Construct the LALR( 1) parsing table.

e) Show the actions of an LALR( 1) parser on the input *i = i.

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

Students also viewed these Databases questions

Question

UsErS RuNnInG NmAp

Answered: 1 week ago