Moved expression parser to native and changed how it's accessed

This commit is contained in:
Kingcom committed 2013-07-01 01:41:06 +02:00
1 parent 41ed77f66a
commit e3d3d75e38
17 files changed
+108 -513

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
#include "DebuggerShared.h"
#include "../InputBox.h"
bool parseExpression(char* exp, DebugInterface* cpu, u32& dest)
{
PostfixExpression postfix;
if (cpu->initExpression(exp,postfix) == false) return false;
return cpu->parseExpression(postfix,dest);
}
void displayExpressionError(HWND hwnd)
{
MessageBox(hwnd,getExpressionError(),"Invalid expression",MB_OK);
}
bool executeExpressionWindow(HWND hwnd, DebugInterface* cpu, u32& dest)
{
char expression[1024];
if (InputBox_GetString(GetModuleHandle(NULL), hwnd, "Expression", "",expression) == false)
{
return false;
}
if (parseExpression(expression,cpu,dest) == false)
{
displayExpressionError(hwnd);
return false;
}
return true;
}