2019-09-27 03:52:29 +00:00
|
|
|
#if !defined(FCODER_LEX_GEN_HAND_WRITTEN)
|
|
|
|
#define FCODER_LEX_GEN_HAND_WRITTEN
|
|
|
|
|
|
|
|
internal u64
|
|
|
|
lexeme_hash(u64 seed, u8 *ptr, umem size){
|
|
|
|
u64 result = 0;
|
|
|
|
for (umem i = 0; i < size; i += 1, ptr += 1){
|
|
|
|
result ^= ((*ptr) ^ result*59) + seed;
|
|
|
|
}
|
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
internal Lexeme_Table_Lookup
|
|
|
|
lexeme_table_lookup(u64 *hash_array, String_Const_u8 *key_array,
|
|
|
|
Lexeme_Table_Value *value_array, i32 slot_count, u64 seed,
|
|
|
|
u8 *ptr, umem size){
|
|
|
|
Lexeme_Table_Lookup result = {};
|
|
|
|
u64 hash = lexeme_hash(seed, ptr, size);
|
|
|
|
u64 comparison_hash = hash | 1;
|
|
|
|
i32 first_index = (hash % slot_count);
|
|
|
|
i32 index = first_index;
|
|
|
|
for (;;){
|
|
|
|
if (hash_array[index] == comparison_hash){
|
|
|
|
if (string_match(SCu8(ptr, size), key_array[index])){
|
|
|
|
result.found_match = true;
|
|
|
|
result.base_kind = value_array[index].base_kind;
|
|
|
|
result.sub_kind = value_array[index].sub_kind;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (hash_array[index] == 0){
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
index += 1;
|
|
|
|
if (index == slot_count){
|
|
|
|
index = 0;
|
|
|
|
}
|
|
|
|
if (index == first_index){
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2019-11-03 21:22:10 +00:00
|
|
|
u64 main_keys_hash_array[122] = {
|
|
|
|
0xcd6c76d1d6016aeb,0x0000000000000000,0xbe9032d742e0309b,0x0000000000000000,
|
|
|
|
0x5c749ba575e954f1,0x94b802ccb961eba5,0x0000000000000000,0xbe9032d742f66603,
|
|
|
|
0xf7d7d7daa162a915,0x0000000000000000,0xf6dd841a741b54b1,0x0000000000000000,
|
|
|
|
0x0000000000000000,0x5c748f9bac5fae01,0x0000000000000000,0x5c74d05e78e41f93,
|
|
|
|
0x0000000000000000,0x5c74c48af66ee5ff,0x0000000000000000,0x0000000000000000,
|
|
|
|
0x0000000000000000,0xbe9032d9625648d7,0xb9a8aa62a1b8b979,0xb9a8aac2760d77bb,
|
|
|
|
0xf6dd841a74186629,0x0000000000000000,0x0000000000000000,0xbe9032d7b5d01513,
|
|
|
|
0x0000000000000000,0xbe9032d7994fac15,0xbe9032dad379e361,0x0000000000000000,
|
|
|
|
0x0000000000000000,0xf7d7d7daa19301fb,0x0000000000000000,0x0000000000000000,
|
|
|
|
0x0000000000000000,0x0000000000000000,0x0000000000000000,0xcd6c76d1f3bd9ae3,
|
|
|
|
0xcd6c76d1d180352d,0xbe9032d559a465a3,0x0000000000000000,0xb9a8a8cc655e5207,
|
|
|
|
0xf6dd841a741824f1,0x422915073da91143,0xb9a8ab8998c6af61,0xbe9032d4fc7896d5,
|
|
|
|
0x0000000000000000,0x0000000000000000,0xcd6c76d1e7ffc9ab,0x0000000000000000,
|
|
|
|
0xcd6c76d1f3b17747,0xb9e062526751e543,0x0000000000000000,0xbe9032d4220956e5,
|
|
|
|
0x0000000000000000,0x0000000000000000,0xf7d7d7daa19973f1,0xf5a7dce18eced143,
|
|
|
|
0xf7d7d7daa16530ef,0x0000000000000000,0x0000000000000000,0x5c74e336036c8913,
|
|
|
|
0xff53749663265edf,0x0000000000000000,0x5c73600f210c2c91,0x0000000000000000,
|
|
|
|
0x0000000000000000,0xbe9032d62353c3df,0x0000000000000000,0x0000000000000000,
|
|
|
|
0xf7d7d7daa1638d21,0xbe9032d781b9009b,0xbe9032d745cd712f,0xcd6c76d1e41b7721,
|
|
|
|
0xcd6c76d1d07552f1,0x0000000000000000,0x0000000000000000,0xbe9032d623487ce5,
|
|
|
|
0x0000000000000000,0x0000000000000000,0x0000000000000000,0xf6dd841a741beb17,
|
|
|
|
0xbe9032dadc64ca01,0xf7d7d7daa22757a3,0x3691063dc0b0a271,0x0000000000000000,
|
|
|
|
0x0000000000000000,0x0000000000000000,0xf7d7d7daa24ae2ab,0x0000000000000000,
|
|
|
|
0x94b802ccb961ea8f,0x0000000000000000,0x0000000000000000,0x0000000000000000,
|
|
|
|
0x5c736223c944691d,0x5c74bb3811f1a27d,0x0000000000000000,0x0000000000000000,
|
|
|
|
0x5c74bad2b2e27981,0xf6dd841a741badaf,0xb9a8aa06e5695175,0x0000000000000000,
|
|
|
|
0x0000000000000000,0xf7d7d7daa19d2249,0xf063459c89573543,0xf7d7d7daa22e63fd,
|
|
|
|
0x3691575ed8e83d73,0x0000000000000000,0x0000000000000000,0xcd6c76d1e71a3ee3,
|
|
|
|
0xb9a8a8f46f69395d,0xcd6c76d1f3dfe5ef,0x0000000000000000,0xcd6c76d1ded93fdf,
|
|
|
|
0xb9a8a8f46f690403,0xf7d7d7daa237416b,0x5c74965a58cc8459,0x0000000000000000,
|
|
|
|
0x0000000000000000,0x9e39509b39961eeb,
|
2019-09-27 03:52:29 +00:00
|
|
|
};
|
2019-11-03 21:22:10 +00:00
|
|
|
u8 main_keys_key_array_0[] = {0x75,0x73,0x69,0x6e,0x67,};
|
|
|
|
u8 main_keys_key_array_2[] = {0x73,0x74,0x61,0x74,0x69,0x63,};
|
|
|
|
u8 main_keys_key_array_4[] = {0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,};
|
|
|
|
u8 main_keys_key_array_5[] = {0x69,0x66,};
|
|
|
|
u8 main_keys_key_array_7[] = {0x73,0x74,0x72,0x75,0x63,0x74,};
|
|
|
|
u8 main_keys_key_array_8[] = {0x65,0x6e,0x75,0x6d,};
|
|
|
|
u8 main_keys_key_array_10[] = {0x74,0x72,0x79,};
|
|
|
|
u8 main_keys_key_array_13[] = {0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,};
|
|
|
|
u8 main_keys_key_array_15[] = {0x65,0x78,0x70,0x6c,0x69,0x63,0x69,0x74,};
|
|
|
|
u8 main_keys_key_array_17[] = {0x6e,0x6f,0x65,0x78,0x63,0x65,0x70,0x74,};
|
|
|
|
u8 main_keys_key_array_21[] = {0x66,0x72,0x69,0x65,0x6e,0x64,};
|
|
|
|
u8 main_keys_key_array_22[] = {0x6e,0x75,0x6c,0x6c,0x70,0x74,0x72,};
|
|
|
|
u8 main_keys_key_array_23[] = {0x76,0x69,0x72,0x74,0x75,0x61,0x6c,};
|
|
|
|
u8 main_keys_key_array_24[] = {0x61,0x73,0x6d,};
|
|
|
|
u8 main_keys_key_array_27[] = {0x73,0x69,0x67,0x6e,0x65,0x64,};
|
|
|
|
u8 main_keys_key_array_29[] = {0x73,0x69,0x7a,0x65,0x6f,0x66,};
|
|
|
|
u8 main_keys_key_array_30[] = {0x64,0x65,0x6c,0x65,0x74,0x65,};
|
|
|
|
u8 main_keys_key_array_33[] = {0x62,0x6f,0x6f,0x6c,};
|
|
|
|
u8 main_keys_key_array_39[] = {0x63,0x6f,0x6e,0x73,0x74,};
|
|
|
|
u8 main_keys_key_array_40[] = {0x75,0x6e,0x69,0x6f,0x6e,};
|
|
|
|
u8 main_keys_key_array_41[] = {0x74,0x79,0x70,0x65,0x69,0x64,};
|
|
|
|
u8 main_keys_key_array_43[] = {0x64,0x65,0x66,0x61,0x75,0x6c,0x74,};
|
|
|
|
u8 main_keys_key_array_44[] = {0x66,0x6f,0x72,};
|
|
|
|
u8 main_keys_key_array_45[] = {0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
|
|
|
|
u8 main_keys_key_array_46[] = {0x70,0x72,0x69,0x76,0x61,0x74,0x65,};
|
|
|
|
u8 main_keys_key_array_47[] = {0x69,0x6e,0x6c,0x69,0x6e,0x65,};
|
|
|
|
u8 main_keys_key_array_50[] = {0x62,0x72,0x65,0x61,0x6b,};
|
|
|
|
u8 main_keys_key_array_52[] = {0x63,0x6c,0x61,0x73,0x73,};
|
|
|
|
u8 main_keys_key_array_53[] = {0x72,0x65,0x69,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x5f,0x63,0x61,0x73,0x74,};
|
|
|
|
u8 main_keys_key_array_55[] = {0x72,0x65,0x74,0x75,0x72,0x6e,};
|
|
|
|
u8 main_keys_key_array_58[] = {0x63,0x61,0x73,0x65,};
|
|
|
|
u8 main_keys_key_array_59[] = {0x63,0x6f,0x6e,0x73,0x74,0x5f,0x63,0x61,0x73,0x74,};
|
|
|
|
u8 main_keys_key_array_60[] = {0x67,0x6f,0x74,0x6f,};
|
|
|
|
u8 main_keys_key_array_63[] = {0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,};
|
|
|
|
u8 main_keys_key_array_64[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x61,0x73,0x73,0x65,0x72,0x74,};
|
|
|
|
u8 main_keys_key_array_66[] = {0x64,0x65,0x63,0x6c,0x74,0x79,0x70,0x65,};
|
|
|
|
u8 main_keys_key_array_69[] = {0x65,0x78,0x70,0x6f,0x72,0x74,};
|
|
|
|
u8 main_keys_key_array_72[] = {0x65,0x6c,0x73,0x65,};
|
|
|
|
u8 main_keys_key_array_73[] = {0x70,0x75,0x62,0x6c,0x69,0x63,};
|
|
|
|
u8 main_keys_key_array_74[] = {0x73,0x77,0x69,0x74,0x63,0x68,};
|
|
|
|
u8 main_keys_key_array_75[] = {0x66,0x61,0x6c,0x73,0x65,};
|
|
|
|
u8 main_keys_key_array_76[] = {0x77,0x68,0x69,0x6c,0x65,};
|
|
|
|
u8 main_keys_key_array_79[] = {0x65,0x78,0x74,0x65,0x72,0x6e,};
|
|
|
|
u8 main_keys_key_array_83[] = {0x69,0x6e,0x74,};
|
|
|
|
u8 main_keys_key_array_84[] = {0x64,0x6f,0x75,0x62,0x6c,0x65,};
|
|
|
|
u8 main_keys_key_array_85[] = {0x76,0x6f,0x69,0x64,};
|
|
|
|
u8 main_keys_key_array_86[] = {0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,};
|
|
|
|
u8 main_keys_key_array_90[] = {0x6c,0x6f,0x6e,0x67,};
|
|
|
|
u8 main_keys_key_array_92[] = {0x64,0x6f,};
|
|
|
|
u8 main_keys_key_array_96[] = {0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,};
|
|
|
|
u8 main_keys_key_array_97[] = {0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,};
|
|
|
|
u8 main_keys_key_array_100[] = {0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,};
|
|
|
|
u8 main_keys_key_array_101[] = {0x6e,0x65,0x77,};
|
|
|
|
u8 main_keys_key_array_102[] = {0x74,0x79,0x70,0x65,0x64,0x65,0x66,};
|
|
|
|
u8 main_keys_key_array_105[] = {0x63,0x68,0x61,0x72,};
|
|
|
|
u8 main_keys_key_array_106[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
|
|
|
|
u8 main_keys_key_array_107[] = {0x74,0x72,0x75,0x65,};
|
|
|
|
u8 main_keys_key_array_108[] = {0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,};
|
|
|
|
u8 main_keys_key_array_111[] = {0x66,0x6c,0x6f,0x61,0x74,};
|
|
|
|
u8 main_keys_key_array_112[] = {0x61,0x6c,0x69,0x67,0x6e,0x6f,0x66,};
|
|
|
|
u8 main_keys_key_array_113[] = {0x63,0x61,0x74,0x63,0x68,};
|
|
|
|
u8 main_keys_key_array_115[] = {0x73,0x68,0x6f,0x72,0x74,};
|
|
|
|
u8 main_keys_key_array_116[] = {0x61,0x6c,0x69,0x67,0x6e,0x61,0x73,};
|
|
|
|
u8 main_keys_key_array_117[] = {0x74,0x68,0x69,0x73,};
|
|
|
|
u8 main_keys_key_array_118[] = {0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,};
|
|
|
|
u8 main_keys_key_array_121[] = {0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x6c,0x6f,0x63,0x61,0x6c,};
|
|
|
|
String_Const_u8 main_keys_key_array[122] = {
|
2019-10-26 20:48:50 +00:00
|
|
|
{main_keys_key_array_0, 5},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_2, 6},
|
2019-10-26 20:48:50 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_4, 8},
|
|
|
|
{main_keys_key_array_5, 2},
|
2019-10-26 20:48:50 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_7, 6},
|
|
|
|
{main_keys_key_array_8, 4},
|
2019-10-26 20:48:50 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_10, 3},
|
2019-10-26 20:48:50 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_13, 8},
|
|
|
|
{0, 0},
|
2019-10-26 20:48:50 +00:00
|
|
|
{main_keys_key_array_15, 8},
|
2019-11-03 21:22:10 +00:00
|
|
|
{0, 0},
|
2019-10-26 20:48:50 +00:00
|
|
|
{main_keys_key_array_17, 8},
|
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_21, 6},
|
|
|
|
{main_keys_key_array_22, 7},
|
|
|
|
{main_keys_key_array_23, 7},
|
|
|
|
{main_keys_key_array_24, 3},
|
2019-10-26 20:48:50 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
|
|
|
{main_keys_key_array_27, 6},
|
|
|
|
{0, 0},
|
2019-10-25 23:33:50 +00:00
|
|
|
{main_keys_key_array_29, 6},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_30, 6},
|
2019-10-23 01:25:40 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_33, 4},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-10-26 20:48:50 +00:00
|
|
|
{0, 0},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_39, 5},
|
|
|
|
{main_keys_key_array_40, 5},
|
|
|
|
{main_keys_key_array_41, 6},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_43, 7},
|
|
|
|
{main_keys_key_array_44, 3},
|
|
|
|
{main_keys_key_array_45, 12},
|
|
|
|
{main_keys_key_array_46, 7},
|
|
|
|
{main_keys_key_array_47, 6},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_50, 5},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_52, 5},
|
|
|
|
{main_keys_key_array_53, 16},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_55, 6},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_58, 4},
|
|
|
|
{main_keys_key_array_59, 10},
|
|
|
|
{main_keys_key_array_60, 4},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_63, 8},
|
|
|
|
{main_keys_key_array_64, 13},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_66, 8},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_69, 6},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_72, 4},
|
|
|
|
{main_keys_key_array_73, 6},
|
|
|
|
{main_keys_key_array_74, 6},
|
|
|
|
{main_keys_key_array_75, 5},
|
|
|
|
{main_keys_key_array_76, 5},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_79, 6},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_83, 3},
|
|
|
|
{main_keys_key_array_84, 6},
|
|
|
|
{main_keys_key_array_85, 4},
|
|
|
|
{main_keys_key_array_86, 9},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_90, 4},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_92, 2},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_96, 8},
|
|
|
|
{main_keys_key_array_97, 8},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_100, 8},
|
|
|
|
{main_keys_key_array_101, 3},
|
|
|
|
{main_keys_key_array_102, 7},
|
2019-10-25 23:33:50 +00:00
|
|
|
{0, 0},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_105, 4},
|
|
|
|
{main_keys_key_array_106, 11},
|
|
|
|
{main_keys_key_array_107, 4},
|
|
|
|
{main_keys_key_array_108, 9},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_111, 5},
|
|
|
|
{main_keys_key_array_112, 7},
|
|
|
|
{main_keys_key_array_113, 5},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-10-26 20:48:50 +00:00
|
|
|
{main_keys_key_array_115, 5},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_116, 7},
|
|
|
|
{main_keys_key_array_117, 4},
|
|
|
|
{main_keys_key_array_118, 8},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{main_keys_key_array_121, 12},
|
2019-10-26 20:48:50 +00:00
|
|
|
};
|
2019-11-03 21:22:10 +00:00
|
|
|
Lexeme_Table_Value main_keys_value_array[122] = {
|
|
|
|
{4, TokenCppKind_Using},
|
|
|
|
{0, 0},
|
2019-10-26 20:48:50 +00:00
|
|
|
{4, TokenCppKind_Static},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Volatile},
|
|
|
|
{4, TokenCppKind_If},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Struct},
|
2019-10-26 20:48:50 +00:00
|
|
|
{4, TokenCppKind_Enum},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Try},
|
2019-10-01 23:34:54 +00:00
|
|
|
{0, 0},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-10-26 20:48:50 +00:00
|
|
|
{4, TokenCppKind_Register},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Explicit},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_NoExcept},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-10-18 02:54:02 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Friend},
|
|
|
|
{4, TokenCppKind_NullPtr},
|
|
|
|
{4, TokenCppKind_Virtual},
|
|
|
|
{4, TokenCppKind_Asm},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Signed},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_SizeOf},
|
|
|
|
{4, TokenCppKind_Delete},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Bool},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Const},
|
|
|
|
{4, TokenCppKind_Union},
|
|
|
|
{4, TokenCppKind_TypeID},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Default},
|
|
|
|
{4, TokenCppKind_For},
|
|
|
|
{4, TokenCppKind_DynamicCast},
|
|
|
|
{4, TokenCppKind_Private},
|
|
|
|
{4, TokenCppKind_Inline},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Break},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Class},
|
|
|
|
{4, TokenCppKind_ReinterpretCast},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Return},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Case},
|
|
|
|
{4, TokenCppKind_ConstCast},
|
|
|
|
{4, TokenCppKind_Goto},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Unsigned},
|
|
|
|
{4, TokenCppKind_StaticAssert},
|
2019-10-01 22:03:21 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_DeclType},
|
2019-10-01 22:03:21 +00:00
|
|
|
{0, 0},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Export},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Else},
|
|
|
|
{4, TokenCppKind_Public},
|
|
|
|
{4, TokenCppKind_Switch},
|
|
|
|
{8, TokenCppKind_LiteralFalse},
|
|
|
|
{4, TokenCppKind_While},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-10-18 02:54:02 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Extern},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Int},
|
|
|
|
{4, TokenCppKind_Double},
|
|
|
|
{4, TokenCppKind_Void},
|
|
|
|
{4, TokenCppKind_Namespace},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-10-26 20:48:50 +00:00
|
|
|
{4, TokenCppKind_Long},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Do},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-10-25 23:33:50 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Continue},
|
2019-10-26 20:48:50 +00:00
|
|
|
{4, TokenCppKind_Typename},
|
|
|
|
{0, 0},
|
2019-10-25 23:33:50 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Template},
|
|
|
|
{4, TokenCppKind_New},
|
|
|
|
{4, TokenCppKind_Typedef},
|
2019-10-20 01:46:57 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Char},
|
|
|
|
{4, TokenCppKind_StaticCast},
|
|
|
|
{8, TokenCppKind_LiteralTrue},
|
|
|
|
{4, TokenCppKind_Protected},
|
2019-10-25 23:33:50 +00:00
|
|
|
{0, 0},
|
2019-10-26 20:48:50 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Float},
|
|
|
|
{4, TokenCppKind_AlignOf},
|
|
|
|
{4, TokenCppKind_Catch},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{4, TokenCppKind_Short},
|
|
|
|
{4, TokenCppKind_AlignAs},
|
|
|
|
{4, TokenCppKind_This},
|
|
|
|
{4, TokenCppKind_Operator},
|
2019-10-26 20:48:50 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{0, 0},
|
|
|
|
{4, TokenCppKind_ThreadLocal},
|
2019-09-27 03:52:29 +00:00
|
|
|
};
|
2019-11-03 21:22:10 +00:00
|
|
|
i32 main_keys_slot_count = 122;
|
|
|
|
u64 main_keys_seed = 0x1bfce1a813e8b00f;
|
2019-10-01 23:34:54 +00:00
|
|
|
u64 pp_directives_hash_array[25] = {
|
2019-11-03 21:22:10 +00:00
|
|
|
0x1e66dcff10289be9,0xb0e642e7a9534e09,0x0000000000000000,0xb0e642e7a222e343,
|
|
|
|
0x0000000000000000,0xa40d90e358e04d03,0xa40d90e358e04809,0x0000000000000000,
|
|
|
|
0x8b77c0a3db8104fd,0xba3a9be1fff4f771,0x0000000000000000,0x8b77c1833fc2e761,
|
|
|
|
0x0000000000000000,0x0000000000000000,0x0000000000000000,0xba3a9be4d613ba69,
|
|
|
|
0xa40d90e358e46771,0xb0e642e7aa0a539d,0xb0e642e7a3cf3909,0x0000000000000000,
|
|
|
|
0xb0e642e7ac0c3669,0xba3a9be414c29411,0xba3a9be665e90fdf,0x0000000000000000,
|
2019-10-26 20:48:50 +00:00
|
|
|
0x0000000000000000,
|
2019-09-27 03:52:29 +00:00
|
|
|
};
|
2019-11-03 21:22:10 +00:00
|
|
|
u8 pp_directives_key_array_0[] = {0x69,0x66,};
|
|
|
|
u8 pp_directives_key_array_1[] = {0x69,0x66,0x64,0x65,0x66,};
|
|
|
|
u8 pp_directives_key_array_3[] = {0x75,0x73,0x69,0x6e,0x67,};
|
|
|
|
u8 pp_directives_key_array_5[] = {0x65,0x6c,0x73,0x65,};
|
|
|
|
u8 pp_directives_key_array_6[] = {0x65,0x6c,0x69,0x66,};
|
|
|
|
u8 pp_directives_key_array_8[] = {0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,};
|
|
|
|
u8 pp_directives_key_array_9[] = {0x64,0x65,0x66,0x69,0x6e,0x65,};
|
|
|
|
u8 pp_directives_key_array_11[] = {0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,};
|
|
|
|
u8 pp_directives_key_array_15[] = {0x69,0x66,0x6e,0x64,0x65,0x66,};
|
|
|
|
u8 pp_directives_key_array_16[] = {0x6c,0x69,0x6e,0x65,};
|
|
|
|
u8 pp_directives_key_array_17[] = {0x65,0x72,0x72,0x6f,0x72,};
|
|
|
|
u8 pp_directives_key_array_18[] = {0x75,0x6e,0x64,0x65,0x66,};
|
|
|
|
u8 pp_directives_key_array_20[] = {0x65,0x6e,0x64,0x69,0x66,};
|
|
|
|
u8 pp_directives_key_array_21[] = {0x69,0x6d,0x70,0x6f,0x72,0x74,};
|
|
|
|
u8 pp_directives_key_array_22[] = {0x70,0x72,0x61,0x67,0x6d,0x61,};
|
2019-10-01 23:34:54 +00:00
|
|
|
String_Const_u8 pp_directives_key_array[25] = {
|
2019-11-03 21:22:10 +00:00
|
|
|
{pp_directives_key_array_0, 2},
|
2019-10-25 23:33:50 +00:00
|
|
|
{pp_directives_key_array_1, 5},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{pp_directives_key_array_3, 5},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{pp_directives_key_array_5, 4},
|
|
|
|
{pp_directives_key_array_6, 4},
|
2019-10-23 01:25:40 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{pp_directives_key_array_8, 7},
|
|
|
|
{pp_directives_key_array_9, 6},
|
2019-10-18 02:54:02 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{pp_directives_key_array_11, 7},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
2019-10-18 02:54:02 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{pp_directives_key_array_15, 6},
|
|
|
|
{pp_directives_key_array_16, 4},
|
|
|
|
{pp_directives_key_array_17, 5},
|
|
|
|
{pp_directives_key_array_18, 5},
|
|
|
|
{0, 0},
|
|
|
|
{pp_directives_key_array_20, 5},
|
|
|
|
{pp_directives_key_array_21, 6},
|
|
|
|
{pp_directives_key_array_22, 6},
|
2019-10-26 20:48:50 +00:00
|
|
|
{0, 0},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
};
|
2019-10-01 23:34:54 +00:00
|
|
|
Lexeme_Table_Value pp_directives_value_array[25] = {
|
2019-11-03 21:22:10 +00:00
|
|
|
{5, TokenCppKind_PPIf},
|
|
|
|
{5, TokenCppKind_PPIfDef},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{5, TokenCppKind_PPUsing},
|
2019-10-25 23:33:50 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{5, TokenCppKind_PPElse},
|
|
|
|
{5, TokenCppKind_PPElIf},
|
2019-10-25 23:33:50 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{5, TokenCppKind_PPInclude},
|
|
|
|
{5, TokenCppKind_PPDefine},
|
2019-10-25 23:33:50 +00:00
|
|
|
{0, 0},
|
2019-10-26 20:48:50 +00:00
|
|
|
{5, TokenCppKind_PPVersion},
|
2019-10-25 23:33:50 +00:00
|
|
|
{0, 0},
|
2019-10-18 02:54:02 +00:00
|
|
|
{0, 0},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{5, TokenCppKind_PPIfNDef},
|
2019-10-26 20:48:50 +00:00
|
|
|
{5, TokenCppKind_PPLine},
|
2019-11-03 21:22:10 +00:00
|
|
|
{5, TokenCppKind_PPError},
|
2019-10-25 23:33:50 +00:00
|
|
|
{5, TokenCppKind_PPUndef},
|
2019-10-26 20:48:50 +00:00
|
|
|
{0, 0},
|
2019-11-03 21:22:10 +00:00
|
|
|
{5, TokenCppKind_PPEndIf},
|
|
|
|
{5, TokenCppKind_PPImport},
|
|
|
|
{5, TokenCppKind_PPPragma},
|
|
|
|
{0, 0},
|
2019-10-22 05:53:47 +00:00
|
|
|
{0, 0},
|
2019-09-27 03:52:29 +00:00
|
|
|
};
|
2019-10-01 23:34:54 +00:00
|
|
|
i32 pp_directives_slot_count = 25;
|
2019-11-03 21:22:10 +00:00
|
|
|
u64 pp_directives_seed = 0x45cb6d9f7937fd0c;
|
2019-09-27 03:52:29 +00:00
|
|
|
u64 pp_keys_hash_array[2] = {
|
2019-11-03 21:22:10 +00:00
|
|
|
0x129729b49ae65733,0x0000000000000000,
|
2019-09-27 03:52:29 +00:00
|
|
|
};
|
2019-11-03 21:22:10 +00:00
|
|
|
u8 pp_keys_key_array_0[] = {0x64,0x65,0x66,0x69,0x6e,0x65,0x64,};
|
2019-09-27 03:52:29 +00:00
|
|
|
String_Const_u8 pp_keys_key_array[2] = {
|
2019-11-03 21:22:10 +00:00
|
|
|
{pp_keys_key_array_0, 7},
|
2019-09-27 03:52:29 +00:00
|
|
|
{0, 0},
|
|
|
|
};
|
|
|
|
Lexeme_Table_Value pp_keys_value_array[2] = {
|
2019-10-23 01:25:40 +00:00
|
|
|
{4, TokenCppKind_PPDefined},
|
2019-11-03 21:22:10 +00:00
|
|
|
{0, 0},
|
2019-09-27 03:52:29 +00:00
|
|
|
};
|
|
|
|
i32 pp_keys_slot_count = 2;
|
2019-11-03 21:22:10 +00:00
|
|
|
u64 pp_keys_seed = 0x53c240fe1a473604;
|
2019-10-22 05:53:47 +00:00
|
|
|
struct Lex_State_Cpp{
|
|
|
|
u32 flags_ZF0;
|
|
|
|
u32 flags_KF0;
|
|
|
|
u16 flags_KB0;
|
|
|
|
u8 *base;
|
|
|
|
u8 *delim_first;
|
|
|
|
u8 *delim_one_past_last;
|
|
|
|
u8 *emit_ptr;
|
|
|
|
u8 *ptr;
|
|
|
|
u8 *opl_ptr;
|
|
|
|
};
|
|
|
|
internal void
|
|
|
|
lex_full_input_cpp_init(Lex_State_Cpp *state_ptr, String_Const_u8 input){
|
|
|
|
state_ptr->flags_ZF0 = 0;
|
|
|
|
state_ptr->flags_KF0 = 0;
|
|
|
|
state_ptr->flags_KB0 = 0;
|
|
|
|
state_ptr->base = input.str;
|
|
|
|
state_ptr->delim_first = input.str;
|
|
|
|
state_ptr->delim_one_past_last = input.str;
|
|
|
|
state_ptr->emit_ptr = input.str;
|
|
|
|
state_ptr->ptr = input.str;
|
|
|
|
state_ptr->opl_ptr = input.str + input.size;
|
|
|
|
}
|
|
|
|
internal b32
|
|
|
|
lex_full_input_cpp_breaks(Arena *arena, Token_List *list, Lex_State_Cpp *state_ptr, u64 max){
|
|
|
|
b32 result = false;
|
|
|
|
u64 emit_counter = 0;
|
|
|
|
Lex_State_Cpp state;
|
|
|
|
block_copy_struct(&state, state_ptr);
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
state_label_1: // root
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_EOF;
|
|
|
|
token.kind = 0;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
|
|
|
result = true;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
case 0x00:case 0x01:case 0x02:case 0x03:case 0x04:case 0x05:case 0x06:
|
|
|
|
case 0x07:case 0x08:case 0x0e:case 0x0f:case 0x10:case 0x11:case 0x12:
|
|
|
|
case 0x13:case 0x14:case 0x15:case 0x16:case 0x17:case 0x18:case 0x19:
|
|
|
|
case 0x1a:case 0x1b:case 0x1c:case 0x1d:case 0x1e:case 0x1f:case 0x40:
|
|
|
|
case 0x60:case 0x7f:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x09:case 0x0b:case 0x0c:case 0x0d:case 0x20:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
if ((HasFlag(state.flags_KF0, 0x2))){
|
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_4; // error_body
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_3; // whitespace
|
|
|
|
}break;
|
|
|
|
case 0x0a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
|
|
|
state.flags_KB0 &= ~(0x1);
|
|
|
|
state.flags_KF0 &= ~(0x1);
|
|
|
|
state.flags_KF0 &= ~(0x2);
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_3; // whitespace
|
|
|
|
}break;
|
|
|
|
case 0x21:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_60; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x22:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
if ((HasFlag(state.flags_KF0, 0x1))){
|
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_26; // include_quotes
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x23:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
if ((!HasFlag(state.flags_KB0, 0x1))){
|
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_23; // pp_directive_whitespace
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_67; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
default:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_2; // identifier
|
|
|
|
}break;
|
|
|
|
case 0x25:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_64; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x26:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_61; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x27:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
|
|
|
state.flags_ZF0 |= 0x40;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x28:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_ParenOp;
|
|
|
|
token.kind = 13;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x29:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_ParenCl;
|
|
|
|
token.kind = 14;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x2a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_63; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x2b:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_53; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x2c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Comma;
|
2019-11-03 21:22:10 +00:00
|
|
|
token.kind = 15;
|
2019-09-27 03:52:29 +00:00
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x2d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_54; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x2e:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_6; // operator_or_fnumber_dot
|
|
|
|
}break;
|
|
|
|
case 0x2f:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_7; // operator_or_comment_slash
|
|
|
|
}break;
|
|
|
|
case 0x30:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_9; // znumber
|
|
|
|
}break;
|
|
|
|
case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:case 0x37:
|
|
|
|
case 0x38:case 0x39:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_8; // number
|
|
|
|
}break;
|
|
|
|
case 0x3a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_52; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x3b:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Semicolon;
|
2019-11-03 21:22:10 +00:00
|
|
|
token.kind = 15;
|
2019-09-27 03:52:29 +00:00
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
if ((!HasFlag(state.flags_KF0, 0x1))){
|
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_56; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_25; // include_pointy
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x3d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_59; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x3e:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_57; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x3f:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Ternary;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x4c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
|
|
|
state.flags_ZF0 |= 0x4;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_27; // pre_L
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x52:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_31; // pre_R
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x55:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
|
|
|
state.flags_ZF0 |= 0x20;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_29; // pre_U
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x5b:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_BrackOp;
|
|
|
|
token.kind = 13;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x5c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_5; // backslash
|
|
|
|
}break;
|
|
|
|
case 0x5d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_BrackCl;
|
|
|
|
token.kind = 14;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x5e:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Xor;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x75:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
|
|
|
state.flags_ZF0 |= 0x10;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_28; // pre_u
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x7b:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_BraceOp;
|
|
|
|
token.kind = 11;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x7c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_62; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x7d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_BraceCl;
|
|
|
|
token.kind = 12;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x7e:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Tilde;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_2: // identifier
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_KB0, 0x1)){
|
|
|
|
Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_keys_hash_array, pp_keys_key_array, pp_keys_value_array, pp_keys_slot_count, pp_keys_seed, state.emit_ptr, token.size);
|
2019-09-27 03:52:29 +00:00
|
|
|
if (lookup.found_match){
|
|
|
|
token.kind = lookup.base_kind;
|
|
|
|
token.sub_kind = lookup.sub_kind;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
Lexeme_Table_Lookup lookup = lexeme_table_lookup(main_keys_hash_array, main_keys_key_array, main_keys_value_array, main_keys_slot_count, main_keys_seed, state.emit_ptr, token.size);
|
2019-09-27 03:52:29 +00:00
|
|
|
if (lookup.found_match){
|
|
|
|
token.kind = lookup.base_kind;
|
|
|
|
token.sub_kind = lookup.sub_kind;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_Identifier;
|
|
|
|
token.kind = 6;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
case 0x00:case 0x01:case 0x02:case 0x03:case 0x04:case 0x05:case 0x06:
|
|
|
|
case 0x07:case 0x08:case 0x09:case 0x0a:case 0x0b:case 0x0c:case 0x0d:
|
|
|
|
case 0x0e:case 0x0f:case 0x10:case 0x11:case 0x12:case 0x13:case 0x14:
|
|
|
|
case 0x15:case 0x16:case 0x17:case 0x18:case 0x19:case 0x1a:case 0x1b:
|
|
|
|
case 0x1c:case 0x1d:case 0x1e:case 0x1f:case 0x20:case 0x21:case 0x22:
|
|
|
|
case 0x23:case 0x25:case 0x26:case 0x27:case 0x28:case 0x29:case 0x2a:
|
|
|
|
case 0x2b:case 0x2c:case 0x2d:case 0x2e:case 0x2f:case 0x3a:case 0x3b:
|
|
|
|
case 0x3c:case 0x3d:case 0x3e:case 0x3f:case 0x40:case 0x5b:case 0x5c:
|
|
|
|
case 0x5d:case 0x5e:case 0x60:case 0x7b:case 0x7c:case 0x7d:case 0x7e:
|
|
|
|
case 0x7f:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_KB0, 0x1)){
|
|
|
|
Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_keys_hash_array, pp_keys_key_array, pp_keys_value_array, pp_keys_slot_count, pp_keys_seed, state.emit_ptr, token.size);
|
2019-09-27 03:52:29 +00:00
|
|
|
if (lookup.found_match){
|
|
|
|
token.kind = lookup.base_kind;
|
|
|
|
token.sub_kind = lookup.sub_kind;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
Lexeme_Table_Lookup lookup = lexeme_table_lookup(main_keys_hash_array, main_keys_key_array, main_keys_value_array, main_keys_slot_count, main_keys_seed, state.emit_ptr, token.size);
|
2019-09-27 03:52:29 +00:00
|
|
|
if (lookup.found_match){
|
|
|
|
token.kind = lookup.base_kind;
|
|
|
|
token.sub_kind = lookup.sub_kind;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_Identifier;
|
|
|
|
token.kind = 6;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
default:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_2; // identifier
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_3: // whitespace
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Whitespace;
|
|
|
|
token.kind = 1;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Whitespace;
|
|
|
|
token.kind = 1;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x09:case 0x0b:case 0x0c:case 0x0d:case 0x20:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_3; // whitespace
|
|
|
|
}break;
|
|
|
|
case 0x0a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
|
|
|
state.flags_KB0 &= ~(0x1);
|
|
|
|
state.flags_KF0 &= ~(0x1);
|
|
|
|
state.flags_KF0 &= ~(0x2);
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_3; // whitespace
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_4: // error_body
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_PPErrorMessage;
|
|
|
|
token.kind = 10;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_4; // error_body
|
|
|
|
}break;
|
|
|
|
case 0x0a:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_PPErrorMessage;
|
|
|
|
token.kind = 10;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_5: // backslash
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Backslash;
|
|
|
|
token.kind = 1;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Backslash;
|
|
|
|
token.kind = 1;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x0a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Backslash;
|
|
|
|
token.kind = 1;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_6: // operator_or_fnumber_dot
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Dot;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Dot;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x2a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_DotStar;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x2e:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_68; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_10; // fnumber_decimal
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_7: // operator_or_comment_slash
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Div;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Div;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x2a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_49; // comment_block
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x2f:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_51; // comment_line
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x3d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_DivEq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_8: // number
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralInteger;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralInteger;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x2e:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_10; // fnumber_decimal
|
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_8; // number
|
|
|
|
}break;
|
|
|
|
case 0x45:case 0x65:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_11; // fnumber_exponent
|
|
|
|
}break;
|
|
|
|
case 0x4c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_18; // L_number
|
|
|
|
}break;
|
|
|
|
case 0x55:case 0x75:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_17; // U_number
|
|
|
|
}break;
|
|
|
|
case 0x6c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_20; // l_number
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_9: // znumber
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralInteger;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralInteger;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x2e:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_10; // fnumber_decimal
|
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
|
|
|
state.flags_ZF0 |= 0x2;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_16; // number_oct
|
|
|
|
}break;
|
|
|
|
case 0x45:case 0x65:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_11; // fnumber_exponent
|
|
|
|
}break;
|
|
|
|
case 0x4c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_18; // L_number
|
|
|
|
}break;
|
|
|
|
case 0x55:case 0x75:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_17; // U_number
|
|
|
|
}break;
|
|
|
|
case 0x58:case 0x78:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
|
|
|
state.flags_ZF0 |= 0x1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_14; // number_hex_first
|
|
|
|
}break;
|
|
|
|
case 0x6c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_20; // l_number
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_10: // fnumber_decimal
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat64;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat64;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_10; // fnumber_decimal
|
|
|
|
}break;
|
|
|
|
case 0x45:case 0x65:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_11; // fnumber_exponent
|
|
|
|
}break;
|
|
|
|
case 0x46:case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat32;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x4c:case 0x6c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat64;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_11: // fnumber_exponent
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat64;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat64;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x2b:case 0x2d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_12; // fnumber_exponent_sign
|
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_13; // fnumber_exponent_digits
|
|
|
|
}break;
|
|
|
|
case 0x46:case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat32;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x4c:case 0x6c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat64;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_12: // fnumber_exponent_sign
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat64;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat64;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_13; // fnumber_exponent_digits
|
|
|
|
}break;
|
|
|
|
case 0x46:case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat32;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x4c:case 0x6c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat64;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_13: // fnumber_exponent_digits
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat64;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat64;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_13; // fnumber_exponent_digits
|
|
|
|
}break;
|
|
|
|
case 0x46:case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat32;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x4c:case 0x6c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralFloat64;
|
|
|
|
token.kind = 9;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_14: // number_hex_first
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44:
|
|
|
|
case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:
|
|
|
|
case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_15; // number_hex
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_15: // number_hex
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHex;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHex;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44:
|
|
|
|
case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:
|
|
|
|
case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_15; // number_hex
|
|
|
|
}break;
|
|
|
|
case 0x4c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_18; // L_number
|
|
|
|
}break;
|
|
|
|
case 0x55:case 0x75:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_17; // U_number
|
|
|
|
}break;
|
|
|
|
case 0x6c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_20; // l_number
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_16: // number_oct
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOct;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOct;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
|
|
|
state.flags_ZF0 |= 0x2;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_16; // number_oct
|
|
|
|
}break;
|
|
|
|
case 0x4c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_18; // L_number
|
|
|
|
}break;
|
|
|
|
case 0x55:case 0x75:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_17; // U_number
|
|
|
|
}break;
|
|
|
|
case 0x6c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_20; // l_number
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_17: // U_number
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexU;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctU;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerU;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexU;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctU;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerU;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x4c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_19; // UL_number
|
|
|
|
}break;
|
|
|
|
case 0x6c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_21; // Ul_number
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_18: // L_number
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x4c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_22; // LL_number
|
|
|
|
}break;
|
|
|
|
case 0x55:case 0x75:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexUL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctUL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerUL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_19: // UL_number
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexUL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctUL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerUL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexUL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctUL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerUL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x4c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexULL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctULL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerULL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_20: // l_number
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x55:case 0x75:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexUL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctUL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerUL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x6c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_22; // LL_number
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_21: // Ul_number
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexUL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctUL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerUL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexUL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctUL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerUL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x6c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexULL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctULL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerULL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_22: // LL_number
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexLL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctLL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerLL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexLL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctLL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerLL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x55:case 0x75:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x1)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerHexULL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x2)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerOctULL;
|
|
|
|
token.kind = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralIntegerULL;
|
|
|
|
token.kind = 8;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_23: // pp_directive_whitespace
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-10-01 22:03:21 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-10-01 22:03:21 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-10-01 22:03:21 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-10-01 22:03:21 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-10-01 22:03:21 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-10-01 22:03:21 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x09:case 0x0b:case 0x0c:case 0x20:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_23; // pp_directive_whitespace
|
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44:
|
|
|
|
case 0x45:case 0x46:case 0x47:case 0x48:case 0x49:case 0x4a:case 0x4b:
|
|
|
|
case 0x4c:case 0x4d:case 0x4e:case 0x4f:case 0x50:case 0x51:case 0x52:
|
|
|
|
case 0x53:case 0x54:case 0x55:case 0x56:case 0x57:case 0x58:case 0x59:
|
|
|
|
case 0x5a:case 0x5f:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:
|
|
|
|
case 0x66:case 0x67:case 0x68:case 0x69:case 0x6a:case 0x6b:case 0x6c:
|
|
|
|
case 0x6d:case 0x6e:case 0x6f:case 0x70:case 0x71:case 0x72:case 0x73:
|
|
|
|
case 0x74:case 0x75:case 0x76:case 0x77:case 0x78:case 0x79:case 0x7a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.delim_first = state.ptr;
|
|
|
|
state.flags_KB0 |= 0x1;
|
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_24; // pp_directive
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
state_label_24: // pp_directive
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
2019-10-22 05:53:47 +00:00
|
|
|
state.delim_one_past_last = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_directives_hash_array, pp_directives_key_array, pp_directives_value_array, pp_directives_slot_count, pp_directives_seed, state.delim_first, (state.delim_one_past_last - state.delim_first));
|
2019-09-27 03:52:29 +00:00
|
|
|
if (lookup.found_match){
|
|
|
|
token.kind = lookup.base_kind;
|
|
|
|
token.sub_kind = lookup.sub_kind;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_PPUnknown;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
|
|
|
switch (token.sub_kind){
|
|
|
|
case TokenCppKind_PPInclude:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_KF0 |= 0x1;
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case TokenCppKind_PPError:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_KF0 |= 0x2;
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.delim_one_past_last = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_directives_hash_array, pp_directives_key_array, pp_directives_value_array, pp_directives_slot_count, pp_directives_seed, state.delim_first, (state.delim_one_past_last - state.delim_first));
|
2019-09-27 03:52:29 +00:00
|
|
|
if (lookup.found_match){
|
|
|
|
token.kind = lookup.base_kind;
|
|
|
|
token.sub_kind = lookup.sub_kind;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_PPUnknown;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
|
|
|
switch (token.sub_kind){
|
|
|
|
case TokenCppKind_PPInclude:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_KF0 |= 0x1;
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case TokenCppKind_PPError:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_KF0 |= 0x2;
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44:
|
|
|
|
case 0x45:case 0x46:case 0x47:case 0x48:case 0x49:case 0x4a:case 0x4b:
|
|
|
|
case 0x4c:case 0x4d:case 0x4e:case 0x4f:case 0x50:case 0x51:case 0x52:
|
|
|
|
case 0x53:case 0x54:case 0x55:case 0x56:case 0x57:case 0x58:case 0x59:
|
|
|
|
case 0x5a:case 0x5f:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:
|
|
|
|
case 0x66:case 0x67:case 0x68:case 0x69:case 0x6a:case 0x6b:case 0x6c:
|
|
|
|
case 0x6d:case 0x6e:case 0x6f:case 0x70:case 0x71:case 0x72:case 0x73:
|
|
|
|
case 0x74:case 0x75:case 0x76:case 0x77:case 0x78:case 0x79:case 0x7a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_24; // pp_directive
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_25: // include_pointy
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x20:case 0x2e:case 0x2f:case 0x30:case 0x31:case 0x32:case 0x33:
|
|
|
|
case 0x34:case 0x35:case 0x36:case 0x37:case 0x38:case 0x39:case 0x41:
|
|
|
|
case 0x42:case 0x43:case 0x44:case 0x45:case 0x46:case 0x47:case 0x48:
|
|
|
|
case 0x49:case 0x4a:case 0x4b:case 0x4c:case 0x4d:case 0x4e:case 0x4f:
|
|
|
|
case 0x50:case 0x51:case 0x52:case 0x53:case 0x54:case 0x55:case 0x56:
|
|
|
|
case 0x57:case 0x58:case 0x59:case 0x5a:case 0x5c:case 0x5f:case 0x61:
|
|
|
|
case 0x62:case 0x63:case 0x64:case 0x65:case 0x66:case 0x67:case 0x68:
|
|
|
|
case 0x69:case 0x6a:case 0x6b:case 0x6c:case 0x6d:case 0x6e:case 0x6f:
|
|
|
|
case 0x70:case 0x71:case 0x72:case 0x73:case 0x74:case 0x75:case 0x76:
|
|
|
|
case 0x77:case 0x78:case 0x79:case 0x7a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_25; // include_pointy
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x3e:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_PPIncludeFile;
|
|
|
|
token.kind = 10;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_26: // include_quotes
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x20:case 0x2e:case 0x2f:case 0x30:case 0x31:case 0x32:case 0x33:
|
|
|
|
case 0x34:case 0x35:case 0x36:case 0x37:case 0x38:case 0x39:case 0x41:
|
|
|
|
case 0x42:case 0x43:case 0x44:case 0x45:case 0x46:case 0x47:case 0x48:
|
|
|
|
case 0x49:case 0x4a:case 0x4b:case 0x4c:case 0x4d:case 0x4e:case 0x4f:
|
|
|
|
case 0x50:case 0x51:case 0x52:case 0x53:case 0x54:case 0x55:case 0x56:
|
|
|
|
case 0x57:case 0x58:case 0x59:case 0x5a:case 0x5c:case 0x5f:case 0x61:
|
|
|
|
case 0x62:case 0x63:case 0x64:case 0x65:case 0x66:case 0x67:case 0x68:
|
|
|
|
case 0x69:case 0x6a:case 0x6b:case 0x6c:case 0x6d:case 0x6e:case 0x6f:
|
|
|
|
case 0x70:case 0x71:case 0x72:case 0x73:case 0x74:case 0x75:case 0x76:
|
|
|
|
case 0x77:case 0x78:case 0x79:case 0x7a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_26; // include_quotes
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x22:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_PPIncludeFile;
|
|
|
|
token.kind = 10;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_27: // pre_L
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
goto state_label_2; // identifier
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
goto state_label_2; // identifier
|
|
|
|
}break;
|
|
|
|
case 0x22:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x52:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_31; // pre_R
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_28: // pre_u
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
goto state_label_2; // identifier
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
goto state_label_2; // identifier
|
|
|
|
}break;
|
|
|
|
case 0x22:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x38:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
|
|
|
state.flags_ZF0 |= 0x8;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_30; // pre_u8
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x52:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_31; // pre_R
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_29: // pre_U
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
goto state_label_2; // identifier
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
goto state_label_2; // identifier
|
|
|
|
}break;
|
|
|
|
case 0x22:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x52:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_31; // pre_R
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_30: // pre_u8
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
goto state_label_2; // identifier
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
goto state_label_2; // identifier
|
|
|
|
}break;
|
|
|
|
case 0x22:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x52:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_31; // pre_R
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_31: // pre_R
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
goto state_label_2; // identifier
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
goto state_label_2; // identifier
|
|
|
|
}break;
|
|
|
|
case 0x22:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
|
|
|
state.delim_first = state.ptr;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_45; // raw_string_get_delim
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_32: // string
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x0a:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x22:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
if ((!HasFlag(state.flags_ZF0, 0x40))){
|
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x4)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralStringWide;
|
|
|
|
token.kind = 10;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x8)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralStringUTF8;
|
|
|
|
token.kind = 10;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x10)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralStringUTF16;
|
|
|
|
token.kind = 10;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x20)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralStringUTF32;
|
|
|
|
token.kind = 10;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralString;
|
|
|
|
token.kind = 10;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x27:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
if ((HasFlag(state.flags_ZF0, 0x40))){
|
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x4)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralCharacterWide;
|
|
|
|
token.kind = 10;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x8)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralCharacterUTF8;
|
|
|
|
token.kind = 10;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x10)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralCharacterUTF16;
|
|
|
|
token.kind = 10;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x20)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralCharacterUTF32;
|
|
|
|
token.kind = 10;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralCharacter;
|
|
|
|
token.kind = 10;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x5c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_33; // string_esc
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_33: // string_esc
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_EOF;
|
|
|
|
token.kind = 0;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
|
|
|
result = true;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_34; // string_esc_oct2
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x55:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_37; // string_esc_universal_8
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x75:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_41; // string_esc_universal_4
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x78:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_36; // string_esc_hex
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_34: // string_esc_oct2
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_35; // string_esc_oct1
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_35: // string_esc_oct1
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_36: // string_esc_hex
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44:
|
|
|
|
case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:
|
|
|
|
case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_36; // string_esc_hex
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_37: // string_esc_universal_8
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44:
|
|
|
|
case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:
|
|
|
|
case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_38; // string_esc_universal_7
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_38: // string_esc_universal_7
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44:
|
|
|
|
case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:
|
|
|
|
case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_39; // string_esc_universal_6
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_39: // string_esc_universal_6
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44:
|
|
|
|
case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:
|
|
|
|
case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_40; // string_esc_universal_5
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_40: // string_esc_universal_5
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44:
|
|
|
|
case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:
|
|
|
|
case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_41; // string_esc_universal_4
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_41: // string_esc_universal_4
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44:
|
|
|
|
case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:
|
|
|
|
case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_42; // string_esc_universal_3
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_42: // string_esc_universal_3
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44:
|
|
|
|
case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:
|
|
|
|
case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_43; // string_esc_universal_2
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_43: // string_esc_universal_2
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44:
|
|
|
|
case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:
|
|
|
|
case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_44; // string_esc_universal_1
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_44: // string_esc_universal_1
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36:
|
|
|
|
case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44:
|
|
|
|
case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:
|
|
|
|
case 0x66:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_32; // string
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_45: // raw_string_get_delim
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_EOF;
|
|
|
|
token.kind = 0;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
|
|
|
result = true;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_45; // raw_string_get_delim
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x20:case 0x29:case 0x5c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x28:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.delim_one_past_last = state.ptr;
|
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_46; // raw_string_find_close
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_46: // raw_string_find_close
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_EOF;
|
|
|
|
token.kind = 0;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
|
|
|
result = true;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_46; // raw_string_find_close
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x29:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_47; // raw_string_try_delim
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_47: // raw_string_try_delim
|
2019-10-22 05:53:47 +00:00
|
|
|
umem delim_length = state.delim_one_past_last - state.delim_first;
|
2019-09-27 03:52:29 +00:00
|
|
|
umem parse_length = 0;
|
|
|
|
for (;;){
|
|
|
|
if (parse_length == delim_length){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_48; // raw_string_try_quote
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_48; // raw_string_try_quote
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (*state.ptr == state.delim_first[parse_length]){
|
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
parse_length += 1;
|
|
|
|
}
|
|
|
|
else{
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_46; // raw_string_find_close
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_48: // raw_string_try_quote
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_46; // raw_string_find_close
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_46; // raw_string_find_close
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x22:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x4)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralStringWideRaw;
|
|
|
|
token.kind = 10;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x8)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralStringUTF8Raw;
|
|
|
|
token.kind = 10;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x10)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralStringUTF16Raw;
|
|
|
|
token.kind = 10;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
if (HasFlag(state.flags_ZF0, 0x20)){
|
2019-09-27 03:52:29 +00:00
|
|
|
token.sub_kind = TokenCppKind_LiteralStringUTF32Raw;
|
|
|
|
token.kind = 10;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
token.sub_kind = TokenCppKind_LiteralStringRaw;
|
|
|
|
token.kind = 10;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_49: // comment_block
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_BlockComment;
|
|
|
|
token.kind = 3;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_EOF;
|
|
|
|
token.kind = 0;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
|
|
|
result = true;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_49; // comment_block
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x0a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
|
|
|
state.flags_KB0 &= ~(0x1);
|
|
|
|
state.flags_KF0 &= ~(0x1);
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_49; // comment_block
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x2a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_50; // comment_block_try_close
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_50: // comment_block_try_close
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_BlockComment;
|
|
|
|
token.kind = 3;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_EOF;
|
|
|
|
token.kind = 0;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
|
|
|
result = true;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_49; // comment_block
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x2a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_50; // comment_block_try_close
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x2f:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_BlockComment;
|
|
|
|
token.kind = 3;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_51: // comment_line
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LineComment;
|
|
|
|
token.kind = 3;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_51; // comment_line
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x0a:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LineComment;
|
|
|
|
token.kind = 3;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_52: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Colon;
|
2019-11-03 21:22:10 +00:00
|
|
|
token.kind = 15;
|
2019-09-27 03:52:29 +00:00
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Colon;
|
2019-11-03 21:22:10 +00:00
|
|
|
token.kind = 15;
|
2019-09-27 03:52:29 +00:00
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_ColonColon;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_53: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Plus;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Plus;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x2b:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_PlusPlus;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_PlusEq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_54: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Minus;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Minus;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x2d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_MinusMinus;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_MinusEq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3e:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_55; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_55: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Arrow;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Arrow;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x2a:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_ArrowStar;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_56: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Less;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Less;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_65; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
case 0x3d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_58; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_57: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Grtr;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Grtr;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_GrtrEq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3e:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-10-01 22:03:21 +00:00
|
|
|
goto state_label_66; // op stage
|
2019-09-27 03:52:29 +00:00
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_58: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LessEq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LessEq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3e:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Compare;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_59: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Eq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Eq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_EqEq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_60: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Not;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Not;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_NotEq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_61: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_And;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_And;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x26:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_AndAnd;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_62: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Or;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Or;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x7c:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_OrOr;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_63: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Star;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Star;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_StarEq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_64: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Mod;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_Mod;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_ModEq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_65: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LeftLeft;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LeftLeft;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LeftLeftEq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_66: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_RightRight;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_RightRight;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x3d:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_RightRightEq;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_67: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_PPStringify;
|
2019-11-03 21:22:10 +00:00
|
|
|
token.kind = 15;
|
2019-09-27 03:52:29 +00:00
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_PPStringify;
|
2019-11-03 21:22:10 +00:00
|
|
|
token.kind = 15;
|
2019-09-27 03:52:29 +00:00
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x23:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_PPConcat;
|
2019-11-03 21:22:10 +00:00
|
|
|
token.kind = 15;
|
2019-09-27 03:52:29 +00:00
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2019-10-01 22:03:21 +00:00
|
|
|
state_label_68: // op stage
|
2019-10-22 05:53:47 +00:00
|
|
|
if (state.ptr == state.opl_ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
if ((true)){
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
switch (*state.ptr){
|
2019-09-27 03:52:29 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_LexError;
|
|
|
|
token.kind = 2;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
state.emit_ptr = state.ptr;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
case 0x2e:
|
|
|
|
{
|
2019-10-22 05:53:47 +00:00
|
|
|
state.ptr += 1;
|
2019-09-27 03:52:29 +00:00
|
|
|
{
|
|
|
|
Token token = {};
|
2019-10-22 05:53:47 +00:00
|
|
|
token.pos = (i64)(state.emit_ptr - state.base);
|
|
|
|
token.size = (i64)(state.ptr - state.emit_ptr);
|
|
|
|
token.flags = state.flags_KB0;
|
2019-09-27 03:52:29 +00:00
|
|
|
do{
|
|
|
|
token.sub_kind = TokenCppKind_DotDotDot;
|
|
|
|
token.kind = 7;
|
|
|
|
}while(0);
|
2019-10-22 05:53:47 +00:00
|
|
|
token_list_push(arena, list, &token);
|
|
|
|
emit_counter += 1;
|
|
|
|
if (emit_counter == max){
|
|
|
|
goto end;
|
2019-09-27 03:52:29 +00:00
|
|
|
}
|
2019-10-22 05:53:47 +00:00
|
|
|
state.emit_ptr = state.ptr;
|
|
|
|
}
|
|
|
|
state.flags_ZF0 = 0;
|
2019-09-27 03:52:29 +00:00
|
|
|
goto state_label_1; // root
|
|
|
|
}break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end:;
|
2019-10-22 05:53:47 +00:00
|
|
|
block_copy_struct(state_ptr, &state);
|
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
internal Token_List
|
|
|
|
lex_full_input_cpp(Arena *arena, String_Const_u8 input){
|
|
|
|
Lex_State_Cpp state = {};
|
|
|
|
lex_full_input_cpp_init(&state, input);
|
|
|
|
Token_List list = {};
|
|
|
|
lex_full_input_cpp_breaks(arena, &list, &state, max_u64);
|
2019-09-27 03:52:29 +00:00
|
|
|
return(list);
|
|
|
|
}
|