C++EC 项目开发rep

#ifndef CPP_EC_FAMILY_HPP
#define CPP_EC_FAMILY_HPP
 
#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <type_traits>
#include <vector>
#include <windows.h>
#include <fstream>
#include <map>
#include <thread>
#include <mutex>

using std::vector;
using std::string;
using std::map;
using std::ofstream;
using std::ifstream;
using std::getline;
using std::cin;
using std::cout;
using std::mutex;

using ll  = long long;
struct var {
	int type, heap_id;
	var() : type(-1), heap_id(-1) { }
	var(int _type, int _heapId) :
		type(_type), heap_id(_heapId) { }
};

HWND hwnd_cmd = GetConsoleWindow();

const int Welcome_Char_len = 90;
const int Token_size = 10;
const int CharF_size = 19;

vector <int*>  HeapInt;
vector <char*> HeapChar;
vector <ll*>   HeapLong;

string sline;         // 当前行缓存 
vector <string> code; // 当前代码缓存 
map <string, var> id; // int 对应 heap 的下标 
int line_num;         // 行号 

enum token { For, While, Sizeof, Char, Int, LONG_LONG, If, Else, Break, Continue, Struct, Operator, Return, AUTO };
enum TYPE  { INTT, CHART, LONG_LONGT, PTRT };
enum CODE_T { MAKE_VAR, RETURN, EXPR, FOR, WHILE, CONTINUE, BREAK };

enum CharF {       // 运算符 
	Assign,// =
	Add,   // +
	Sub,   // -
	Mul,   // *
	Div,   // /
	Mod,   // %
	Bor,   // ||
	Band,  // && 
	Or,    // |
	And,   // &
	Xor,   // ^
	Eq,    // ==
	Ne,    // !=
	Lt,    // <
	Gt,    // >
	Le,    // <=
	Ge,    // >=
	Inc,   // ++
	Dec,   // --
};

struct Message {
	int code_type;
	int var_type;
	int is_error;
	int is_empty;
	string expr; // 表达式
};

void init() {
	line_num = 1;
}

#endif
2 个赞

干嘛的?

3 个赞