-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathpre_expressions.c
1104 lines (1059 loc) · 32.2 KB
/
pre_expressions.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
union _struct_tag_5 {
unsigned int number;
struct enum_specifier * p_enum_specifier;
struct enumerator * p_enumerator;
struct struct_or_union_specifier * p_struct_or_union_specifier;
struct declarator * p_declarator;
struct init_declarator * p_init_declarator;
struct macro * p_macro;
struct struct_entry * p_struct_entry;
};
struct map_entry {
struct map_entry * next;
unsigned int hash;
char * key;
int type;
union _struct_tag_5 data;
};
struct expression2;
struct struct_or_union_specifier0;
struct declarator;
union _struct_tag_6 {
unsigned char bool_value;
signed char signed_char_value;
unsigned char unsigned_char_value;
signed short signed_short_value;
unsigned short unsigned_short_value;
signed int signed_int_value;
unsigned int unsigned_int_value;
signed long signed_long_value;
unsigned long unsigned_long_value;
signed long long signed_long_long_value;
unsigned long long unsigned_long_long_value;
float float_value;
double double_value;
long double long_double_value;
};
struct struct_entry;
struct hash_map {
struct map_entry ** table;
int capacity;
int size;
};
struct struct_or_union_specifier;
struct param_list {
unsigned char is_var_args;
unsigned char is_void;
struct param * head;
struct param * tail;
};
struct include_dir_list {
struct include_dir * head;
struct include_dir * tail;
};
struct diagnostic {
unsigned long long errors;
unsigned long long warnings;
unsigned long long notes;
};
struct diagnostic_stack {
int top_index;
struct diagnostic stack[10];
};
struct options {
int input;
int target;
struct diagnostic_stack diagnostic_stack;
int style;
unsigned char show_includes;
unsigned char disable_assert;
unsigned char flow_analysis;
unsigned char test_mode;
unsigned char null_checks_enabled;
unsigned char ownership_enabled;
unsigned char preprocess_only;
unsigned char clear_error_at_end;
unsigned char sarif_output;
unsigned char no_output;
unsigned char visual_studio_ouput_format;
unsigned char dump_tokens;
unsigned char dump_pptokens;
unsigned char auto_config;
char output[200];
char sarifpath[200];
};
struct token_list {
struct token * head;
struct token * tail;
};
struct preprocessor_ctx {
struct options options;
int flags;
struct hash_map macros;
struct include_dir_list include_dir;
struct hash_map pragma_once_map;
struct token * current;
struct token_list input_list;
unsigned int count_macro_value;
unsigned char conditional_inclusion;
int n_warnings;
int n_errors;
};
struct expression;
struct enumerator;
struct pre_expression_ctx {
long long value;
};
struct enum_specifier;
struct token {
int type;
char * lexeme;
char * original;
int line;
int col;
int level;
int flags;
struct token * token_origin;
struct token * next;
struct token * prev;
};
struct type {
int category;
int attributes_flags;
int type_specifier_flags;
int type_qualifier_flags;
int storage_class_specifier_flags;
char * name_opt;
struct struct_or_union_specifier0 * struct_or_union_specifier;
struct enum_specifier1 * enum_specifier;
struct expression * array_num_elements_expression;
int num_of_elements;
unsigned char static_array;
unsigned char address_of;
struct param_list params;
struct type * next;
};
struct object {
int state;
int value_type;
struct type type2;
char * debug_name;
union _struct_tag_6 value;
struct object * parent;
struct expression2 * p_init_expression;
struct object * members;
struct object * next;
};
struct include_dir {
char * path;
struct include_dir * next;
};
struct macro;
struct init_declarator;
struct param {
struct type type;
struct param * next;
};
struct enum_specifier1;
int parse_number(char * lexeme, char suffix[4], char erromsg[100]);
unsigned char preprocessor_diagnostic_message(int w, struct preprocessor_ctx * ctx, struct token * p_token, char * fmt, ...);
unsigned long long strtoull(char * _String, char ** _EndPtr, int _Radix);
int *_errno(void);
struct object object_make_unsigned_int(unsigned int value);
struct object object_make_unsigned_long(unsigned long value);
struct object object_make_unsigned_long_long(unsigned long long value);
struct object object_make_signed_int(signed int value);
struct object object_make_signed_long(signed long value);
struct object object_make_signed_long_long(signed long long value);
signed long long object_to_signed_long_long(struct object * a);
static int ppnumber_to_longlong(struct preprocessor_ctx * ctx, struct token * token, long long * result)
{
int c = 0;
char buffer[260] = {0};
char * s = token->lexeme;
while ( *s)
{
if ( *s != 39)
{
buffer[c] = *s;
c++;
}
s++;
}
char errormsg[100];
char suffix[4] = {0};
int type = parse_number(token->lexeme, suffix, errormsg);
if (type == 0)
{
preprocessor_diagnostic_message(1380, ctx, token, "%s", errormsg);
return 0;
}
struct object cv = {0};
switch (type)
{
case 136 :
case 137 :
case 138 :
case 139 :
{
unsigned long long value = 0;
switch (type)
{
case 136 :
value = strtoull(buffer, ((void *)0), 10);
break;
case 137 :
value = strtoull(buffer + 1, ((void *)0), 8);
break;
case 138 :
value = strtoull(buffer + 2, ((void *)0), 16);
break;
case 139 :
value = strtoull(buffer + 2, ((void *)0), 2);
break;
default:
break;
}
if (value == 18446744073709551615ULL && ( *_errno()) == 34)
{
}
if (suffix[0] == 85)
{
if (value <= 4294967295LL && suffix[1] != 76)
{
cv = object_make_unsigned_int((unsigned int)value);
}
else
{
if (value <= 4294967295UL && suffix[2] != 76)
{
cv = object_make_unsigned_long((unsigned long)value);
}
else
{
cv = object_make_unsigned_long_long((unsigned long long)value);
}
}
}
else
{
if (value <= 2147483647 && suffix[0] != 76)
{
cv = object_make_signed_int((int)value);
}
else
{
if (value <= 2147483647L && suffix[1] != 76)
{
cv = object_make_signed_long((long)value);
}
else
{
if (value <= 9223372036854775807LL)
{
cv = object_make_signed_long_long((long long)value);
}
else
{
cv = object_make_signed_long_long(value);
}
}
}
}
}
break;
case 140 :
case 141 :
break;
default:
;
}
*result = object_to_signed_long_long(&cv);
return 0;
}
unsigned char token_is_blank(struct token * p);
static struct token *pre_match(struct preprocessor_ctx * ctx)
{
if (ctx->current == ((void *)0))
{
return ((void *)0);
}
ctx->current = ctx->current->next;
while (ctx->current && token_is_blank(ctx->current))
{
ctx->current = ctx->current->next;
}
return ctx->current;
}
unsigned char *utf8_decode(unsigned char * s, unsigned int * c);
unsigned char *escape_sequences_decode_opt(unsigned char * p, unsigned int * out_value);
int snprintf(char * _Buffer, unsigned int _BufferCount, char * _Format, ...);
struct object object_make_wchar_t(unsigned short value);
static struct object char_constant_to_value(char * s, char error_message[], int error_message_sz_bytes)
{
error_message[0] = 0;
unsigned char * p = (unsigned char *)s;
if (1)
{
if (p[0] == 117 && p[1] == 56)
{
p++;
p++;
p++;
unsigned int c = 0;
p = utf8_decode(p, &c);
if (p == ((void *)0))
{
goto _catch_label_1;
}
if (c == 92)
{
p = escape_sequences_decode_opt(p, &c);
if (p == ((void *)0))
{
goto _catch_label_1;
}
}
if ( *p != 39)
{
snprintf(error_message, error_message_sz_bytes, "Unicode character literals may not contain multiple characters.");
}
if (c > 128)
{
snprintf(error_message, error_message_sz_bytes, "Character too large for enclosing character literal type.");
}
return object_make_wchar_t((unsigned short)c);
}
else
{
if (p[0] == 117)
{
p++;
p++;
unsigned int c = 0;
p = utf8_decode(p, &c);
if (p == ((void *)0))
{
goto _catch_label_1;
}
if (c == 92)
{
p = escape_sequences_decode_opt(p, &c);
if (p == ((void *)0))
{
goto _catch_label_1;
}
}
if ( *p != 39)
{
snprintf(error_message, error_message_sz_bytes, "Unicode character literals may not contain multiple characters.");
}
if (c > 65535)
{
snprintf(error_message, error_message_sz_bytes, "Character too large for enclosing character literal type.");
}
return object_make_wchar_t((unsigned short)c);
}
else
{
if (p[0] == 85)
{
p++;
p++;
unsigned int c = 0;
p = utf8_decode(p, &c);
if (p == ((void *)0))
{
goto _catch_label_1;
}
if (c == 92)
{
p = escape_sequences_decode_opt(p, &c);
if (p == ((void *)0))
{
goto _catch_label_1;
}
}
if ( *p != 39)
{
snprintf(error_message, error_message_sz_bytes, "Unicode character literals may not contain multiple characters.");
}
if (c > 4294967295LL)
{
snprintf(error_message, error_message_sz_bytes, "Character too large for enclosing character literal type.");
}
return object_make_wchar_t((unsigned short)c);
}
else
{
if (p[0] == 76)
{
p++;
p++;
long long value = 0;
while ( *p != 39)
{
unsigned int c = 0;
p = utf8_decode(p, &c);
if (p == ((void *)0))
{
goto _catch_label_1;
}
if (c == 92)
{
p = escape_sequences_decode_opt(p, &c);
if (p == ((void *)0))
{
goto _catch_label_1;
}
}
value = value * 256 + c;
if (value > 65535)
{
snprintf(error_message, error_message_sz_bytes, "character constant too long for its type");
break;
}
}
return object_make_wchar_t((unsigned short)value);
}
else
{
p++;
long long value = 0;
while ( *p != 39)
{
unsigned int c = 0;
p = utf8_decode(p, &c);
if (p == ((void *)0))
{
goto _catch_label_1;
}
if (c == 92)
{
p = escape_sequences_decode_opt(p, &c);
if (p == ((void *)0))
{
goto _catch_label_1;
}
}
if (c < 128)
{
value = value * 256 + c;
}
else
{
value = c;
}
if (value > 2147483647)
{
snprintf(error_message, error_message_sz_bytes, "character constant too long for its type");
break;
}
}
return object_make_wchar_t((unsigned short)value);
}
}
}
}
}
else _catch_label_1:
{
}
struct object empty = {0};
return empty;
}
void pre_unexpected_end_of_file(struct token * p_token, struct preprocessor_ctx * ctx);
static void pre_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx);
static void pre_primary_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
if (1)
{
if (ctx->current == ((void *)0))
{
pre_unexpected_end_of_file(ctx->input_list.tail, ctx);
goto _catch_label_1;
}
if (ctx->current->type == 131)
{
char * p = ctx->current->lexeme + 1;
char errmsg[200] = {0};
struct object v = char_constant_to_value(p, errmsg, sizeof errmsg);
if (errmsg[0] != 0)
{
preprocessor_diagnostic_message(650, ctx, ctx->current, "%s", errmsg);
}
ectx->value = object_to_signed_long_long(&v);
pre_match(ctx);
}
else
{
if (ctx->current->type == 134)
{
ppnumber_to_longlong(ctx, ctx->current, &ectx->value);
pre_match(ctx);
}
else
{
if (ctx->current->type == 40)
{
pre_match(ctx);
pre_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
if (ctx->current && ctx->current->type != 41)
{
preprocessor_diagnostic_message(650, ctx, ctx->current, "expected )");
goto _catch_label_1;
}
pre_match(ctx);
}
else
{
preprocessor_diagnostic_message(1140, ctx, ctx->current, "token '%s' is not valid in preprocessor expressions", ctx->current->lexeme);
goto _catch_label_1;
}
}
}
}
else _catch_label_1:
{
}
}
static void pre_postfix_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
if (1)
{
pre_primary_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
}
else _catch_label_1:
{
}
}
static void pre_cast_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx);
static void pre_unary_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
if (1)
{
if (ctx->current && (ctx->current->type == 11051 || ctx->current->type == 11565))
{
preprocessor_diagnostic_message(1140, ctx, ctx->current, "token '%s' is not valid in preprocessor expressions", ctx->current->lexeme);
goto _catch_label_1;
}
else
{
if (ctx->current != ((void *)0) && (ctx->current->type == 38 || ctx->current->type == 42 || ctx->current->type == 43 || ctx->current->type == 45 || ctx->current->type == 126 || ctx->current->type == 33))
{
struct token * p_old = ctx->current;
int op = ctx->current->type;
pre_match(ctx);
pre_cast_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
if (op == 33)
{
ectx->value = !ectx->value;
}
else
{
if (op == 126)
{
ectx->value = ~ectx->value;
}
else
{
if (op == 45)
{
ectx->value = -ectx->value;
}
else
{
if (op == 43)
{
ectx->value = +ectx->value;
}
else
{
if (op == 42)
{
preprocessor_diagnostic_message(1140, ctx, p_old, "token '%s' is not valid in preprocessor expressions", p_old->lexeme);
}
else
{
if (op == 38)
{
preprocessor_diagnostic_message(1140, ctx, p_old, "token '%s' is not valid in preprocessor expressions", p_old->lexeme);
}
else
{
preprocessor_diagnostic_message(1140, ctx, p_old, "token '%s' is not valid in preprocessor expressions", p_old->lexeme);
}
}
}
}
}
}
}
else
{
pre_postfix_expression(ctx, ectx);
}
}
}
else _catch_label_1:
{
}
}
static void pre_cast_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
pre_unary_expression(ctx, ectx);
}
static void pre_multiplicative_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
if (1)
{
pre_cast_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
while (ctx->current != ((void *)0) && (ctx->current->type == 42 || ctx->current->type == 47 || ctx->current->type == 37))
{
struct token * op_token = ctx->current;
int op = ctx->current->type;
pre_match(ctx);
long long left_value = ectx->value;
pre_cast_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
if (op == 42)
{
ectx->value = (left_value * ectx->value);
}
else
{
if (op == 47)
{
if (ectx->value == 0)
{
preprocessor_diagnostic_message(1330, ctx, op_token, "division by zero");
goto _catch_label_1;
}
else
{
ectx->value = (left_value / ectx->value);
}
}
else
{
if (op == 37)
{
ectx->value = (left_value % ectx->value);
}
}
}
}
}
else _catch_label_1:
{
}
}
static void pre_additive_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
if (1)
{
pre_multiplicative_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
while (ctx->current != ((void *)0) && (ctx->current->type == 43 || ctx->current->type == 45))
{
struct token * p_op_token = ctx->current;
pre_match(ctx);
if (ctx->current == ((void *)0))
{
pre_unexpected_end_of_file(ctx->input_list.tail, ctx);
goto _catch_label_1;
}
long long left_value = ectx->value;
pre_multiplicative_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
if (p_op_token->type == 43)
{
ectx->value = left_value + ectx->value;
}
else
{
if (p_op_token->type == 45)
{
ectx->value = left_value - ectx->value;
}
else
{
goto _catch_label_1;
}
}
}
}
else _catch_label_1:
{
}
}
static void pre_shift_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
if (1)
{
pre_additive_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
while (ctx->current != ((void *)0) && (ctx->current->type == 15934 || ctx->current->type == 15420))
{
int op = ctx->current->type;
pre_match(ctx);
long long left_value = ectx->value;
pre_multiplicative_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
if (op == 15934)
{
ectx->value = left_value >> ectx->value;
}
else
{
if (op == 15420)
{
ectx->value = left_value << ectx->value;
}
}
}
}
else _catch_label_1:
{
}
}
static void pre_relational_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
if (1)
{
pre_shift_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
while (ctx->current != ((void *)0) && (ctx->current->type == 62 || ctx->current->type == 60 || ctx->current->type == 15933 || ctx->current->type == 15421))
{
int op = ctx->current->type;
pre_match(ctx);
long long left_value = ectx->value;
pre_shift_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
if (op == 62)
{
ectx->value = left_value > ectx->value;
}
else
{
if (op == 60)
{
ectx->value = left_value < ectx->value;
}
else
{
if (op == 15933)
{
ectx->value = left_value >= ectx->value;
}
else
{
if (op == 15421)
{
ectx->value = left_value <= ectx->value;
}
}
}
}
}
}
else _catch_label_1:
{
}
}
static void pre_equality_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
if (1)
{
pre_relational_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
while (ctx->current != ((void *)0) && (ctx->current->type == 15677 || ctx->current->type == 8509))
{
int op = ctx->current->type;
pre_match(ctx);
long long left_value = ectx->value;
pre_multiplicative_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
if (op == 15677)
{
ectx->value = left_value == ectx->value;
}
else
{
if (op == 8509)
{
ectx->value = left_value != ectx->value;
}
}
}
}
else _catch_label_1:
{
}
}
static void pre_and_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
if (1)
{
pre_equality_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
while (ctx->current != ((void *)0) && (ctx->current->type == 38))
{
pre_match(ctx);
long long left_value = ectx->value;
pre_equality_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
ectx->value = left_value & ectx->value;
}
}
else _catch_label_1:
{
}
}
static void pre_exclusive_or_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
if (1)
{
pre_and_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
while (ctx->current != ((void *)0) && (ctx->current->type == 94))
{
pre_match(ctx);
long long left_value = ectx->value;
pre_and_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
ectx->value = left_value ^ ectx->value;
}
}
else _catch_label_1:
{
}
}
static void pre_inclusive_or_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
if (1)
{
pre_exclusive_or_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
while (ctx->current != ((void *)0) && (ctx->current->type == 124))
{
pre_match(ctx);
long long left_value = ectx->value;
pre_exclusive_or_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
ectx->value = left_value | ectx->value;
}
}
else _catch_label_1:
{
}
}
static void pre_logical_and_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
if (1)
{
pre_inclusive_or_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
while (ctx->current != ((void *)0) && (ctx->current->type == 9766))
{
pre_match(ctx);
long long left_value = ectx->value;
pre_inclusive_or_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
ectx->value = left_value && ectx->value;
}
}
else _catch_label_1:
{
}
}
static void pre_logical_or_expression(struct preprocessor_ctx * ctx, struct pre_expression_ctx * ectx)
{
if (1)
{
pre_logical_and_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
while (ctx->current != ((void *)0) && (ctx->current->type == 31868))
{
pre_match(ctx);
long long left_value = ectx->value;
pre_logical_and_expression(ctx, ectx);
if (ctx->n_errors > 0)
{
goto _catch_label_1;
}
ectx->value = left_value || ectx->value;
}
}
else _catch_label_1:
{
}
}