logic.cpp

来自「一个在linux下的shell的计算器」· C++ 代码 · 共 52 行

CPP
52
字号
/* * * * */#include <iostream>#include "logic.h"#include "interpreter.h"using namespace std;//////void LoadLogic(ItemList & list){ list.Add(new Operation(TRUE, "true", 0)); list.Add(new Operation(FALSE, "false", 0)); list.Add(new Operation(NOT, "not", 1)); list.Add(new Operation(LT, "<", 2)); list.Add(new Operation(GT, ">", 2)); list.Add(new Operation(LE, "<=", 2)); list.Add(new Operation(GE, ">=", 2)); list.Add(new Operation(EQ, "==", 2)); list.Add(new Operation(NE, "!=", 2)); list.Add(new Operation(AND, "and", 2)); list.Add(new Operation(OR, "or", 2)); list.Add(new Operation(XOR, "xor", 2));}//////void LogicalHelp(){ cout << endl << "Logical operators: " << endl << endl; cout << "  true     True (truth value)." << endl; cout << "  false    False (truth value)." << endl; cout << "  <        Less than." << endl; cout << "  >        Greater than." << endl; cout << "  <=       Less or equal than." << endl; cout << "  >=       Greater or equal than." << endl; cout << "  ==       Equal." << endl; cout << "  !=       Not equal." << endl; cout << "  and      And." << endl; cout << "  or       Or." << endl; cout << "  xor      Exclusive Or." << endl; cout << "  not      Logical negation." << endl;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?