What is the Purpose of Augmented Grammar in LR parsers? I was reading the LR() parsers from the Dragon Book where I came across these lines:


  To construct canonical LR(0) collection for a grammar, we define an
  augmented grammar and 2 functions, CLOSURE and GOTO.


for example say if we have a grammar like--> 

S &rarr; BB
B &rarr; cB/d

Then in augmented grammar we define it as

S' &rarr; S

S &rarr; BB

B &rarr; cB/d

In the dragon book the reason for this is mentioned as,


  The purpose of this new starting state production is to indicate the
  parser when it should stop parsing and announce the acceptance of the
  input. That is acceptance occurs when only when the parser is about to
  reduce S' &rarr; S


I am unable to understand what this even means and how this augmented grammar is useful for parsing. Any help will be highly appreciated.
The augmented grammar adds a new starting non-terminal $S'$ with the sole production $S' \to S$. This helps in detecting acceptance: If you reduce by this particular production (to the non-terminal $S'$), you are accepting. To reduce to the start non-terminal of the original grammar tells you nothing, it might appear on some right hand side.