#include #include #include #include #include #include "lexer/Token.h" #include "lexer/Lexer.h" using namespace std; //int main() { //#ifdef __WIN32__ // system("chcp 65001"); //#endif // string a; //cin >>a; // fstream file; // file.open("../learn2.sql", ios::in); // // if (!file.is_open()) { // cout << "打开文件时发生错误"; // return -1; // } // // stringstream stream; // stream << file.rdbuf(); // string str = stream.str(); // //// cout << str << endl; // // Lexer parser = Lexer(str.data()); // // parser.lexAll(); // // vector tokens = parser.getResults(); // // cout << "-------------------------" << endl; // cout << "总的Token数量: " << tokens.size() << endl; // int count = 0; // for (const auto &token: tokens) { // cout << "-------------------------" << endl; // cout << count++ << endl; // cout << "内容: \t" << token.getContent() << endl; // cout << "类型: \t" << TokenTypeName[token.getType()] << endl; // cout << "长度: \t" << token.getLocation().length << endl; // cout << "位置: \t[行:" << token.getLocation().line << ", 开始: " << token.getLocation().startChar << "]" << endl; // } // // return 0; //}