Age | Commit message (Collapse) | Author | Files | Lines | |
---|---|---|---|---|---|
2016-05-08 | grammar-l11: remove left-recursion | Peter Wu | 1 | -8/+10 | |
In the original change, the EXP in PROD-EXP should have been PROD-EXP, similarly EXP in SINGLE-EXP should have been SINGLE-EXP. Otherwise the operator precedence is not applied correctly (consider 1+2*3, it should be interpreted as 1+(2*3), not (1+2)*3). Anyway, this change removes left-recursion as described in 2.12.1. | |||||
2016-05-07 | Attempt to convert grammar to LL(1) | Peter Wu | 1 | -11/+8 | |
Needs more verification, but the idea is that the expressions with lowest precedence (+) should be the first one in the parse tree (implying that non-terminals with highest precedence should be just above a terminal). Left-associativity is achieved by the trick in section 2.3.1 of Intro2CD which results in the left operand being recursed instead of the right one. | |||||
2016-05-07 | Initialize LL(1) grammar from current grammar | Peter Wu | 1 | -0/+41 | |