1
0

ラベルとGOTOを実�

This commit is contained in:
otya128
2015-06-06 14:51:45 +09:00
parent 88ad0392a1
commit 2eaab2ef55
6 changed files with 91 additions and 2 deletions

View File

@@ -50,6 +50,7 @@ enum CodeType
Gosub,
Print,
PopG,
GotoS,
}
abstract class Code
{
@@ -167,7 +168,7 @@ class Operate : Code
vm.push(l);
}
}
class Goto : Code
class GotoAddr : Code
{
int address;
this(int addr)
@@ -180,6 +181,19 @@ class Goto : Code
vm.pc = address - 1;
}
}
class GotoS : Code
{
wstring label;
this(wstring label)
{
this.type = CodeType.GotoS;
this.label = label;
}
override void execute(VM vm)
{
stderr.writeln("can't execute");
}
}
class Gosub : Code
{