<编译器> 7. 中间代码 | 4. 主要语句的IR树
1. 调用 output := concat(output,s)


2. 数组,赋值
a[i+1] := 0
数组变量 a[i]为 a(基地址) + i*w(偏移量)

3. while 循环
伪代码:
while cnd do body
start:
if not cnd goto done
body
goto start
done
两种实现:


4. for 循环: 变量声明 + while 循环 + 变量++


条件语句 if...then... , if... then ... else ...
if 语句分为有返回值 和 无返回值,有返回值的 类似于三元表达式 a := if xxx then 1 else 2
无 else 分支

有 else 分支

浙公网安备 33010602011771号