📅  最后修改于: 2020-12-06 07:34:00             🧑  作者: Mango
Switch和case语句支持多种语言。 case语句的语法如下:
switch E
begin
case V1: S1
case V2: S2
.
.
.
case Vn-1: Sn-1
default: Sn
end
其翻译方案如下所示:
goto TEST
L1: code for S1
goto NEXT
L2: code for S2
goto NEXT
.
.
.
Ln-1: code for Sn-1
goto NEXT
Ln: code for Sn
goto NEXT
TEST: if T = V1 goto L1
if T = V2goto L2
.
.
.
if T = Vn-1 goto Ln-1
goto
NEXT: