0
$\begingroup$

I was going through the text : Compilers: Principles, Techniques and Tools by Ullman et. al where I came across a claim:

$\text{"The error entries in the goto table are never consulted"}$

I feel that whenever there is a reduce move, the current state pointer moves some states back. Suppose that $A\rightarrow \alpha$ is the production used and for the viable prefix $\gamma\alpha$ the current state pointer moves back those many states (so as to pop the $\alpha$ from the stack) and goes to state say $I_n$ and there is a move from $I_n$ on $A$ to some state $I_{n'}$.

$\endgroup$
1
$\begingroup$

The goto table is only used immediately after a reduction action, which has just restored the parser state to the state in which the reduced non-terminal follows the dot. So the goto table for that state must have a state transition for that non-terminal; it's not an error entry.

So the error entries are never consulted.

$\endgroup$
1
  • $\begingroup$ Thanks alot for the help... [Once again :) ] $\endgroup$ Mar 23 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.