Компиляция оператора IF
Oct. 1st, 2021 12:01 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Добавил компиляцию оператора IF.
MODULE Samples; var t1 : integer; begin t1 := 10; if t1 = 10 then writeint(10) elsif t1 < 0 then writeint(-5) else writeint(44) end END Samples.
MODULE Samples {'decls': {'consts': {}, 'procs': {}, 'vars': {'t1': (0, 'integer')}}, 'name': 'Samples', 'text': [('CONST', '10'), ('STOR', 't1'), ('LOAD', 't1'), ('CONST', '10'), ('RELOP', '='), ('BR_ZERO', 'L0'), ('CONST', '10'), ('CALL', 'writeint'), ('BR', 'L3'), ('LABEL', 'L0'), ('LOAD', 't1'), ('CONST', '0'), ('RELOP', '<'), ('BR_ZERO', 'L1'), ('CONST', '5'), ('UNARY', '-'), ('CALL', 'writeint'), ('BR', 'L3'), ('LABEL', 'L1'), ('CONST', '44'), ('CALL', 'writeint'), ('LABEL', 'L3'), ('STOP', '')]} 10 STOP at 22