|
|
new
, you should also delete
it when you don't need it any more
|
|
|
|
The token is if evaluate next expression if that is non-zero ( or whatever you want to be true ) execute next expression else read next expression and skip that if the next token is else if the conditional expression was true read next expression and skip that else execute next expression |
if
.
|
|
|
|
<if-stmt> ::= IF <expr> <stmt> | IF <expr> <stmt> ELSE <stmt> <stmt> ::= <identifier> := <expr> ? <expr> ::= <simple expr> | <simple expr> <relop> <simple expr> <relop> ::= = | <> | < | <= | >= | > <simple expr> ::= <term> | <simple expr> <addop> <term> <sign> ::= + | - <addop> ::= + | - | OR <term> ::= <factor> | <term> <mulop> <factor> <mulop> ::= * | / | DIV | MOD | AND <factor> ::= <identifier> | <sign> <identifier> | <number> | <sign> <number> | (<expr>) | <sign> (<expr>) | NOT <factor> <identifier> ::= <letter> | <identifier> <letter> | <identifier> <digit> <letter> ::= A | B | C | .... | Y | Z <digit> ::= 0 | 1 | 2 | .... | 8 | 9 <natural> ::= <digit> | <natural> <digit> <number> ::= <natural> | .<natural> | <natural>.<natural> |