main.c (228072) | main.c (250125) |
---|---|
1/* flex - tool to generate fast lexical analyzers */ 2 3/* Copyright (c) 1990 The Regents of the University of California. */ 4/* All rights reserved. */ 5 6/* This code is derived from software contributed to Berkeley by */ 7/* Vern Paxson. */ 8 --- 43 unchanged lines hidden (view full) --- 52int interactive, lex_compat, posix_compat, do_yylineno, 53 useecs, fulltbl, usemecs; 54int fullspd, gen_line_dirs, performance_report, backing_up_report; 55int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap, 56 csize; 57int reentrant, bison_bridge_lval, bison_bridge_lloc; 58int yymore_used, reject, real_reject, continued_action, in_rule; 59int yymore_really_used, reject_really_used; | 1/* flex - tool to generate fast lexical analyzers */ 2 3/* Copyright (c) 1990 The Regents of the University of California. */ 4/* All rights reserved. */ 5 6/* This code is derived from software contributed to Berkeley by */ 7/* Vern Paxson. */ 8 --- 43 unchanged lines hidden (view full) --- 52int interactive, lex_compat, posix_compat, do_yylineno, 53 useecs, fulltbl, usemecs; 54int fullspd, gen_line_dirs, performance_report, backing_up_report; 55int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap, 56 csize; 57int reentrant, bison_bridge_lval, bison_bridge_lloc; 58int yymore_used, reject, real_reject, continued_action, in_rule; 59int yymore_really_used, reject_really_used; |
60int datapos, dataline, linenum, out_linenum; | 60int datapos, dataline, linenum; |
61FILE *skelfile = NULL; 62int skel_ind = 0; 63char *action_array; 64int action_size, defs1_offset, prolog_offset, action_offset, 65 action_index; 66char *infilename = NULL, *outfilename = NULL, *headerfilename = NULL; 67int did_outfilename; 68char *prefix, *yyclass, *extra_type = NULL; --- 381 unchanged lines hidden (view full) --- 450 { 451 struct Buf tmpbuf; 452 buf_init(&tmpbuf, sizeof(char)); 453 for (i = 1; i <= lastsc; i++) { 454 char *str, *fmt = "#define %s %d\n"; 455 size_t strsz; 456 457 str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(scname[i]) + (int)(1 + log10(i)) + 2); | 61FILE *skelfile = NULL; 62int skel_ind = 0; 63char *action_array; 64int action_size, defs1_offset, prolog_offset, action_offset, 65 action_index; 66char *infilename = NULL, *outfilename = NULL, *headerfilename = NULL; 67int did_outfilename; 68char *prefix, *yyclass, *extra_type = NULL; --- 381 unchanged lines hidden (view full) --- 450 { 451 struct Buf tmpbuf; 452 buf_init(&tmpbuf, sizeof(char)); 453 for (i = 1; i <= lastsc; i++) { 454 char *str, *fmt = "#define %s %d\n"; 455 size_t strsz; 456 457 str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(scname[i]) + (int)(1 + log10(i)) + 2); |
458 if (!str) 459 flexfatal(_("allocation of macro definition failed")); |
|
458 snprintf(str, strsz, fmt, scname[i], i - 1); 459 buf_strappend(&tmpbuf, str); 460 free(str); 461 } 462 buf_m4_define(&m4defs_buf, "M4_YY_SC_DEFS", tmpbuf.elts); 463 buf_destroy(&tmpbuf); 464 } 465 --- 970 unchanged lines hidden (view full) --- 1436 num_rules = num_eof_rules = default_rule = 0; 1437 numas = numsnpairs = tmpuses = 0; 1438 numecs = numeps = eps2 = num_reallocs = hshcol = dfaeql = totnst = 1439 0; 1440 numuniq = numdup = hshsave = eofseen = datapos = dataline = 0; 1441 num_backing_up = onesp = numprots = 0; 1442 variable_trailing_context_rules = bol_needed = false; 1443 | 460 snprintf(str, strsz, fmt, scname[i], i - 1); 461 buf_strappend(&tmpbuf, str); 462 free(str); 463 } 464 buf_m4_define(&m4defs_buf, "M4_YY_SC_DEFS", tmpbuf.elts); 465 buf_destroy(&tmpbuf); 466 } 467 --- 970 unchanged lines hidden (view full) --- 1438 num_rules = num_eof_rules = default_rule = 0; 1439 numas = numsnpairs = tmpuses = 0; 1440 numecs = numeps = eps2 = num_reallocs = hshcol = dfaeql = totnst = 1441 0; 1442 numuniq = numdup = hshsave = eofseen = datapos = dataline = 0; 1443 num_backing_up = onesp = numprots = 0; 1444 variable_trailing_context_rules = bol_needed = false; 1445 |
1444 out_linenum = linenum = sectnum = 1; | 1446 linenum = sectnum = 1; |
1445 firstprot = NIL; 1446 1447 /* Used in mkprot() so that the first proto goes in slot 1 1448 * of the proto queue. 1449 */ 1450 lastprot = 1; 1451 1452 set_up_initial_allocations (); --- 118 unchanged lines hidden (view full) --- 1571 } 1572 1573 if (reject){ 1574 out_m4_define( "M4_YY_USES_REJECT", NULL); 1575 //outn ("\n#define YY_USES_REJECT"); 1576 } 1577 1578 if (!do_yywrap) { | 1447 firstprot = NIL; 1448 1449 /* Used in mkprot() so that the first proto goes in slot 1 1450 * of the proto queue. 1451 */ 1452 lastprot = 1; 1453 1454 set_up_initial_allocations (); --- 118 unchanged lines hidden (view full) --- 1573 } 1574 1575 if (reject){ 1576 out_m4_define( "M4_YY_USES_REJECT", NULL); 1577 //outn ("\n#define YY_USES_REJECT"); 1578 } 1579 1580 if (!do_yywrap) { |
1579 if (!C_plus_plus) { 1580 outn ("\n#define yywrap(n) 1"); 1581 } | 1581 if (!C_plus_plus) 1582 if (reentrant) 1583 outn ("\n#define yywrap(yyscanner) 1"); 1584 else 1585 outn ("\n#define yywrap() 1"); |
1582 outn ("#define YY_SKIP_YYWRAP"); 1583 } 1584 1585 if (ddebug) 1586 outn ("\n#define FLEX_DEBUG"); 1587 1588 OUT_BEGIN_CODE (); 1589 if (csize == 256) --- 268 unchanged lines hidden --- | 1586 outn ("#define YY_SKIP_YYWRAP"); 1587 } 1588 1589 if (ddebug) 1590 outn ("\n#define FLEX_DEBUG"); 1591 1592 OUT_BEGIN_CODE (); 1593 if (csize == 256) --- 268 unchanged lines hidden --- |