Consider the following context-free grammar G: E → T E′ E′ → +TE′∣ε T → F T′…

Consider the following context-free grammar G:

E  →  T E′

E′ →  +TE′∣ε 

T  →  F T′

T′  →  ∗F T′  ∣  ε

F  → (E) | id

Suppose we parse the input string:

w = id + id ∗ id

using an LL(1) predictive parser.
Let M denote the maximum size of the parsing stack (counting both terminals and nonterminals, but excluding the end marker $).

The value of M is ______.

Attempted by 13 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…