DesignPattern/16.InterpreterPattern/2.Code/main.cpp

41 lines
1.2 KiB
C++
Raw Normal View History

2019-11-02 14:33:36 +00:00
#include <iostream>
#include "InterpreterPattern.h"
int main()
{
Handler *handler = new Handler();
string input_1 = "1 and 1";
string input_2 = "1 and 0";
string input_3 = "0 and 1";
string input_4 = "0 and 0";
string input_5 = "0 or 0";
string input_6 = "0 or 1";
string input_7 = "1 or 0";
string input_8 = "1 or 1";
string input_9 = "1 and 0 or 1";
string input_10 = "0 or 0 and 1";
string input_11 = "1 or 1 and 1 and 0";
string input_12 = "0 and 1 and 1 and 1";
string input_13 = "0 and 1 and 1 and 1 or 1 or 0 and 1";
handler->setInput(input_1); handler->handle();
handler->setInput(input_2); handler->handle();
handler->setInput(input_3); handler->handle();
handler->setInput(input_4); handler->handle();
handler->setInput(input_5); handler->handle();
handler->setInput(input_6); handler->handle();
handler->setInput(input_7); handler->handle();
handler->setInput(input_8); handler->handle();
handler->setInput(input_9); handler->handle();
handler->setInput(input_10); handler->handle();
handler->setInput(input_11); handler->handle();
handler->setInput(input_12); handler->handle();
handler->setInput(input_13); handler->handle();
printf("\n\n");
2020-11-29 03:17:40 +00:00
delete handler;
2019-11-02 14:33:36 +00:00
system("pause");
2020-11-29 03:17:40 +00:00
2019-11-02 14:33:36 +00:00
return 0;
}