gas-token.c 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407
  1. /* Generated by re2c
  2. */
  3. /*
  4. * GAS-compatible re2c lexer
  5. *
  6. * Copyright (C) 2005-2007 Peter Johnson
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * 2. Redistributions in binary form must reproduce the above copyright
  14. * notice, this list of conditions and the following disclaimer in the
  15. * documentation and/or other materials provided with the distribution.
  16. * 3. Neither the name of the author nor the names of other contributors
  17. * may be used to endorse or promote products derived from this
  18. * software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS''
  21. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE
  24. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  25. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  26. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  27. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  28. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  29. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  30. * POSSIBILITY OF SUCH DAMAGE.
  31. */
  32. #include <util.h>
  33. #include <libyasm.h>
  34. #include "modules/parsers/gas/gas-parser.h"
  35. #define BSIZE 8192
  36. #define YYCURSOR cursor
  37. #define YYLIMIT (s->lim)
  38. #define YYMARKER (s->ptr)
  39. #define YYFILL(n) {cursor = fill(parser_gas, cursor);}
  40. #define RETURN(i) do {s->cur = cursor; parser_gas->tokch = s->tok[0]; \
  41. return i;} while (0)
  42. #define SCANINIT() {s->tok = cursor;}
  43. #define TOK ((char *)s->tok)
  44. #define TOKLEN (size_t)(cursor-s->tok)
  45. /* Bridge function to convert byte-oriented parser with line-oriented
  46. * preprocessor.
  47. */
  48. static size_t
  49. preproc_input(yasm_parser_gas *parser_gas, /*@out@*/ YYCTYPE *buf,
  50. size_t max_size)
  51. {
  52. size_t tot=0;
  53. while (max_size > 0) {
  54. size_t n;
  55. if (!parser_gas->line) {
  56. parser_gas->line = yasm_preproc_get_line(parser_gas->preproc);
  57. if (!parser_gas->line)
  58. return tot; /* EOF */
  59. parser_gas->linepos = parser_gas->line;
  60. parser_gas->lineleft = strlen(parser_gas->line) + 1;
  61. parser_gas->line[parser_gas->lineleft-1] = '\n';
  62. }
  63. n = parser_gas->lineleft<max_size ? parser_gas->lineleft : max_size;
  64. strncpy((char *)buf+tot, parser_gas->linepos, n);
  65. if (n == parser_gas->lineleft) {
  66. yasm_xfree(parser_gas->line);
  67. parser_gas->line = NULL;
  68. } else {
  69. parser_gas->lineleft -= n;
  70. parser_gas->linepos += n;
  71. }
  72. tot += n;
  73. max_size -= n;
  74. }
  75. return tot;
  76. }
  77. #if 0
  78. static size_t
  79. fill_input(void *d, unsigned char *buf, size_t max)
  80. {
  81. return yasm_preproc_input((yasm_preproc *)d, (char *)buf, max);
  82. }
  83. #endif
  84. static YYCTYPE *
  85. fill(yasm_parser_gas *parser_gas, YYCTYPE *cursor)
  86. {
  87. yasm_scanner *s = &parser_gas->s;
  88. int first = 0;
  89. if(!s->eof){
  90. size_t cnt = s->tok - s->bot;
  91. if(cnt){
  92. memmove(s->bot, s->tok, (size_t)(s->lim - s->tok));
  93. s->tok = s->bot;
  94. s->ptr -= cnt;
  95. cursor -= cnt;
  96. s->lim -= cnt;
  97. }
  98. if (!s->bot)
  99. first = 1;
  100. if((s->top - s->lim) < BSIZE){
  101. YYCTYPE *buf = yasm_xmalloc((size_t)(s->lim - s->bot) + BSIZE);
  102. memcpy(buf, s->tok, (size_t)(s->lim - s->tok));
  103. s->tok = buf;
  104. s->ptr = &buf[s->ptr - s->bot];
  105. cursor = &buf[cursor - s->bot];
  106. s->lim = &buf[s->lim - s->bot];
  107. s->top = &s->lim[BSIZE];
  108. if (s->bot)
  109. yasm_xfree(s->bot);
  110. s->bot = buf;
  111. }
  112. if((cnt = preproc_input(parser_gas, s->lim, BSIZE)) == 0) {
  113. s->eof = &s->lim[cnt]; *s->eof++ = '\n';
  114. }
  115. s->lim += cnt;
  116. if (first && parser_gas->save_input) {
  117. int i;
  118. YYCTYPE *saveline;
  119. parser_gas->save_last ^= 1;
  120. saveline = parser_gas->save_line[parser_gas->save_last];
  121. /* save next line into cur_line */
  122. for (i=0; i<79 && &s->tok[i] < s->lim && s->tok[i] != '\n'; i++)
  123. saveline[i] = s->tok[i];
  124. saveline[i] = '\0';
  125. }
  126. }
  127. return cursor;
  128. }
  129. static YYCTYPE *
  130. save_line(yasm_parser_gas *parser_gas, YYCTYPE *cursor)
  131. {
  132. yasm_scanner *s = &parser_gas->s;
  133. int i = 0;
  134. YYCTYPE *saveline;
  135. parser_gas->save_last ^= 1;
  136. saveline = parser_gas->save_line[parser_gas->save_last];
  137. /* save next line into cur_line */
  138. if ((YYLIMIT - YYCURSOR) < 80)
  139. YYFILL(80);
  140. for (i=0; i<79 && &cursor[i] < s->lim && cursor[i] != '\n'; i++)
  141. saveline[i] = cursor[i];
  142. saveline[i] = '\0';
  143. return cursor;
  144. }
  145. /* starting size of string buffer */
  146. #define STRBUF_ALLOC_SIZE 128
  147. /* string buffer used when parsing strings/character constants */
  148. static YYCTYPE *strbuf = NULL;
  149. /* length of strbuf (including terminating NULL character) */
  150. static size_t strbuf_size = 0;
  151. static void
  152. strbuf_append(size_t count, YYCTYPE *cursor, yasm_scanner *s, int ch)
  153. {
  154. if (count >= strbuf_size) {
  155. strbuf = yasm_xrealloc(strbuf, strbuf_size + STRBUF_ALLOC_SIZE);
  156. strbuf_size += STRBUF_ALLOC_SIZE;
  157. }
  158. strbuf[count] = ch;
  159. }
  160. int
  161. gas_parser_lex(YYSTYPE *lvalp, yasm_parser_gas *parser_gas)
  162. {
  163. yasm_scanner *s = &parser_gas->s;
  164. YYCTYPE *cursor = s->cur;
  165. size_t count;
  166. YYCTYPE savech;
  167. /* Handle one token of lookahead */
  168. if (parser_gas->peek_token != NONE) {
  169. int tok = parser_gas->peek_token;
  170. *lvalp = parser_gas->peek_tokval; /* structure copy */
  171. parser_gas->tokch = parser_gas->peek_tokch;
  172. parser_gas->peek_token = NONE;
  173. return tok;
  174. }
  175. /* Catch EOF */
  176. if (s->eof && cursor == s->eof)
  177. return 0;
  178. /* Jump to proper "exclusive" states */
  179. switch (parser_gas->state) {
  180. case COMMENT:
  181. goto comment;
  182. case SECTION_DIRECTIVE:
  183. goto section_directive;
  184. case NASM_FILENAME:
  185. goto nasm_filename;
  186. default:
  187. break;
  188. }
  189. scan:
  190. SCANINIT();
  191. {
  192. static unsigned char yybm[] = {
  193. 0, 0, 0, 0, 0, 0, 0, 0,
  194. 0, 1, 0, 0, 0, 1, 0, 0,
  195. 0, 0, 0, 0, 0, 0, 0, 0,
  196. 0, 0, 0, 0, 0, 0, 0, 0,
  197. 1, 0, 0, 0, 12, 0, 0, 0,
  198. 0, 0, 0, 0, 0, 0, 12, 0,
  199. 254, 254, 126, 126, 126, 126, 126, 126,
  200. 94, 94, 0, 0, 0, 0, 0, 0,
  201. 8, 78, 78, 78, 78, 78, 78, 14,
  202. 14, 14, 14, 14, 14, 14, 14, 14,
  203. 14, 14, 14, 14, 14, 14, 14, 14,
  204. 14, 14, 14, 0, 0, 0, 0, 12,
  205. 0, 78, 78, 78, 78, 78, 78, 14,
  206. 14, 14, 14, 14, 14, 14, 14, 14,
  207. 14, 14, 14, 14, 14, 14, 14, 14,
  208. 14, 14, 14, 0, 0, 0, 0, 0,
  209. 0, 0, 0, 0, 0, 0, 0, 0,
  210. 0, 0, 0, 0, 0, 0, 0, 0,
  211. 0, 0, 0, 0, 0, 0, 0, 0,
  212. 0, 0, 0, 0, 0, 0, 0, 0,
  213. 0, 0, 0, 0, 0, 0, 0, 0,
  214. 0, 0, 0, 0, 0, 0, 0, 0,
  215. 0, 0, 0, 0, 0, 0, 0, 0,
  216. 0, 0, 0, 0, 0, 0, 0, 0,
  217. 0, 0, 0, 0, 0, 0, 0, 0,
  218. 0, 0, 0, 0, 0, 0, 0, 0,
  219. 0, 0, 0, 0, 0, 0, 0, 0,
  220. 0, 0, 0, 0, 0, 0, 0, 0,
  221. 0, 0, 0, 0, 0, 0, 0, 0,
  222. 0, 0, 0, 0, 0, 0, 0, 0,
  223. 0, 0, 0, 0, 0, 0, 0, 0,
  224. 0, 0, 0, 0, 0, 0, 0, 0,
  225. };
  226. {
  227. YYCTYPE yych;
  228. unsigned int yyaccept;
  229. goto yy0;
  230. ++YYCURSOR;
  231. yy0:
  232. if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
  233. yych = *YYCURSOR;
  234. if(yych <= '/'){
  235. if(yych <= '#'){
  236. if(yych <= '\r'){
  237. if(yych <= '\t'){
  238. if(yych <= '\b') goto yy30;
  239. goto yy26;
  240. } else {
  241. if(yych <= '\n') goto yy28;
  242. if(yych <= '\f') goto yy30;
  243. goto yy26;
  244. }
  245. } else {
  246. if(yych <= ' '){
  247. if(yych <= '\037') goto yy30;
  248. goto yy26;
  249. } else {
  250. if(yych <= '!') goto yy17;
  251. if(yych <= '"') goto yy11;
  252. goto yy24;
  253. }
  254. }
  255. } else {
  256. if(yych <= '*'){
  257. if(yych <= '%'){
  258. if(yych <= '$') goto yy17;
  259. goto yy22;
  260. } else {
  261. if(yych == '\'') goto yy9;
  262. goto yy17;
  263. }
  264. } else {
  265. if(yych <= ','){
  266. if(yych <= '+') goto yy5;
  267. goto yy17;
  268. } else {
  269. if(yych <= '-') goto yy5;
  270. if(yych <= '.') goto yy7;
  271. goto yy18;
  272. }
  273. }
  274. }
  275. } else {
  276. if(yych <= 'Z'){
  277. if(yych <= '<'){
  278. if(yych <= '9'){
  279. if(yych >= '1') goto yy4;
  280. goto yy2;
  281. } else {
  282. if(yych <= ':') goto yy17;
  283. if(yych <= ';') goto yy19;
  284. goto yy13;
  285. }
  286. } else {
  287. if(yych <= '>'){
  288. if(yych <= '=') goto yy17;
  289. goto yy15;
  290. } else {
  291. if(yych <= '?') goto yy30;
  292. if(yych <= '@') goto yy17;
  293. goto yy21;
  294. }
  295. }
  296. } else {
  297. if(yych <= 'z'){
  298. if(yych <= '^'){
  299. if(yych <= ']') goto yy30;
  300. goto yy17;
  301. } else {
  302. if(yych == '`') goto yy30;
  303. goto yy21;
  304. }
  305. } else {
  306. if(yych <= '|'){
  307. if(yych <= '{') goto yy30;
  308. goto yy17;
  309. } else {
  310. if(yych == '~') goto yy17;
  311. goto yy30;
  312. }
  313. }
  314. }
  315. }
  316. yy2: yyaccept = 0;
  317. yych = *(YYMARKER = ++YYCURSOR);
  318. if(yych <= 'T'){
  319. if(yych <= 'A'){
  320. if(yych <= '/'){
  321. if(yych == '.') goto yy90;
  322. goto yy3;
  323. } else {
  324. if(yych <= '9') goto yy90;
  325. if(yych <= ':') goto yy81;
  326. goto yy3;
  327. }
  328. } else {
  329. if(yych <= 'E'){
  330. if(yych <= 'B') goto yy85;
  331. if(yych >= 'D') goto yy88;
  332. goto yy3;
  333. } else {
  334. if(yych <= 'F') goto yy86;
  335. if(yych >= 'T') goto yy88;
  336. goto yy3;
  337. }
  338. }
  339. } else {
  340. if(yych <= 'e'){
  341. if(yych <= 'a'){
  342. if(yych == 'X') goto yy92;
  343. goto yy3;
  344. } else {
  345. if(yych <= 'b') goto yy85;
  346. if(yych >= 'd') goto yy88;
  347. goto yy3;
  348. }
  349. } else {
  350. if(yych <= 't'){
  351. if(yych <= 'f') goto yy86;
  352. if(yych >= 't') goto yy88;
  353. goto yy3;
  354. } else {
  355. if(yych == 'x') goto yy92;
  356. goto yy3;
  357. }
  358. }
  359. }
  360. yy3:
  361. {
  362. savech = s->tok[TOKLEN];
  363. s->tok[TOKLEN] = '\0';
  364. lvalp->intn = yasm_intnum_create_dec(TOK);
  365. s->tok[TOKLEN] = savech;
  366. RETURN(INTNUM);
  367. }
  368. yy4: yych = *++YYCURSOR;
  369. if(yych <= 'E'){
  370. if(yych <= ':'){
  371. if(yych <= '9') goto yy84;
  372. goto yy81;
  373. } else {
  374. if(yych == 'B') goto yy77;
  375. goto yy84;
  376. }
  377. } else {
  378. if(yych <= 'b'){
  379. if(yych <= 'F') goto yy79;
  380. if(yych <= 'a') goto yy84;
  381. goto yy77;
  382. } else {
  383. if(yych == 'f') goto yy79;
  384. goto yy84;
  385. }
  386. }
  387. yy5: yyaccept = 1;
  388. yych = *(YYMARKER = ++YYCURSOR);
  389. if(yych == '.') goto yy61;
  390. if(yych <= '/') goto yy6;
  391. if(yych <= '9') goto yy59;
  392. goto yy6;
  393. yy6:
  394. { RETURN(s->tok[0]); }
  395. yy7: yych = *++YYCURSOR;
  396. if(yybm[0+yych] & 16) {
  397. goto yy49;
  398. }
  399. goto yy37;
  400. yy8:
  401. {
  402. lvalp->str.contents = yasm__xstrndup(TOK, TOKLEN);
  403. lvalp->str.len = TOKLEN;
  404. RETURN(ID);
  405. }
  406. yy9: yych = *++YYCURSOR;
  407. goto yy10;
  408. yy10:
  409. {
  410. goto charconst;
  411. }
  412. yy11: yych = *++YYCURSOR;
  413. goto yy12;
  414. yy12:
  415. {
  416. goto stringconst;
  417. }
  418. yy13: yych = *++YYCURSOR;
  419. if(yych == '<') goto yy47;
  420. goto yy14;
  421. yy14:
  422. { RETURN(LEFT_OP); }
  423. yy15: yych = *++YYCURSOR;
  424. if(yych == '>') goto yy45;
  425. goto yy16;
  426. yy16:
  427. { RETURN(RIGHT_OP); }
  428. yy17: yych = *++YYCURSOR;
  429. goto yy6;
  430. yy18: yych = *++YYCURSOR;
  431. if(yych == '*') goto yy43;
  432. if(yych == '/') goto yy41;
  433. goto yy6;
  434. yy19: yych = *++YYCURSOR;
  435. goto yy20;
  436. yy20:
  437. {
  438. parser_gas->state = INITIAL;
  439. RETURN(s->tok[0]);
  440. }
  441. yy21: yych = *++YYCURSOR;
  442. goto yy37;
  443. yy22: yych = *++YYCURSOR;
  444. if(yybm[0+yych] & 2) {
  445. goto yy33;
  446. }
  447. goto yy23;
  448. yy23:
  449. {
  450. yasm_warn_set(YASM_WARN_UNREC_CHAR,
  451. N_("ignoring unrecognized character `%s'"),
  452. yasm__conv_unprint(s->tok[0]));
  453. goto scan;
  454. }
  455. yy24: yych = *++YYCURSOR;
  456. goto yy25;
  457. yy25:
  458. {
  459. if (parser_gas->is_cpp_preproc)
  460. {
  461. RETURN(CPP_LINE_MARKER);
  462. } else
  463. goto line_comment;
  464. }
  465. yy26: yych = *++YYCURSOR;
  466. goto yy32;
  467. yy27:
  468. { goto scan; }
  469. yy28: yych = *++YYCURSOR;
  470. goto yy29;
  471. yy29:
  472. {
  473. if (parser_gas->save_input)
  474. cursor = save_line(parser_gas, cursor);
  475. parser_gas->state = INITIAL;
  476. RETURN(s->tok[0]);
  477. }
  478. yy30: yych = *++YYCURSOR;
  479. goto yy23;
  480. yy31: ++YYCURSOR;
  481. if(YYLIMIT == YYCURSOR) YYFILL(1);
  482. yych = *YYCURSOR;
  483. goto yy32;
  484. yy32: if(yybm[0+yych] & 1) {
  485. goto yy31;
  486. }
  487. goto yy27;
  488. yy33: ++YYCURSOR;
  489. if(YYLIMIT == YYCURSOR) YYFILL(1);
  490. yych = *YYCURSOR;
  491. goto yy34;
  492. yy34: if(yybm[0+yych] & 2) {
  493. goto yy33;
  494. }
  495. goto yy35;
  496. yy35:
  497. {
  498. savech = s->tok[TOKLEN];
  499. s->tok[TOKLEN] = '\0';
  500. if (parser_gas->is_nasm_preproc && strcmp(TOK+1, "line") == 0) {
  501. s->tok[TOKLEN] = savech;
  502. RETURN(NASM_LINE_MARKER);
  503. }
  504. switch (yasm_arch_parse_check_regtmod
  505. (p_object->arch, TOK+1, TOKLEN-1, &lvalp->arch_data)) {
  506. case YASM_ARCH_REG:
  507. s->tok[TOKLEN] = savech;
  508. RETURN(REG);
  509. case YASM_ARCH_REGGROUP:
  510. s->tok[TOKLEN] = savech;
  511. RETURN(REGGROUP);
  512. case YASM_ARCH_SEGREG:
  513. s->tok[TOKLEN] = savech;
  514. RETURN(SEGREG);
  515. default:
  516. break;
  517. }
  518. yasm_error_set(YASM_ERROR_GENERAL,
  519. N_("Unrecognized register name `%s'"), s->tok);
  520. s->tok[TOKLEN] = savech;
  521. lvalp->arch_data = 0;
  522. RETURN(REG);
  523. }
  524. yy36: ++YYCURSOR;
  525. if(YYLIMIT == YYCURSOR) YYFILL(1);
  526. yych = *YYCURSOR;
  527. goto yy37;
  528. yy37: if(yybm[0+yych] & 4) {
  529. goto yy36;
  530. }
  531. if(yych != '@') goto yy8;
  532. goto yy38;
  533. yy38: ++YYCURSOR;
  534. if(YYLIMIT == YYCURSOR) YYFILL(1);
  535. yych = *YYCURSOR;
  536. goto yy39;
  537. yy39: if(yybm[0+yych] & 8) {
  538. goto yy38;
  539. }
  540. goto yy40;
  541. yy40:
  542. {
  543. /* if @ not part of ID, move the scanner cursor to the first @ */
  544. if (!((yasm_objfmt_base *)p_object->objfmt)->module->id_at_ok)
  545. cursor = (unsigned char *)strchr(TOK, '@');
  546. lvalp->str.contents = yasm__xstrndup(TOK, TOKLEN);
  547. lvalp->str.len = TOKLEN;
  548. RETURN(ID);
  549. }
  550. yy41: yych = *++YYCURSOR;
  551. goto yy42;
  552. yy42:
  553. { goto line_comment; }
  554. yy43: yych = *++YYCURSOR;
  555. goto yy44;
  556. yy44:
  557. { parser_gas->state = COMMENT; goto comment; }
  558. yy45: yych = *++YYCURSOR;
  559. goto yy46;
  560. yy46:
  561. { RETURN(RIGHT_OP); }
  562. yy47: yych = *++YYCURSOR;
  563. goto yy48;
  564. yy48:
  565. { RETURN(LEFT_OP); }
  566. yy49: ++YYCURSOR;
  567. if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
  568. yych = *YYCURSOR;
  569. goto yy50;
  570. yy50: if(yybm[0+yych] & 16) {
  571. goto yy49;
  572. }
  573. if(yych <= 'E'){
  574. if(yych <= '.'){
  575. if(yych == '$') goto yy36;
  576. if(yych >= '.') goto yy36;
  577. goto yy51;
  578. } else {
  579. if(yych <= '?') goto yy51;
  580. if(yych <= '@') goto yy38;
  581. if(yych <= 'D') goto yy36;
  582. goto yy52;
  583. }
  584. } else {
  585. if(yych <= '`'){
  586. if(yych <= 'Z') goto yy36;
  587. if(yych == '_') goto yy36;
  588. goto yy51;
  589. } else {
  590. if(yych == 'e') goto yy52;
  591. if(yych <= 'z') goto yy36;
  592. goto yy51;
  593. }
  594. }
  595. yy51:
  596. {
  597. savech = s->tok[TOKLEN];
  598. s->tok[TOKLEN] = '\0';
  599. lvalp->flt = yasm_floatnum_create(TOK);
  600. s->tok[TOKLEN] = savech;
  601. RETURN(FLTNUM);
  602. }
  603. yy52: yyaccept = 2;
  604. yych = *(YYMARKER = ++YYCURSOR);
  605. if(yych <= ','){
  606. if(yych == '+') goto yy55;
  607. goto yy37;
  608. } else {
  609. if(yych <= '-') goto yy55;
  610. if(yych <= '/') goto yy37;
  611. if(yych >= ':') goto yy37;
  612. goto yy53;
  613. }
  614. yy53: ++YYCURSOR;
  615. if(YYLIMIT == YYCURSOR) YYFILL(1);
  616. yych = *YYCURSOR;
  617. goto yy54;
  618. yy54: if(yych <= '?'){
  619. if(yych <= '-'){
  620. if(yych == '$') goto yy36;
  621. goto yy51;
  622. } else {
  623. if(yych <= '.') goto yy36;
  624. if(yych <= '/') goto yy51;
  625. if(yych <= '9') goto yy53;
  626. goto yy51;
  627. }
  628. } else {
  629. if(yych <= '^'){
  630. if(yych <= '@') goto yy38;
  631. if(yych <= 'Z') goto yy36;
  632. goto yy51;
  633. } else {
  634. if(yych == '`') goto yy51;
  635. if(yych <= 'z') goto yy36;
  636. goto yy51;
  637. }
  638. }
  639. yy55: yych = *++YYCURSOR;
  640. if(yych <= '/') goto yy56;
  641. if(yych <= '9') goto yy57;
  642. goto yy56;
  643. yy56: YYCURSOR = YYMARKER;
  644. switch(yyaccept){
  645. case 0: goto yy3;
  646. case 6: goto yy91;
  647. case 3: goto yy51;
  648. case 4: goto yy66;
  649. case 5: goto yy87;
  650. case 1: goto yy6;
  651. case 2: goto yy8;
  652. }
  653. yy57: ++YYCURSOR;
  654. if(YYLIMIT == YYCURSOR) YYFILL(1);
  655. yych = *YYCURSOR;
  656. goto yy58;
  657. yy58: if(yych <= '/') goto yy51;
  658. if(yych <= '9') goto yy57;
  659. goto yy51;
  660. yy59: ++YYCURSOR;
  661. if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
  662. yych = *YYCURSOR;
  663. goto yy60;
  664. yy60: if(yych == '.') goto yy65;
  665. if(yych <= '/') goto yy56;
  666. if(yych <= '9') goto yy59;
  667. goto yy56;
  668. yy61: yych = *++YYCURSOR;
  669. if(yych <= '/') goto yy56;
  670. if(yych >= ':') goto yy56;
  671. goto yy62;
  672. yy62: yyaccept = 3;
  673. YYMARKER = ++YYCURSOR;
  674. if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
  675. yych = *YYCURSOR;
  676. goto yy63;
  677. yy63: if(yych <= 'D'){
  678. if(yych <= '/') goto yy51;
  679. if(yych <= '9') goto yy62;
  680. goto yy51;
  681. } else {
  682. if(yych <= 'E') goto yy64;
  683. if(yych != 'e') goto yy51;
  684. goto yy64;
  685. }
  686. yy64: yych = *++YYCURSOR;
  687. if(yych <= ','){
  688. if(yych == '+') goto yy55;
  689. goto yy56;
  690. } else {
  691. if(yych <= '-') goto yy55;
  692. if(yych <= '/') goto yy56;
  693. if(yych <= '9') goto yy57;
  694. goto yy56;
  695. }
  696. yy65: yyaccept = 4;
  697. yych = *(YYMARKER = ++YYCURSOR);
  698. if(yych <= 'D'){
  699. if(yych <= '/') goto yy66;
  700. if(yych <= '9') goto yy67;
  701. goto yy66;
  702. } else {
  703. if(yych <= 'E') goto yy69;
  704. if(yych == 'e') goto yy69;
  705. goto yy66;
  706. }
  707. yy66:
  708. {
  709. savech = s->tok[TOKLEN];
  710. s->tok[TOKLEN] = '\0';
  711. lvalp->flt = yasm_floatnum_create(TOK);
  712. s->tok[TOKLEN] = savech;
  713. RETURN(FLTNUM);
  714. }
  715. yy67: yyaccept = 3;
  716. YYMARKER = ++YYCURSOR;
  717. if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
  718. yych = *YYCURSOR;
  719. goto yy68;
  720. yy68: if(yych <= 'D'){
  721. if(yych <= '/') goto yy51;
  722. if(yych <= '9') goto yy67;
  723. goto yy51;
  724. } else {
  725. if(yych <= 'E') goto yy73;
  726. if(yych == 'e') goto yy73;
  727. goto yy51;
  728. }
  729. yy69: yych = *++YYCURSOR;
  730. if(yych <= ','){
  731. if(yych != '+') goto yy56;
  732. goto yy70;
  733. } else {
  734. if(yych <= '-') goto yy70;
  735. if(yych <= '/') goto yy56;
  736. if(yych <= '9') goto yy71;
  737. goto yy56;
  738. }
  739. yy70: yych = *++YYCURSOR;
  740. if(yych <= '/') goto yy56;
  741. if(yych >= ':') goto yy56;
  742. goto yy71;
  743. yy71: ++YYCURSOR;
  744. if(YYLIMIT == YYCURSOR) YYFILL(1);
  745. yych = *YYCURSOR;
  746. goto yy72;
  747. yy72: if(yych <= '/') goto yy66;
  748. if(yych <= '9') goto yy71;
  749. goto yy66;
  750. yy73: yych = *++YYCURSOR;
  751. if(yych <= ','){
  752. if(yych != '+') goto yy56;
  753. goto yy74;
  754. } else {
  755. if(yych <= '-') goto yy74;
  756. if(yych <= '/') goto yy56;
  757. if(yych <= '9') goto yy75;
  758. goto yy56;
  759. }
  760. yy74: yych = *++YYCURSOR;
  761. if(yych <= '/') goto yy56;
  762. if(yych >= ':') goto yy56;
  763. goto yy75;
  764. yy75: ++YYCURSOR;
  765. if(YYLIMIT == YYCURSOR) YYFILL(1);
  766. yych = *YYCURSOR;
  767. goto yy76;
  768. yy76: if(yych <= '/') goto yy51;
  769. if(yych <= '9') goto yy75;
  770. goto yy51;
  771. yy77: yych = *++YYCURSOR;
  772. goto yy78;
  773. yy78:
  774. {
  775. /* build local label name */
  776. lvalp->str.contents = yasm_xmalloc(30);
  777. lvalp->str.len =
  778. sprintf(lvalp->str.contents, "L%c\001%lu", s->tok[0],
  779. parser_gas->local[s->tok[0]-'0']);
  780. RETURN(ID);
  781. }
  782. yy79: yych = *++YYCURSOR;
  783. goto yy80;
  784. yy80:
  785. {
  786. /* build local label name */
  787. lvalp->str.contents = yasm_xmalloc(30);
  788. lvalp->str.len =
  789. sprintf(lvalp->str.contents, "L%c\001%lu", s->tok[0],
  790. parser_gas->local[s->tok[0]-'0']+1);
  791. RETURN(ID);
  792. }
  793. yy81: yych = *++YYCURSOR;
  794. goto yy82;
  795. yy82:
  796. {
  797. /* increment label index */
  798. parser_gas->local[s->tok[0]-'0']++;
  799. /* build local label name */
  800. lvalp->str.contents = yasm_xmalloc(30);
  801. lvalp->str.len =
  802. sprintf(lvalp->str.contents, "L%c\001%lu", s->tok[0],
  803. parser_gas->local[s->tok[0]-'0']);
  804. RETURN(LABEL);
  805. }
  806. yy83: ++YYCURSOR;
  807. if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
  808. yych = *YYCURSOR;
  809. goto yy84;
  810. yy84: if(yych == '.') goto yy65;
  811. if(yych <= '/') goto yy3;
  812. if(yych <= '9') goto yy83;
  813. goto yy3;
  814. yy85: yych = *++YYCURSOR;
  815. if(yybm[0+yych] & 128) {
  816. goto yy104;
  817. }
  818. goto yy78;
  819. yy86: yyaccept = 5;
  820. yych = *(YYMARKER = ++YYCURSOR);
  821. if(yych == '+') goto yy96;
  822. if(yych == '-') goto yy96;
  823. goto yy97;
  824. yy87:
  825. {
  826. savech = s->tok[TOKLEN];
  827. s->tok[TOKLEN] = '\0';
  828. lvalp->flt = yasm_floatnum_create(TOK+2);
  829. s->tok[TOKLEN] = savech;
  830. RETURN(FLTNUM);
  831. }
  832. yy88: yyaccept = 5;
  833. yych = *(YYMARKER = ++YYCURSOR);
  834. if(yych == '+') goto yy96;
  835. if(yych == '-') goto yy96;
  836. goto yy97;
  837. yy89: yyaccept = 6;
  838. YYMARKER = ++YYCURSOR;
  839. if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
  840. yych = *YYCURSOR;
  841. goto yy90;
  842. yy90: if(yybm[0+yych] & 32) {
  843. goto yy89;
  844. }
  845. if(yych == '.') goto yy65;
  846. if(yych <= '/') goto yy91;
  847. if(yych <= '9') goto yy59;
  848. goto yy91;
  849. yy91:
  850. {
  851. savech = s->tok[TOKLEN];
  852. s->tok[TOKLEN] = '\0';
  853. lvalp->intn = yasm_intnum_create_oct(TOK);
  854. s->tok[TOKLEN] = savech;
  855. RETURN(INTNUM);
  856. }
  857. yy92: yych = *++YYCURSOR;
  858. if(yybm[0+yych] & 64) {
  859. goto yy93;
  860. }
  861. goto yy56;
  862. yy93: ++YYCURSOR;
  863. if(YYLIMIT == YYCURSOR) YYFILL(1);
  864. yych = *YYCURSOR;
  865. goto yy94;
  866. yy94: if(yybm[0+yych] & 64) {
  867. goto yy93;
  868. }
  869. goto yy95;
  870. yy95:
  871. {
  872. savech = s->tok[TOKLEN];
  873. s->tok[TOKLEN] = '\0';
  874. /* skip 0 and x */
  875. lvalp->intn = yasm_intnum_create_hex(TOK+2);
  876. s->tok[TOKLEN] = savech;
  877. RETURN(INTNUM);
  878. }
  879. yy96: yyaccept = 5;
  880. YYMARKER = ++YYCURSOR;
  881. if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
  882. yych = *YYCURSOR;
  883. goto yy97;
  884. yy97: if(yych <= '9'){
  885. if(yych == '.') goto yy98;
  886. if(yych <= '/') goto yy87;
  887. goto yy96;
  888. } else {
  889. if(yych <= 'E'){
  890. if(yych <= 'D') goto yy87;
  891. goto yy100;
  892. } else {
  893. if(yych == 'e') goto yy100;
  894. goto yy87;
  895. }
  896. }
  897. yy98: yyaccept = 5;
  898. YYMARKER = ++YYCURSOR;
  899. if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
  900. yych = *YYCURSOR;
  901. goto yy99;
  902. yy99: if(yych <= 'D'){
  903. if(yych <= '/') goto yy87;
  904. if(yych <= '9') goto yy98;
  905. goto yy87;
  906. } else {
  907. if(yych <= 'E') goto yy100;
  908. if(yych != 'e') goto yy87;
  909. goto yy100;
  910. }
  911. yy100: yych = *++YYCURSOR;
  912. if(yych <= ','){
  913. if(yych != '+') goto yy56;
  914. goto yy101;
  915. } else {
  916. if(yych <= '-') goto yy101;
  917. if(yych <= '/') goto yy56;
  918. if(yych <= '9') goto yy102;
  919. goto yy56;
  920. }
  921. yy101: yych = *++YYCURSOR;
  922. if(yych <= '/') goto yy56;
  923. if(yych >= ':') goto yy56;
  924. goto yy102;
  925. yy102: ++YYCURSOR;
  926. if(YYLIMIT == YYCURSOR) YYFILL(1);
  927. yych = *YYCURSOR;
  928. goto yy103;
  929. yy103: if(yych <= '/') goto yy87;
  930. if(yych <= '9') goto yy102;
  931. goto yy87;
  932. yy104: ++YYCURSOR;
  933. if(YYLIMIT == YYCURSOR) YYFILL(1);
  934. yych = *YYCURSOR;
  935. goto yy105;
  936. yy105: if(yybm[0+yych] & 128) {
  937. goto yy104;
  938. }
  939. goto yy106;
  940. yy106:
  941. {
  942. savech = s->tok[TOKLEN];
  943. s->tok[TOKLEN] = '\0';
  944. lvalp->intn = yasm_intnum_create_bin(TOK+2);
  945. s->tok[TOKLEN] = savech;
  946. RETURN(INTNUM);
  947. }
  948. }
  949. }
  950. /* C-style comment; nesting not supported */
  951. comment:
  952. SCANINIT();
  953. {
  954. {
  955. YYCTYPE yych;
  956. goto yy107;
  957. ++YYCURSOR;
  958. yy107:
  959. if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
  960. yych = *YYCURSOR;
  961. if(yych == '\n') goto yy111;
  962. if(yych != '*') goto yy113;
  963. goto yy109;
  964. yy109: yych = *++YYCURSOR;
  965. if(yych == '/') goto yy114;
  966. goto yy110;
  967. yy110:
  968. {
  969. if (cursor == s->eof)
  970. return 0;
  971. goto comment;
  972. }
  973. yy111: yych = *++YYCURSOR;
  974. goto yy112;
  975. yy112:
  976. {
  977. if (parser_gas->save_input)
  978. cursor = save_line(parser_gas, cursor);
  979. RETURN(s->tok[0]);
  980. }
  981. yy113: yych = *++YYCURSOR;
  982. goto yy110;
  983. yy114: yych = *++YYCURSOR;
  984. goto yy115;
  985. yy115:
  986. { parser_gas->state = INITIAL; goto scan; }
  987. }
  988. }
  989. /* Single line comment. */
  990. line_comment:
  991. {
  992. static unsigned char yybm[] = {
  993. 128, 128, 128, 128, 128, 128, 128, 128,
  994. 128, 128, 0, 128, 128, 128, 128, 128,
  995. 128, 128, 128, 128, 128, 128, 128, 128,
  996. 128, 128, 128, 128, 128, 128, 128, 128,
  997. 128, 128, 128, 128, 128, 128, 128, 128,
  998. 128, 128, 128, 128, 128, 128, 128, 128,
  999. 128, 128, 128, 128, 128, 128, 128, 128,
  1000. 128, 128, 128, 128, 128, 128, 128, 128,
  1001. 128, 128, 128, 128, 128, 128, 128, 128,
  1002. 128, 128, 128, 128, 128, 128, 128, 128,
  1003. 128, 128, 128, 128, 128, 128, 128, 128,
  1004. 128, 128, 128, 128, 128, 128, 128, 128,
  1005. 128, 128, 128, 128, 128, 128, 128, 128,
  1006. 128, 128, 128, 128, 128, 128, 128, 128,
  1007. 128, 128, 128, 128, 128, 128, 128, 128,
  1008. 128, 128, 128, 128, 128, 128, 128, 128,
  1009. 128, 128, 128, 128, 128, 128, 128, 128,
  1010. 128, 128, 128, 128, 128, 128, 128, 128,
  1011. 128, 128, 128, 128, 128, 128, 128, 128,
  1012. 128, 128, 128, 128, 128, 128, 128, 128,
  1013. 128, 128, 128, 128, 128, 128, 128, 128,
  1014. 128, 128, 128, 128, 128, 128, 128, 128,
  1015. 128, 128, 128, 128, 128, 128, 128, 128,
  1016. 128, 128, 128, 128, 128, 128, 128, 128,
  1017. 128, 128, 128, 128, 128, 128, 128, 128,
  1018. 128, 128, 128, 128, 128, 128, 128, 128,
  1019. 128, 128, 128, 128, 128, 128, 128, 128,
  1020. 128, 128, 128, 128, 128, 128, 128, 128,
  1021. 128, 128, 128, 128, 128, 128, 128, 128,
  1022. 128, 128, 128, 128, 128, 128, 128, 128,
  1023. 128, 128, 128, 128, 128, 128, 128, 128,
  1024. 128, 128, 128, 128, 128, 128, 128, 128,
  1025. };
  1026. {
  1027. YYCTYPE yych;
  1028. goto yy116;
  1029. yy117: ++YYCURSOR;
  1030. yy116:
  1031. if(YYLIMIT == YYCURSOR) YYFILL(1);
  1032. yych = *YYCURSOR;
  1033. goto yy118;
  1034. yy118: if(yybm[0+yych] & 128) {
  1035. goto yy117;
  1036. }
  1037. goto yy119;
  1038. yy119:
  1039. { goto scan; }
  1040. }
  1041. }
  1042. /* .section directive (the section name portion thereof) */
  1043. section_directive:
  1044. SCANINIT();
  1045. {
  1046. static unsigned char yybm[] = {
  1047. 0, 0, 0, 0, 0, 0, 0, 0,
  1048. 0, 64, 0, 0, 0, 64, 0, 0,
  1049. 0, 0, 0, 0, 0, 0, 0, 0,
  1050. 0, 0, 0, 0, 0, 0, 0, 0,
  1051. 64, 0, 0, 0, 128, 0, 0, 0,
  1052. 0, 0, 0, 0, 0, 128, 128, 0,
  1053. 128, 128, 128, 128, 128, 128, 128, 128,
  1054. 128, 128, 0, 0, 0, 0, 0, 0,
  1055. 0, 128, 128, 128, 128, 128, 128, 128,
  1056. 128, 128, 128, 128, 128, 128, 128, 128,
  1057. 128, 128, 128, 128, 128, 128, 128, 128,
  1058. 128, 128, 128, 0, 0, 0, 0, 128,
  1059. 0, 128, 128, 128, 128, 128, 128, 128,
  1060. 128, 128, 128, 128, 128, 128, 128, 128,
  1061. 128, 128, 128, 128, 128, 128, 128, 128,
  1062. 128, 128, 128, 0, 0, 0, 0, 0,
  1063. 0, 0, 0, 0, 0, 0, 0, 0,
  1064. 0, 0, 0, 0, 0, 0, 0, 0,
  1065. 0, 0, 0, 0, 0, 0, 0, 0,
  1066. 0, 0, 0, 0, 0, 0, 0, 0,
  1067. 0, 0, 0, 0, 0, 0, 0, 0,
  1068. 0, 0, 0, 0, 0, 0, 0, 0,
  1069. 0, 0, 0, 0, 0, 0, 0, 0,
  1070. 0, 0, 0, 0, 0, 0, 0, 0,
  1071. 0, 0, 0, 0, 0, 0, 0, 0,
  1072. 0, 0, 0, 0, 0, 0, 0, 0,
  1073. 0, 0, 0, 0, 0, 0, 0, 0,
  1074. 0, 0, 0, 0, 0, 0, 0, 0,
  1075. 0, 0, 0, 0, 0, 0, 0, 0,
  1076. 0, 0, 0, 0, 0, 0, 0, 0,
  1077. 0, 0, 0, 0, 0, 0, 0, 0,
  1078. 0, 0, 0, 0, 0, 0, 0, 0,
  1079. };
  1080. {
  1081. YYCTYPE yych;
  1082. goto yy120;
  1083. ++YYCURSOR;
  1084. yy120:
  1085. if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
  1086. yych = *YYCURSOR;
  1087. if(yych <= '$'){
  1088. if(yych <= '\r'){
  1089. if(yych <= '\t'){
  1090. if(yych <= '\b') goto yy132;
  1091. goto yy126;
  1092. } else {
  1093. if(yych <= '\n') goto yy130;
  1094. if(yych <= '\f') goto yy132;
  1095. goto yy126;
  1096. }
  1097. } else {
  1098. if(yych <= '!'){
  1099. if(yych == ' ') goto yy126;
  1100. goto yy132;
  1101. } else {
  1102. if(yych <= '"') goto yy124;
  1103. if(yych <= '#') goto yy132;
  1104. goto yy122;
  1105. }
  1106. }
  1107. } else {
  1108. if(yych <= '@'){
  1109. if(yych <= '.'){
  1110. if(yych <= '+') goto yy132;
  1111. if(yych <= ',') goto yy128;
  1112. goto yy122;
  1113. } else {
  1114. if(yych <= '/') goto yy132;
  1115. if(yych >= ':') goto yy132;
  1116. goto yy122;
  1117. }
  1118. } else {
  1119. if(yych <= '_'){
  1120. if(yych <= 'Z') goto yy122;
  1121. if(yych <= '^') goto yy132;
  1122. goto yy122;
  1123. } else {
  1124. if(yych <= '`') goto yy132;
  1125. if(yych >= '{') goto yy132;
  1126. goto yy122;
  1127. }
  1128. }
  1129. }
  1130. yy122: yych = *++YYCURSOR;
  1131. goto yy137;
  1132. yy123:
  1133. {
  1134. lvalp->str.contents = yasm__xstrndup(TOK, TOKLEN);
  1135. lvalp->str.len = TOKLEN;
  1136. parser_gas->state = INITIAL;
  1137. RETURN(ID);
  1138. }
  1139. yy124: yych = *++YYCURSOR;
  1140. goto yy125;
  1141. yy125:
  1142. { goto stringconst; }
  1143. yy126: yych = *++YYCURSOR;
  1144. goto yy135;
  1145. yy127:
  1146. { goto section_directive; }
  1147. yy128: yych = *++YYCURSOR;
  1148. goto yy129;
  1149. yy129:
  1150. {
  1151. parser_gas->state = INITIAL;
  1152. RETURN(s->tok[0]);
  1153. }
  1154. yy130: yych = *++YYCURSOR;
  1155. goto yy131;
  1156. yy131:
  1157. {
  1158. if (parser_gas->save_input)
  1159. cursor = save_line(parser_gas, cursor);
  1160. parser_gas->state = INITIAL;
  1161. RETURN(s->tok[0]);
  1162. }
  1163. yy132: yych = *++YYCURSOR;
  1164. goto yy133;
  1165. yy133:
  1166. {
  1167. yasm_warn_set(YASM_WARN_UNREC_CHAR,
  1168. N_("ignoring unrecognized character `%s'"),
  1169. yasm__conv_unprint(s->tok[0]));
  1170. goto section_directive;
  1171. }
  1172. yy134: ++YYCURSOR;
  1173. if(YYLIMIT == YYCURSOR) YYFILL(1);
  1174. yych = *YYCURSOR;
  1175. goto yy135;
  1176. yy135: if(yybm[0+yych] & 64) {
  1177. goto yy134;
  1178. }
  1179. goto yy127;
  1180. yy136: ++YYCURSOR;
  1181. if(YYLIMIT == YYCURSOR) YYFILL(1);
  1182. yych = *YYCURSOR;
  1183. goto yy137;
  1184. yy137: if(yybm[0+yych] & 128) {
  1185. goto yy136;
  1186. }
  1187. goto yy123;
  1188. }
  1189. }
  1190. /* filename portion of nasm preproc %line */
  1191. nasm_filename:
  1192. strbuf = yasm_xmalloc(STRBUF_ALLOC_SIZE);
  1193. strbuf_size = STRBUF_ALLOC_SIZE;
  1194. count = 0;
  1195. nasm_filename_scan:
  1196. SCANINIT();
  1197. {
  1198. static unsigned char yybm[] = {
  1199. 0, 0, 0, 0, 0, 0, 0, 0,
  1200. 0, 128, 0, 0, 0, 128, 0, 0,
  1201. 0, 0, 0, 0, 0, 0, 0, 0,
  1202. 0, 0, 0, 0, 0, 0, 0, 0,
  1203. 128, 0, 0, 0, 0, 0, 0, 0,
  1204. 0, 0, 0, 0, 0, 0, 0, 0,
  1205. 0, 0, 0, 0, 0, 0, 0, 0,
  1206. 0, 0, 0, 0, 0, 0, 0, 0,
  1207. 0, 0, 0, 0, 0, 0, 0, 0,
  1208. 0, 0, 0, 0, 0, 0, 0, 0,
  1209. 0, 0, 0, 0, 0, 0, 0, 0,
  1210. 0, 0, 0, 0, 0, 0, 0, 0,
  1211. 0, 0, 0, 0, 0, 0, 0, 0,
  1212. 0, 0, 0, 0, 0, 0, 0, 0,
  1213. 0, 0, 0, 0, 0, 0, 0, 0,
  1214. 0, 0, 0, 0, 0, 0, 0, 0,
  1215. 0, 0, 0, 0, 0, 0, 0, 0,
  1216. 0, 0, 0, 0, 0, 0, 0, 0,
  1217. 0, 0, 0, 0, 0, 0, 0, 0,
  1218. 0, 0, 0, 0, 0, 0, 0, 0,
  1219. 0, 0, 0, 0, 0, 0, 0, 0,
  1220. 0, 0, 0, 0, 0, 0, 0, 0,
  1221. 0, 0, 0, 0, 0, 0, 0, 0,
  1222. 0, 0, 0, 0, 0, 0, 0, 0,
  1223. 0, 0, 0, 0, 0, 0, 0, 0,
  1224. 0, 0, 0, 0, 0, 0, 0, 0,
  1225. 0, 0, 0, 0, 0, 0, 0, 0,
  1226. 0, 0, 0, 0, 0, 0, 0, 0,
  1227. 0, 0, 0, 0, 0, 0, 0, 0,
  1228. 0, 0, 0, 0, 0, 0, 0, 0,
  1229. 0, 0, 0, 0, 0, 0, 0, 0,
  1230. 0, 0, 0, 0, 0, 0, 0, 0,
  1231. };
  1232. {
  1233. YYCTYPE yych;
  1234. goto yy138;
  1235. ++YYCURSOR;
  1236. yy138:
  1237. if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
  1238. yych = *YYCURSOR;
  1239. if(yych <= '\f'){
  1240. if(yych <= '\b') goto yy144;
  1241. if(yych <= '\t') goto yy142;
  1242. if(yych >= '\v') goto yy144;
  1243. goto yy140;
  1244. } else {
  1245. if(yych <= '\r') goto yy142;
  1246. if(yych == ' ') goto yy142;
  1247. goto yy144;
  1248. }
  1249. yy140: yych = *++YYCURSOR;
  1250. goto yy141;
  1251. yy141:
  1252. {
  1253. strbuf_append(count++, cursor, s, '\0');
  1254. lvalp->str.contents = (char *)strbuf;
  1255. lvalp->str.len = count;
  1256. parser_gas->state = INITIAL;
  1257. RETURN(STRING);
  1258. }
  1259. yy142: yych = *++YYCURSOR;
  1260. goto yy147;
  1261. yy143:
  1262. { goto nasm_filename_scan; }
  1263. yy144: yych = *++YYCURSOR;
  1264. goto yy145;
  1265. yy145:
  1266. {
  1267. if (cursor == s->eof) {
  1268. strbuf_append(count++, cursor, s, '\0');
  1269. lvalp->str.contents = (char *)strbuf;
  1270. lvalp->str.len = count;
  1271. parser_gas->state = INITIAL;
  1272. RETURN(STRING);
  1273. }
  1274. strbuf_append(count++, cursor, s, s->tok[0]);
  1275. goto nasm_filename_scan;
  1276. }
  1277. yy146: ++YYCURSOR;
  1278. if(YYLIMIT == YYCURSOR) YYFILL(1);
  1279. yych = *YYCURSOR;
  1280. goto yy147;
  1281. yy147: if(yybm[0+yych] & 128) {
  1282. goto yy146;
  1283. }
  1284. goto yy143;
  1285. }
  1286. }
  1287. /* character constant values */
  1288. charconst:
  1289. /*TODO*/
  1290. /* string constant values */
  1291. stringconst:
  1292. strbuf = yasm_xmalloc(STRBUF_ALLOC_SIZE);
  1293. strbuf_size = STRBUF_ALLOC_SIZE;
  1294. count = 0;
  1295. stringconst_scan:
  1296. SCANINIT();
  1297. {
  1298. {
  1299. YYCTYPE yych;
  1300. goto yy148;
  1301. ++YYCURSOR;
  1302. yy148:
  1303. if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
  1304. yych = *YYCURSOR;
  1305. if(yych == '"') goto yy152;
  1306. if(yych != '\\') goto yy154;
  1307. goto yy150;
  1308. yy150: yych = *++YYCURSOR;
  1309. if(yych != '\n') goto yy155;
  1310. goto yy151;
  1311. yy151:
  1312. {
  1313. if (cursor == s->eof) {
  1314. yasm_error_set(YASM_ERROR_SYNTAX,
  1315. N_("unexpected end of file in string"));
  1316. lvalp->str.contents = (char *)strbuf;
  1317. lvalp->str.len = count;
  1318. RETURN(STRING);
  1319. }
  1320. strbuf_append(count++, cursor, s, s->tok[0]);
  1321. goto stringconst_scan;
  1322. }
  1323. yy152: yych = *++YYCURSOR;
  1324. goto yy153;
  1325. yy153:
  1326. {
  1327. strbuf_append(count, cursor, s, '\0');
  1328. yasm_unescape_cstring(strbuf, &count);
  1329. lvalp->str.contents = (char *)strbuf;
  1330. lvalp->str.len = count;
  1331. RETURN(STRING);
  1332. }
  1333. yy154: yych = *++YYCURSOR;
  1334. goto yy151;
  1335. yy155: yych = *++YYCURSOR;
  1336. goto yy156;
  1337. yy156:
  1338. {
  1339. if (cursor == s->eof) {
  1340. yasm_error_set(YASM_ERROR_SYNTAX,
  1341. N_("unexpected end of file in string"));
  1342. lvalp->str.contents = (char *)strbuf;
  1343. lvalp->str.len = count;
  1344. RETURN(STRING);
  1345. }
  1346. strbuf_append(count++, cursor, s, '\\');
  1347. strbuf_append(count++, cursor, s, s->tok[1]);
  1348. goto stringconst_scan;
  1349. }
  1350. }
  1351. }
  1352. }