1
$\begingroup$

The question is under the concept of LR parser. Suppose the original grammar is
S->AA
A->aA|b

Is it necessary to add an additional rule S'->S to make it as augmented grammar? In short, I want to know the use of augmented grammar.

$\endgroup$
  • 3
    $\begingroup$ The title you have chosen is not well suited to representing your question. Please take some time to improve it; we have collected some advice here. Thank you! $\endgroup$ – Raphael Apr 8 '16 at 10:49
2
$\begingroup$

Yes, if you follow the canonical conversion of augmented grammars, a first step is adding a new start symbol $S'$ and the production $S' \to S$, since the algorithm may later "change" $S$.

However, it may not be necessary at all times. If you ask whether or not it is necessary specifically in this case, why don't you try without it and check if you get a valid answer?

$\endgroup$

protected by Community Apr 28 '16 at 19:50

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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