- IfStatement -> if Expression Block OptNL $$else ${
- $0 = calloc(1, sizeof(struct statement));
- $0->expr = $<2;
- $0->thenpart = $<3;
- }$
- | if Expression : SimpleStatements $$else ${
- $0 = calloc(1, sizeof(struct statement));
- $0->expr = $<2;
- $0->thenpart = $<4;
- }$
- | if Expression Block OptNL else Block ${
- $0 = calloc(1, sizeof(struct statement));
- $0->expr = $<2;
- $0->thenpart = $<3;
- $0->elsepart = $<6;
- }$
- | if Expression Block OptNL else : SimpleStatements ${
- $0 = calloc(1, sizeof(struct statement));
- $0->expr = $<2;
- $0->thenpart = $<3;
- $0->elsepart = $<7;
- }$
- | if Expression Block OptNL else IfStatement ${