December 2021
Beginner
840 pages
47h 29m
English
Here, “having higher precedence” means “occurring lower in the parse tree” because expressions are evaluated bottom-up. In general, grammar disambiguation involves introducing additional non-terminals to prevent a sentence from being parsed multiple ways. To remove the ambiguity caused by (the lack of) operator precedence, we introduce new steps (i.e., non-terminals) in the non-terminal cascade so that multiplications are always lower than additions in the parse tree. Recall that we desire part of the meaning (or semantics) to be determined from the grammar (or syntax).
Consider the following updated grammar, which addresses precedence:
With this grammar it is no longer possible ...
Read now
Unlock full access