In contrast to documentation of other types of software, grammar documentation has to focus both on "why" and "how", due to the fact that in a grammar implementation the code in and of itself represents important information, as argued above.
the details of the input-output mapping represent the actual linguistic analysis.