1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
if_:
IF
{
push();
}
;
ifElse_:
ELSE
{
semValPopPush();
}
;
ifStatementElse_:
ifElse_ statement
{
$$ = move($2);
}
|
{
$$ = SemVal{};
}
;
ifCond_:
condition
{
$$ = Args{ $1 };
}
|
';' condition
{
$$ = Args{ $2 };
}
|
flowInit ';' condition
{
$$ = move($1.add($3)); // $$ contains "if ('init'; cond)"
// initialization list + the condition as
// final Args element.
}
;
ifStatement: // condition: $4, statement: $8, ifStatementElse: $9
if_ '(' syntaxExpression ifCond_ syntaxCloseParen ')' syntaxExpression
statement ifStatementElse_
{
$$ = ifStmnt($4, $8, $9); // also does d_dymtab.pop()
}
;
|