Question 14.4.1: Write a grammar whose nonterminals generate the sets Left(K,......

Write a grammar whose nonterminals generate the sets Left(K, t) for all nonterminals K of the given grammar.

Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

Nonterminals are symbols (LeftK t) for any nonterminal K and any terminal t (and also for t = EOI). Its production rules are as follows: Let P be the initial nonterminal (the axiom) of the given grammar. Then our new grammar has the rule

〈LeftP EOI〉 →    (the right-hand side is the empty string).

Each rule of the given grammar produces several rules of the new one. For example, if the given grammar has a rule

K → L u M N

(L, M, N are nonterminals, u is a terminal), then the new grammar has rules

\langle{{\mathrm{Left \ Lu}}}\to\langle{\mathrm{LeftK}}\,x\rangle

for all terminals x;

〈LeftM s〉 → (LeftK y〉 L u

for any s that may appear as a first character in a string derivable from N, and for any y, as well as for all pairs s = y, if the empty string is derivable from N); and

〈LeftN s〉 → 〈LeftK s〉 LuM

for any terminal s.

Related Answered Questions

Question: 14.4.7

Verified Answer:

Assume that a grammar is fixed. The string S of te...
Question: 14.4.6

Verified Answer:

As before, at each stage of the LR-process we can ...
Question: 14.4.5

Verified Answer:

Assume that a grammar is fixed. Let S be an arbitr...
Question: 14.4.4

Verified Answer:

(1) If a string S is coherent with a situation [K ...
Question: 14.4.3

Verified Answer:

The string S (of terminals and nonterminals) is co...
Question: 14.4.2

Verified Answer:

Now a situation is defined as a pair [situation in...
Question: 14.3.3

Verified Answer:

Yes; both conflicts that prevent it from being a L...
Question: 14.2.3

Verified Answer:

Yes, see the corresponding tables (a) and (b) (no ...