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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
|
/* Generated by re2c
*/
/*
* GAS-compatible re2c lexer
*
* Copyright (C) 2005-2007 Peter Johnson
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the author nor the names of other contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <util.h>
#include <libyasm.h>
#include "modules/parsers/gas/gas-parser.h"
#define BSIZE 8192
#define YYCURSOR cursor
#define YYLIMIT (s->lim)
#define YYMARKER (s->ptr)
#define YYFILL(n) {cursor = fill(parser_gas, cursor);}
#define RETURN(i) do {s->cur = cursor; parser_gas->tokch = s->tok[0]; \
return i;} while (0)
#define SCANINIT() {s->tok = cursor;}
#define TOK ((char *)s->tok)
#define TOKLEN (size_t)(cursor-s->tok)
/* Bridge function to convert byte-oriented parser with line-oriented
* preprocessor.
*/
static size_t
preproc_input(yasm_parser_gas *parser_gas, /*@out@*/ YYCTYPE *buf,
size_t max_size)
{
size_t tot=0;
while (max_size > 0) {
size_t n;
if (!parser_gas->line) {
parser_gas->line = yasm_preproc_get_line(parser_gas->preproc);
if (!parser_gas->line)
return tot; /* EOF */
parser_gas->linepos = parser_gas->line;
parser_gas->lineleft = strlen(parser_gas->line) + 1;
parser_gas->line[parser_gas->lineleft-1] = '\n';
}
n = parser_gas->lineleft<max_size ? parser_gas->lineleft : max_size;
strncpy((char *)buf+tot, parser_gas->linepos, n);
if (n == parser_gas->lineleft) {
yasm_xfree(parser_gas->line);
parser_gas->line = NULL;
} else {
parser_gas->lineleft -= n;
parser_gas->linepos += n;
}
tot += n;
max_size -= n;
}
return tot;
}
#if 0
static size_t
fill_input(void *d, unsigned char *buf, size_t max)
{
return yasm_preproc_input((yasm_preproc *)d, (char *)buf, max);
}
#endif
static YYCTYPE *
fill(yasm_parser_gas *parser_gas, YYCTYPE *cursor)
{
yasm_scanner *s = &parser_gas->s;
int first = 0;
if(!s->eof){
size_t cnt = s->tok - s->bot;
if(cnt){
memmove(s->bot, s->tok, (size_t)(s->lim - s->tok));
s->tok = s->bot;
s->ptr -= cnt;
cursor -= cnt;
s->lim -= cnt;
}
if (!s->bot)
first = 1;
if((s->top - s->lim) < BSIZE){
YYCTYPE *buf = yasm_xmalloc((size_t)(s->lim - s->bot) + BSIZE);
memcpy(buf, s->tok, (size_t)(s->lim - s->tok));
s->tok = buf;
s->ptr = &buf[s->ptr - s->bot];
cursor = &buf[cursor - s->bot];
s->lim = &buf[s->lim - s->bot];
s->top = &s->lim[BSIZE];
if (s->bot)
yasm_xfree(s->bot);
s->bot = buf;
}
if((cnt = preproc_input(parser_gas, s->lim, BSIZE)) == 0) {
s->eof = &s->lim[cnt]; *s->eof++ = '\n';
}
s->lim += cnt;
if (first && parser_gas->save_input) {
int i;
YYCTYPE *saveline;
parser_gas->save_last ^= 1;
saveline = parser_gas->save_line[parser_gas->save_last];
/* save next line into cur_line */
for (i=0; i<79 && &s->tok[i] < s->lim && s->tok[i] != '\n'; i++)
saveline[i] = s->tok[i];
saveline[i] = '\0';
}
}
return cursor;
}
static YYCTYPE *
save_line(yasm_parser_gas *parser_gas, YYCTYPE *cursor)
{
yasm_scanner *s = &parser_gas->s;
int i = 0;
YYCTYPE *saveline;
parser_gas->save_last ^= 1;
saveline = parser_gas->save_line[parser_gas->save_last];
/* save next line into cur_line */
if ((YYLIMIT - YYCURSOR) < 80)
YYFILL(80);
for (i=0; i<79 && &cursor[i] < s->lim && cursor[i] != '\n'; i++)
saveline[i] = cursor[i];
saveline[i] = '\0';
return cursor;
}
/* starting size of string buffer */
#define STRBUF_ALLOC_SIZE 128
/* string buffer used when parsing strings/character constants */
static YYCTYPE *strbuf = NULL;
/* length of strbuf (including terminating NULL character) */
static size_t strbuf_size = 0;
static void
strbuf_append(size_t count, YYCTYPE *cursor, yasm_scanner *s, int ch)
{
if (count >= strbuf_size) {
strbuf = yasm_xrealloc(strbuf, strbuf_size + STRBUF_ALLOC_SIZE);
strbuf_size += STRBUF_ALLOC_SIZE;
}
strbuf[count] = ch;
}
int
gas_parser_lex(YYSTYPE *lvalp, yasm_parser_gas *parser_gas)
{
yasm_scanner *s = &parser_gas->s;
YYCTYPE *cursor = s->cur;
size_t count;
YYCTYPE savech;
/* Handle one token of lookahead */
if (parser_gas->peek_token != NONE) {
int tok = parser_gas->peek_token;
*lvalp = parser_gas->peek_tokval; /* structure copy */
parser_gas->tokch = parser_gas->peek_tokch;
parser_gas->peek_token = NONE;
return tok;
}
/* Catch EOF */
if (s->eof && cursor == s->eof)
return 0;
/* Jump to proper "exclusive" states */
switch (parser_gas->state) {
case COMMENT:
goto comment;
case SECTION_DIRECTIVE:
goto section_directive;
case NASM_FILENAME:
goto nasm_filename;
default:
break;
}
scan:
SCANINIT();
{
static unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 12, 0, 0, 0,
0, 0, 0, 0, 0, 0, 12, 0,
254, 254, 126, 126, 126, 126, 126, 126,
94, 94, 0, 0, 0, 0, 0, 0,
8, 78, 78, 78, 78, 78, 78, 14,
14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 0, 0, 0, 0, 12,
0, 78, 78, 78, 78, 78, 78, 14,
14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
{
YYCTYPE yych;
unsigned int yyaccept;
goto yy0;
++YYCURSOR;
yy0:
if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
yych = *YYCURSOR;
if(yych <= '/'){
if(yych <= '#'){
if(yych <= '\r'){
if(yych <= '\t'){
if(yych <= '\b') goto yy30;
goto yy26;
} else {
if(yych <= '\n') goto yy28;
if(yych <= '\f') goto yy30;
goto yy26;
}
} else {
if(yych <= ' '){
if(yych <= '\037') goto yy30;
goto yy26;
} else {
if(yych <= '!') goto yy17;
if(yych <= '"') goto yy11;
goto yy24;
}
}
} else {
if(yych <= '*'){
if(yych <= '%'){
if(yych <= '$') goto yy17;
goto yy22;
} else {
if(yych == '\'') goto yy9;
goto yy17;
}
} else {
if(yych <= ','){
if(yych <= '+') goto yy5;
goto yy17;
} else {
if(yych <= '-') goto yy5;
if(yych <= '.') goto yy7;
goto yy18;
}
}
}
} else {
if(yych <= 'Z'){
if(yych <= '<'){
if(yych <= '9'){
if(yych >= '1') goto yy4;
goto yy2;
} else {
if(yych <= ':') goto yy17;
if(yych <= ';') goto yy19;
goto yy13;
}
} else {
if(yych <= '>'){
if(yych <= '=') goto yy17;
goto yy15;
} else {
if(yych <= '?') goto yy30;
if(yych <= '@') goto yy17;
goto yy21;
}
}
} else {
if(yych <= 'z'){
if(yych <= '^'){
if(yych <= ']') goto yy30;
goto yy17;
} else {
if(yych == '`') goto yy30;
goto yy21;
}
} else {
if(yych <= '|'){
if(yych <= '{') goto yy30;
goto yy17;
} else {
if(yych == '~') goto yy17;
goto yy30;
}
}
}
}
yy2: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= 'A'){
if(yych <= '/'){
if(yych == '.') goto yy90;
goto yy3;
} else {
if(yych <= '9') goto yy90;
if(yych <= ':') goto yy81;
goto yy3;
}
} else {
if(yych <= 'E'){
if(yych <= 'B') goto yy85;
if(yych >= 'D') goto yy88;
goto yy3;
} else {
if(yych <= 'F') goto yy86;
if(yych >= 'T') goto yy88;
goto yy3;
}
}
} else {
if(yych <= 'e'){
if(yych <= 'a'){
if(yych == 'X') goto yy92;
goto yy3;
} else {
if(yych <= 'b') goto yy85;
if(yych >= 'd') goto yy88;
goto yy3;
}
} else {
if(yych <= 't'){
if(yych <= 'f') goto yy86;
if(yych >= 't') goto yy88;
goto yy3;
} else {
if(yych == 'x') goto yy92;
goto yy3;
}
}
}
yy3:
{
savech = s->tok[TOKLEN];
s->tok[TOKLEN] = '\0';
lvalp->intn = yasm_intnum_create_dec(TOK);
s->tok[TOKLEN] = savech;
RETURN(INTNUM);
}
yy4: yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ':'){
if(yych <= '9') goto yy84;
goto yy81;
} else {
if(yych == 'B') goto yy77;
goto yy84;
}
} else {
if(yych <= 'b'){
if(yych <= 'F') goto yy79;
if(yych <= 'a') goto yy84;
goto yy77;
} else {
if(yych == 'f') goto yy79;
goto yy84;
}
}
yy5: yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == '.') goto yy61;
if(yych <= '/') goto yy6;
if(yych <= '9') goto yy59;
goto yy6;
yy6:
{ RETURN(s->tok[0]); }
yy7: yych = *++YYCURSOR;
if(yybm[0+yych] & 16) {
goto yy49;
}
goto yy37;
yy8:
{
lvalp->str.contents = yasm__xstrndup(TOK, TOKLEN);
lvalp->str.len = TOKLEN;
RETURN(ID);
}
yy9: yych = *++YYCURSOR;
goto yy10;
yy10:
{
goto charconst;
}
yy11: yych = *++YYCURSOR;
goto yy12;
yy12:
{
goto stringconst;
}
yy13: yych = *++YYCURSOR;
if(yych == '<') goto yy47;
goto yy14;
yy14:
{ RETURN(LEFT_OP); }
yy15: yych = *++YYCURSOR;
if(yych == '>') goto yy45;
goto yy16;
yy16:
{ RETURN(RIGHT_OP); }
yy17: yych = *++YYCURSOR;
goto yy6;
yy18: yych = *++YYCURSOR;
if(yych == '*') goto yy43;
if(yych == '/') goto yy41;
goto yy6;
yy19: yych = *++YYCURSOR;
goto yy20;
yy20:
{
parser_gas->state = INITIAL;
RETURN(s->tok[0]);
}
yy21: yych = *++YYCURSOR;
goto yy37;
yy22: yych = *++YYCURSOR;
if(yybm[0+yych] & 2) {
goto yy33;
}
goto yy23;
yy23:
{
yasm_warn_set(YASM_WARN_UNREC_CHAR,
N_("ignoring unrecognized character `%s'"),
yasm__conv_unprint(s->tok[0]));
goto scan;
}
yy24: yych = *++YYCURSOR;
goto yy25;
yy25:
{
if (parser_gas->is_cpp_preproc)
{
RETURN(CPP_LINE_MARKER);
} else
goto line_comment;
}
yy26: yych = *++YYCURSOR;
goto yy32;
yy27:
{ goto scan; }
yy28: yych = *++YYCURSOR;
goto yy29;
yy29:
{
if (parser_gas->save_input)
cursor = save_line(parser_gas, cursor);
parser_gas->state = INITIAL;
RETURN(s->tok[0]);
}
yy30: yych = *++YYCURSOR;
goto yy23;
yy31: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy32;
yy32: if(yybm[0+yych] & 1) {
goto yy31;
}
goto yy27;
yy33: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy34;
yy34: if(yybm[0+yych] & 2) {
goto yy33;
}
goto yy35;
yy35:
{
savech = s->tok[TOKLEN];
s->tok[TOKLEN] = '\0';
if (parser_gas->is_nasm_preproc && strcmp(TOK+1, "line") == 0) {
s->tok[TOKLEN] = savech;
RETURN(NASM_LINE_MARKER);
}
switch (yasm_arch_parse_check_regtmod
(p_object->arch, TOK+1, TOKLEN-1, &lvalp->arch_data)) {
case YASM_ARCH_REG:
s->tok[TOKLEN] = savech;
RETURN(REG);
case YASM_ARCH_REGGROUP:
s->tok[TOKLEN] = savech;
RETURN(REGGROUP);
case YASM_ARCH_SEGREG:
s->tok[TOKLEN] = savech;
RETURN(SEGREG);
default:
break;
}
yasm_error_set(YASM_ERROR_GENERAL,
N_("Unrecognized register name `%s'"), s->tok);
s->tok[TOKLEN] = savech;
lvalp->arch_data = 0;
RETURN(REG);
}
yy36: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy37;
yy37: if(yybm[0+yych] & 4) {
goto yy36;
}
if(yych != '@') goto yy8;
goto yy38;
yy38: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy39;
yy39: if(yybm[0+yych] & 8) {
goto yy38;
}
goto yy40;
yy40:
{
/* if @ not part of ID, move the scanner cursor to the first @ */
if (!((yasm_objfmt_base *)p_object->objfmt)->module->id_at_ok)
cursor = (unsigned char *)strchr(TOK, '@');
lvalp->str.contents = yasm__xstrndup(TOK, TOKLEN);
lvalp->str.len = TOKLEN;
RETURN(ID);
}
yy41: yych = *++YYCURSOR;
goto yy42;
yy42:
{ goto line_comment; }
yy43: yych = *++YYCURSOR;
goto yy44;
yy44:
{ parser_gas->state = COMMENT; goto comment; }
yy45: yych = *++YYCURSOR;
goto yy46;
yy46:
{ RETURN(RIGHT_OP); }
yy47: yych = *++YYCURSOR;
goto yy48;
yy48:
{ RETURN(LEFT_OP); }
yy49: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
yych = *YYCURSOR;
goto yy50;
yy50: if(yybm[0+yych] & 16) {
goto yy49;
}
if(yych <= 'E'){
if(yych <= '.'){
if(yych == '$') goto yy36;
if(yych >= '.') goto yy36;
goto yy51;
} else {
if(yych <= '?') goto yy51;
if(yych <= '@') goto yy38;
if(yych <= 'D') goto yy36;
goto yy52;
}
} else {
if(yych <= '`'){
if(yych <= 'Z') goto yy36;
if(yych == '_') goto yy36;
goto yy51;
} else {
if(yych == 'e') goto yy52;
if(yych <= 'z') goto yy36;
goto yy51;
}
}
yy51:
{
savech = s->tok[TOKLEN];
s->tok[TOKLEN] = '\0';
lvalp->flt = yasm_floatnum_create(TOK);
s->tok[TOKLEN] = savech;
RETURN(FLTNUM);
}
yy52: yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych == '+') goto yy55;
goto yy37;
} else {
if(yych <= '-') goto yy55;
if(yych <= '/') goto yy37;
if(yych >= ':') goto yy37;
goto yy53;
}
yy53: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy54;
yy54: if(yych <= '?'){
if(yych <= '-'){
if(yych == '$') goto yy36;
goto yy51;
} else {
if(yych <= '.') goto yy36;
if(yych <= '/') goto yy51;
if(yych <= '9') goto yy53;
goto yy51;
}
} else {
if(yych <= '^'){
if(yych <= '@') goto yy38;
if(yych <= 'Z') goto yy36;
goto yy51;
} else {
if(yych == '`') goto yy51;
if(yych <= 'z') goto yy36;
goto yy51;
}
}
yy55: yych = *++YYCURSOR;
if(yych <= '/') goto yy56;
if(yych <= '9') goto yy57;
goto yy56;
yy56: YYCURSOR = YYMARKER;
switch(yyaccept){
case 0: goto yy3;
case 6: goto yy91;
case 3: goto yy51;
case 4: goto yy66;
case 5: goto yy87;
case 1: goto yy6;
case 2: goto yy8;
}
yy57: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy58;
yy58: if(yych <= '/') goto yy51;
if(yych <= '9') goto yy57;
goto yy51;
yy59: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yych = *YYCURSOR;
goto yy60;
yy60: if(yych == '.') goto yy65;
if(yych <= '/') goto yy56;
if(yych <= '9') goto yy59;
goto yy56;
yy61: yych = *++YYCURSOR;
if(yych <= '/') goto yy56;
if(yych >= ':') goto yy56;
goto yy62;
yy62: yyaccept = 3;
YYMARKER = ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
yych = *YYCURSOR;
goto yy63;
yy63: if(yych <= 'D'){
if(yych <= '/') goto yy51;
if(yych <= '9') goto yy62;
goto yy51;
} else {
if(yych <= 'E') goto yy64;
if(yych != 'e') goto yy51;
goto yy64;
}
yy64: yych = *++YYCURSOR;
if(yych <= ','){
if(yych == '+') goto yy55;
goto yy56;
} else {
if(yych <= '-') goto yy55;
if(yych <= '/') goto yy56;
if(yych <= '9') goto yy57;
goto yy56;
}
yy65: yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '/') goto yy66;
if(yych <= '9') goto yy67;
goto yy66;
} else {
if(yych <= 'E') goto yy69;
if(yych == 'e') goto yy69;
goto yy66;
}
yy66:
{
savech = s->tok[TOKLEN];
s->tok[TOKLEN] = '\0';
lvalp->flt = yasm_floatnum_create(TOK);
s->tok[TOKLEN] = savech;
RETURN(FLTNUM);
}
yy67: yyaccept = 3;
YYMARKER = ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
yych = *YYCURSOR;
goto yy68;
yy68: if(yych <= 'D'){
if(yych <= '/') goto yy51;
if(yych <= '9') goto yy67;
goto yy51;
} else {
if(yych <= 'E') goto yy73;
if(yych == 'e') goto yy73;
goto yy51;
}
yy69: yych = *++YYCURSOR;
if(yych <= ','){
if(yych != '+') goto yy56;
goto yy70;
} else {
if(yych <= '-') goto yy70;
if(yych <= '/') goto yy56;
if(yych <= '9') goto yy71;
goto yy56;
}
yy70: yych = *++YYCURSOR;
if(yych <= '/') goto yy56;
if(yych >= ':') goto yy56;
goto yy71;
yy71: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy72;
yy72: if(yych <= '/') goto yy66;
if(yych <= '9') goto yy71;
goto yy66;
yy73: yych = *++YYCURSOR;
if(yych <= ','){
if(yych != '+') goto yy56;
goto yy74;
} else {
if(yych <= '-') goto yy74;
if(yych <= '/') goto yy56;
if(yych <= '9') goto yy75;
goto yy56;
}
yy74: yych = *++YYCURSOR;
if(yych <= '/') goto yy56;
if(yych >= ':') goto yy56;
goto yy75;
yy75: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy76;
yy76: if(yych <= '/') goto yy51;
if(yych <= '9') goto yy75;
goto yy51;
yy77: yych = *++YYCURSOR;
goto yy78;
yy78:
{
/* build local label name */
lvalp->str.contents = yasm_xmalloc(30);
lvalp->str.len =
sprintf(lvalp->str.contents, "L%c\001%lu", s->tok[0],
parser_gas->local[s->tok[0]-'0']);
RETURN(ID);
}
yy79: yych = *++YYCURSOR;
goto yy80;
yy80:
{
/* build local label name */
lvalp->str.contents = yasm_xmalloc(30);
lvalp->str.len =
sprintf(lvalp->str.contents, "L%c\001%lu", s->tok[0],
parser_gas->local[s->tok[0]-'0']+1);
RETURN(ID);
}
yy81: yych = *++YYCURSOR;
goto yy82;
yy82:
{
/* increment label index */
parser_gas->local[s->tok[0]-'0']++;
/* build local label name */
lvalp->str.contents = yasm_xmalloc(30);
lvalp->str.len =
sprintf(lvalp->str.contents, "L%c\001%lu", s->tok[0],
parser_gas->local[s->tok[0]-'0']);
RETURN(LABEL);
}
yy83: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yych = *YYCURSOR;
goto yy84;
yy84: if(yych == '.') goto yy65;
if(yych <= '/') goto yy3;
if(yych <= '9') goto yy83;
goto yy3;
yy85: yych = *++YYCURSOR;
if(yybm[0+yych] & 128) {
goto yy104;
}
goto yy78;
yy86: yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == '+') goto yy96;
if(yych == '-') goto yy96;
goto yy97;
yy87:
{
savech = s->tok[TOKLEN];
s->tok[TOKLEN] = '\0';
lvalp->flt = yasm_floatnum_create(TOK+2);
s->tok[TOKLEN] = savech;
RETURN(FLTNUM);
}
yy88: yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == '+') goto yy96;
if(yych == '-') goto yy96;
goto yy97;
yy89: yyaccept = 6;
YYMARKER = ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yych = *YYCURSOR;
goto yy90;
yy90: if(yybm[0+yych] & 32) {
goto yy89;
}
if(yych == '.') goto yy65;
if(yych <= '/') goto yy91;
if(yych <= '9') goto yy59;
goto yy91;
yy91:
{
savech = s->tok[TOKLEN];
s->tok[TOKLEN] = '\0';
lvalp->intn = yasm_intnum_create_oct(TOK);
s->tok[TOKLEN] = savech;
RETURN(INTNUM);
}
yy92: yych = *++YYCURSOR;
if(yybm[0+yych] & 64) {
goto yy93;
}
goto yy56;
yy93: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy94;
yy94: if(yybm[0+yych] & 64) {
goto yy93;
}
goto yy95;
yy95:
{
savech = s->tok[TOKLEN];
s->tok[TOKLEN] = '\0';
/* skip 0 and x */
lvalp->intn = yasm_intnum_create_hex(TOK+2);
s->tok[TOKLEN] = savech;
RETURN(INTNUM);
}
yy96: yyaccept = 5;
YYMARKER = ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
yych = *YYCURSOR;
goto yy97;
yy97: if(yych <= '9'){
if(yych == '.') goto yy98;
if(yych <= '/') goto yy87;
goto yy96;
} else {
if(yych <= 'E'){
if(yych <= 'D') goto yy87;
goto yy100;
} else {
if(yych == 'e') goto yy100;
goto yy87;
}
}
yy98: yyaccept = 5;
YYMARKER = ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
yych = *YYCURSOR;
goto yy99;
yy99: if(yych <= 'D'){
if(yych <= '/') goto yy87;
if(yych <= '9') goto yy98;
goto yy87;
} else {
if(yych <= 'E') goto yy100;
if(yych != 'e') goto yy87;
goto yy100;
}
yy100: yych = *++YYCURSOR;
if(yych <= ','){
if(yych != '+') goto yy56;
goto yy101;
} else {
if(yych <= '-') goto yy101;
if(yych <= '/') goto yy56;
if(yych <= '9') goto yy102;
goto yy56;
}
yy101: yych = *++YYCURSOR;
if(yych <= '/') goto yy56;
if(yych >= ':') goto yy56;
goto yy102;
yy102: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy103;
yy103: if(yych <= '/') goto yy87;
if(yych <= '9') goto yy102;
goto yy87;
yy104: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy105;
yy105: if(yybm[0+yych] & 128) {
goto yy104;
}
goto yy106;
yy106:
{
savech = s->tok[TOKLEN];
s->tok[TOKLEN] = '\0';
lvalp->intn = yasm_intnum_create_bin(TOK+2);
s->tok[TOKLEN] = savech;
RETURN(INTNUM);
}
}
}
/* C-style comment; nesting not supported */
comment:
SCANINIT();
{
{
YYCTYPE yych;
goto yy107;
++YYCURSOR;
yy107:
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
if(yych == '\n') goto yy111;
if(yych != '*') goto yy113;
goto yy109;
yy109: yych = *++YYCURSOR;
if(yych == '/') goto yy114;
goto yy110;
yy110:
{
if (cursor == s->eof)
return 0;
goto comment;
}
yy111: yych = *++YYCURSOR;
goto yy112;
yy112:
{
if (parser_gas->save_input)
cursor = save_line(parser_gas, cursor);
RETURN(s->tok[0]);
}
yy113: yych = *++YYCURSOR;
goto yy110;
yy114: yych = *++YYCURSOR;
goto yy115;
yy115:
{ parser_gas->state = INITIAL; goto scan; }
}
}
/* Single line comment. */
line_comment:
{
static unsigned char yybm[] = {
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 0, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
{
YYCTYPE yych;
goto yy116;
yy117: ++YYCURSOR;
yy116:
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy118;
yy118: if(yybm[0+yych] & 128) {
goto yy117;
}
goto yy119;
yy119:
{ goto scan; }
}
}
/* .section directive (the section name portion thereof) */
section_directive:
SCANINIT();
{
static unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 64, 0, 0, 0, 64, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
64, 0, 0, 0, 128, 0, 0, 0,
0, 0, 0, 0, 0, 128, 128, 0,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 0, 0, 0, 0, 0, 0,
0, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 0, 0, 0, 0, 128,
0, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
{
YYCTYPE yych;
goto yy120;
++YYCURSOR;
yy120:
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
if(yych <= '$'){
if(yych <= '\r'){
if(yych <= '\t'){
if(yych <= '\b') goto yy132;
goto yy126;
} else {
if(yych <= '\n') goto yy130;
if(yych <= '\f') goto yy132;
goto yy126;
}
} else {
if(yych <= '!'){
if(yych == ' ') goto yy126;
goto yy132;
} else {
if(yych <= '"') goto yy124;
if(yych <= '#') goto yy132;
goto yy122;
}
}
} else {
if(yych <= '@'){
if(yych <= '.'){
if(yych <= '+') goto yy132;
if(yych <= ',') goto yy128;
goto yy122;
} else {
if(yych <= '/') goto yy132;
if(yych >= ':') goto yy132;
goto yy122;
}
} else {
if(yych <= '_'){
if(yych <= 'Z') goto yy122;
if(yych <= '^') goto yy132;
goto yy122;
} else {
if(yych <= '`') goto yy132;
if(yych >= '{') goto yy132;
goto yy122;
}
}
}
yy122: yych = *++YYCURSOR;
goto yy137;
yy123:
{
lvalp->str.contents = yasm__xstrndup(TOK, TOKLEN);
lvalp->str.len = TOKLEN;
parser_gas->state = INITIAL;
RETURN(ID);
}
yy124: yych = *++YYCURSOR;
goto yy125;
yy125:
{ goto stringconst; }
yy126: yych = *++YYCURSOR;
goto yy135;
yy127:
{ goto section_directive; }
yy128: yych = *++YYCURSOR;
goto yy129;
yy129:
{
parser_gas->state = INITIAL;
RETURN(s->tok[0]);
}
yy130: yych = *++YYCURSOR;
goto yy131;
yy131:
{
if (parser_gas->save_input)
cursor = save_line(parser_gas, cursor);
parser_gas->state = INITIAL;
RETURN(s->tok[0]);
}
yy132: yych = *++YYCURSOR;
goto yy133;
yy133:
{
yasm_warn_set(YASM_WARN_UNREC_CHAR,
N_("ignoring unrecognized character `%s'"),
yasm__conv_unprint(s->tok[0]));
goto section_directive;
}
yy134: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy135;
yy135: if(yybm[0+yych] & 64) {
goto yy134;
}
goto yy127;
yy136: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy137;
yy137: if(yybm[0+yych] & 128) {
goto yy136;
}
goto yy123;
}
}
/* filename portion of nasm preproc %line */
nasm_filename:
strbuf = yasm_xmalloc(STRBUF_ALLOC_SIZE);
strbuf_size = STRBUF_ALLOC_SIZE;
count = 0;
nasm_filename_scan:
SCANINIT();
{
static unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 128, 0, 0, 0, 128, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
128, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
{
YYCTYPE yych;
goto yy138;
++YYCURSOR;
yy138:
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
if(yych <= '\f'){
if(yych <= '\b') goto yy144;
if(yych <= '\t') goto yy142;
if(yych >= '\v') goto yy144;
goto yy140;
} else {
if(yych <= '\r') goto yy142;
if(yych == ' ') goto yy142;
goto yy144;
}
yy140: yych = *++YYCURSOR;
goto yy141;
yy141:
{
strbuf_append(count++, cursor, s, '\0');
lvalp->str.contents = (char *)strbuf;
lvalp->str.len = count;
parser_gas->state = INITIAL;
RETURN(STRING);
}
yy142: yych = *++YYCURSOR;
goto yy147;
yy143:
{ goto nasm_filename_scan; }
yy144: yych = *++YYCURSOR;
goto yy145;
yy145:
{
if (cursor == s->eof) {
strbuf_append(count++, cursor, s, '\0');
lvalp->str.contents = (char *)strbuf;
lvalp->str.len = count;
parser_gas->state = INITIAL;
RETURN(STRING);
}
strbuf_append(count++, cursor, s, s->tok[0]);
goto nasm_filename_scan;
}
yy146: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy147;
yy147: if(yybm[0+yych] & 128) {
goto yy146;
}
goto yy143;
}
}
/* character constant values */
charconst:
/*TODO*/
/* string constant values */
stringconst:
strbuf = yasm_xmalloc(STRBUF_ALLOC_SIZE);
strbuf_size = STRBUF_ALLOC_SIZE;
count = 0;
stringconst_scan:
SCANINIT();
{
{
YYCTYPE yych;
goto yy148;
++YYCURSOR;
yy148:
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
if(yych == '"') goto yy152;
if(yych != '\\') goto yy154;
goto yy150;
yy150: yych = *++YYCURSOR;
if(yych != '\n') goto yy155;
goto yy151;
yy151:
{
if (cursor == s->eof) {
yasm_error_set(YASM_ERROR_SYNTAX,
N_("unexpected end of file in string"));
lvalp->str.contents = (char *)strbuf;
lvalp->str.len = count;
RETURN(STRING);
}
strbuf_append(count++, cursor, s, s->tok[0]);
goto stringconst_scan;
}
yy152: yych = *++YYCURSOR;
goto yy153;
yy153:
{
strbuf_append(count, cursor, s, '\0');
yasm_unescape_cstring(strbuf, &count);
lvalp->str.contents = (char *)strbuf;
lvalp->str.len = count;
RETURN(STRING);
}
yy154: yych = *++YYCURSOR;
goto yy151;
yy155: yych = *++YYCURSOR;
goto yy156;
yy156:
{
if (cursor == s->eof) {
yasm_error_set(YASM_ERROR_SYNTAX,
N_("unexpected end of file in string"));
lvalp->str.contents = (char *)strbuf;
lvalp->str.len = count;
RETURN(STRING);
}
strbuf_append(count++, cursor, s, '\\');
strbuf_append(count++, cursor, s, s->tok[1]);
goto stringconst_scan;
}
}
}
}
|