1
0

FORを実�

This commit is contained in:
otya128
2015-06-07 13:28:19 +09:00
parent 46b7b2ede3
commit 65fe8558a2
6 changed files with 243 additions and 5 deletions

View File

@@ -33,6 +33,11 @@ class VM
}
void pop(out Value value)
{
if(stacki <= 0)
{
writeln("Stack underflow");
readln();
}
value = stack[--stacki];
}
Value testGetGlobaVariable(wstring name)
@@ -162,6 +167,24 @@ class Operate : Code
case TokenType.Div:
ld /= rd;
break;
case TokenType.Equal:
ld = ld == rd;
break;
case TokenType.NotEqual:
ld = ld != rd;
break;
case TokenType.Less:
ld = ld < rd;
break;
case TokenType.LessEqual:
ld = ld <= rd;
break;
case TokenType.Greater:
ld = ld > rd;
break;
case TokenType.GreaterEqual:
ld = ld >= rd;
break;
default:
writeln("NotImpl: ", operator);
break;