195 lines
2.2 KiB
C++
195 lines
2.2 KiB
C++
#include <iostream>
|
|
#include <string>
|
|
#include <map>
|
|
#include <vector>
|
|
using namespace std;
|
|
const vector<string> tokens={
|
|
"alignas",
|
|
"alignof",
|
|
"auto",
|
|
"bool",
|
|
"break",
|
|
"case",
|
|
"char",
|
|
"const",
|
|
"constexpr",
|
|
"continue",
|
|
"default",
|
|
"do",
|
|
"double",
|
|
"else",
|
|
"enum",
|
|
"extern",
|
|
"false",
|
|
"float",
|
|
"for",
|
|
"goto",
|
|
"if",
|
|
"inline",
|
|
"int",
|
|
"long",
|
|
"nullptr",
|
|
"register",
|
|
"restrict",
|
|
"return",
|
|
"short",
|
|
"signed",
|
|
"sizeof",
|
|
"static",
|
|
"static_assert",
|
|
"struct",
|
|
"switch",
|
|
"thread_local",
|
|
"true",
|
|
"typedef",
|
|
"typeof",
|
|
"typeof_unqual",
|
|
"union",
|
|
"unsigned",
|
|
"void",
|
|
"volatile",
|
|
"while",
|
|
"#include <",
|
|
"#include \"",
|
|
"ifdef",
|
|
"elifdef",
|
|
"elifndef",
|
|
"define",
|
|
"undef",
|
|
"pragma",
|
|
"endif",
|
|
"+=",
|
|
"-=",
|
|
"*=",
|
|
"/=",
|
|
"%=",
|
|
"&=",
|
|
"|=",
|
|
"^=",
|
|
"<<=",
|
|
">>=",
|
|
"++",
|
|
"--",
|
|
"<<",
|
|
">>",
|
|
"==",
|
|
"!=",
|
|
"<=",
|
|
">=",
|
|
"->",
|
|
";\n",
|
|
", ",
|
|
") {\n",
|
|
"unsigned int",
|
|
"unsigned long",
|
|
"unsigned char",
|
|
"unsigned short",
|
|
"long long",
|
|
"unsigned long long",
|
|
"signed char",
|
|
"long double",
|
|
"static int",
|
|
"static unsigned",
|
|
"static const",
|
|
"static char*",
|
|
"const char*",
|
|
"const int",
|
|
"extern int",
|
|
"volatile int",
|
|
"char*",
|
|
"char *",
|
|
"void*",
|
|
"void *",
|
|
"int *",
|
|
"int*",
|
|
"char**",
|
|
"char **",
|
|
"struct ",
|
|
"typedef struct",
|
|
"typedef enum",
|
|
"enum ",
|
|
"uint8",
|
|
"uint16",
|
|
"uint32",
|
|
"uint64",
|
|
"int8",
|
|
"int16",
|
|
"int32",
|
|
"int64",
|
|
"size_t",
|
|
"NULL",
|
|
".h>",
|
|
".h\"",
|
|
"int i=0;",
|
|
"int i = 0;",
|
|
"()",
|
|
"(",
|
|
")",
|
|
"[]",
|
|
"[",
|
|
"]",
|
|
"{}",
|
|
"{",
|
|
"}",
|
|
"<",
|
|
">",
|
|
"=",
|
|
"!",
|
|
"+",
|
|
"+",
|
|
"*",
|
|
"/",
|
|
"%",
|
|
"&",
|
|
"|",
|
|
"^",
|
|
"~",
|
|
".",
|
|
":",
|
|
";",
|
|
"?",
|
|
" ",
|
|
"\n",
|
|
"\t",
|
|
"\n ",
|
|
"\n\t",
|
|
" ",
|
|
"uint8_t",
|
|
"uint16_t",
|
|
"uint32_t",
|
|
"uint64_t",
|
|
"int8_t",
|
|
"int16_t",
|
|
"int32_t",
|
|
"int64_t",
|
|
"int main(",
|
|
"#ifdef",
|
|
"#elifdef",
|
|
"#elifndef",
|
|
"#define",
|
|
"#undef",
|
|
"#pragma",
|
|
"#endif",
|
|
"printf(",
|
|
"malloc(",
|
|
"free(",
|
|
");",
|
|
");\n",
|
|
");\n\t",
|
|
");\n ",
|
|
"if (",
|
|
"while (",
|
|
"} else if (",
|
|
"} else {",
|
|
"for (",
|
|
"switch (",
|
|
"&&",
|
|
"||",
|
|
" && ",
|
|
" || ",
|
|
};
|
|
int main() {
|
|
cout<<tokens.size()<<endl;
|
|
return 0;
|
|
}
|