From 859187428420e9089e91a45f3a833135172d1822 Mon Sep 17 00:00:00 2001 From: Shantonu Sen Date: Wed, 31 May 2000 07:19:30 +0000 Subject: [PATCH] Added back memory options for AIX to increase available memory. Took out %option noyywrap, which wasn't understood by AT&T lex, as well as the -i case-insensitivity flag. --- sbr/Makefile.in | 2 +- sbr/dtimep.c | 1032 +++++++++++++++++++++++++++++-------------------------- sbr/dtimep.lex | 267 +++++++------- 3 files changed, 706 insertions(+), 595 deletions(-) diff --git a/sbr/Makefile.in b/sbr/Makefile.in index 9e8e8aa..506c559 100644 --- a/sbr/Makefile.in +++ b/sbr/Makefile.in @@ -85,7 +85,7 @@ lint: sigmsg.h $(LINT) $(LINTFLAGS) $(INCLUDES) $(DEFS) $(SRCS) dtimep.c: dtimep.lex - $(LEX) -nit $< > $@ + $(LEX) -nt $< > $@ pidstatus.o: sigmsg.h diff --git a/sbr/dtimep.c b/sbr/dtimep.c index a8cce79..2ddeae6 100644 --- a/sbr/dtimep.c +++ b/sbr/dtimep.c @@ -261,9 +261,6 @@ static void yy_flex_free YY_PROTO(( void * )); #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -#define yywrap() 1 -#define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; @@ -285,73 +282,78 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 39 -#define YY_END_OF_BUFFER 40 -static yyconst short int yy_accept[572] = +#define YY_NUM_RULES 38 +#define YY_END_OF_BUFFER 39 +static yyconst short int yy_accept[614] = { 0, - 0, 0, 40, 38, 37, 38, 38, 38, 38, 34, - 34, 34, 34, 34, 34, 34, 34, 34, 38, 35, - 35, 36, 36, 36, 36, 36, 36, 36, 36, 36, + 0, 0, 39, 37, 37, 37, 37, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 37, 35, 35, 36, + 36, 36, 36, 36, 36, 36, 36, 36, 37, 34, + 34, 34, 34, 34, 34, 37, 35, 36, 36, 36, + 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, - 0, 27, 0, 33, 21, 20, 0, 19, 18, 0, - 0, 15, 32, 31, 0, 17, 16, 0, 0, 0, - 0, 23, 0, 22, 0, 26, 0, 25, 24, 0, - 0, 0, 0, 0, 0, 30, 29, 12, 13, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 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, 12, 13, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, + 27, 0, 0, 33, 21, 20, 0, 19, 18, 0, + 0, 15, 32, 31, 17, 16, 0, 0, 0, 23, + 22, 0, 0, 0, 26, 0, 0, 25, 24, 0, + 0, 0, 0, 0, 0, 30, 29, 0, 0, 12, + 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 9, 10, 11, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 9, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 10, 11, 0, 0, 0, 0, - 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, - 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 5, 0, 5, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 5, 5, 5, 0, 0, - 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 5, 0, 0, 6, 6, - 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 6, 0, 0, 0, 0, - 0, 0, 6, 6, 0, 2, 4, 1, 1, 0, - 6, 0, 0, 0, 1, 0, 0, 1, 2, 4, - 0 + 0, 6, 6, 6, 6, 6, 6, 6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 5, 0, 5, + 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, + 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, + 6, 6, 0, 6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 0, 6, 0, 0, + 0, 0, 0, 0, 6, 6, 0, 2, 4, 1, + + 1, 0, 6, 0, 0, 0, 1, 0, 0, 1, + 2, 4, 0 } ; static yyconst int yy_ec[256] = @@ -362,14 +364,14 @@ static yyconst int yy_ec[256] = 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 5, 6, 1, 7, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 10, 1, 1, - 1, 1, 1, 1, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 29, 36, 1, - 11, 1, 12, 1, 1, 1, 13, 14, 15, 16, - - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 29, - 36, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, + 26, 26, 27, 28, 29, 26, 30, 26, 31, 1, + 32, 1, 33, 1, 1, 1, 34, 35, 36, 37, + + 38, 16, 39, 40, 41, 42, 21, 43, 44, 45, + 46, 47, 26, 48, 49, 50, 51, 52, 30, 26, + 53, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -386,354 +388,396 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[37] = +static yyconst int yy_meta[54] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1 } ; -static yyconst short int yy_base[572] = +static yyconst short int yy_base[614] = { 0, - 0, 0, 869, 870, 870, 29, 31, 63, 30, 45, - 837, 31, 850, 44, 24, 841, 50, 870, 61, 870, - 66, 53, 850, 52, 870, 72, 22, 832, 846, 70, - 79, 82, 79, 831, 80, 82, 836, 83, 84, 86, - 829, 87, 827, 88, 118, 98, 119, 845, 829, 824, - 825, 822, 834, 820, 819, 818, 834, 816, 815, 832, - 824, 812, 811, 810, 815, 808, 807, 98, 93, 806, - 811, 804, 801, 802, 801, 800, 799, 798, 801, 802, - 794, 809, 870, 809, 792, 791, 100, 119, 102, 805, - 804, 99, 807, 792, 803, 800, 144, 804, 803, 870, - - 135, 870, 114, 870, 870, 870, 131, 870, 870, 136, - 47, 870, 870, 870, 137, 870, 870, 139, 140, 144, - 812, 870, 153, 870, 159, 870, 152, 870, 870, 158, - 160, 162, 163, 169, 175, 870, 870, 164, 173, 783, - 793, 796, 796, 783, 159, 154, 774, 775, 778, 178, - 182, 794, 793, 194, 779, 771, 776, 767, 202, 797, - 785, 784, 794, 793, 774, 780, 767, 777, 760, 772, - 775, 756, 770, 768, 870, 870, 192, 193, 195, 204, - 197, 196, 205, 206, 782, 214, 212, 203, 228, 232, - 758, 757, 240, 779, 748, 765, 765, 242, 210, 760, - - 759, 233, 762, 747, 758, 755, 735, 740, 767, 732, - 753, 749, 749, 739, 727, 746, 748, 729, 245, 735, - 727, 732, 723, 742, 752, 751, 732, 726, 736, 732, - 250, 253, 723, 722, 255, 744, 263, 743, 727, 713, - 267, 740, 711, 721, 724, 724, 711, 193, 237, 702, - 703, 706, 269, 697, 270, 715, 701, 717, 715, 274, - 715, 691, 710, 269, 273, 723, 692, 709, 709, 691, - 718, 705, 701, 692, 282, 278, 293, 704, 703, 288, - 291, 684, 677, 275, 695, 694, 291, 697, 682, 693, - 690, 286, 223, 303, 304, 307, 308, 309, 310, 704, - - 311, 312, 313, 675, 702, 667, 685, 665, 314, 687, - 321, 329, 697, 681, 667, 660, 678, 664, 679, 333, - 690, 870, 870, 344, 346, 689, 688, 659, 669, 672, - 672, 659, 309, 291, 650, 651, 654, 348, 657, 649, - 654, 645, 664, 674, 673, 654, 648, 658, 654, 668, - 356, 639, 357, 632, 358, 309, 361, 637, 630, 635, - 662, 646, 652, 356, 369, 659, 364, 372, 374, 345, - 366, 373, 377, 380, 382, 383, 658, 388, 384, 386, - 404, 657, 626, 643, 643, 625, 652, 639, 635, 626, - 648, 387, 411, 647, 646, 645, 644, 615, 388, 614, - - 616, 389, 394, 625, 421, 422, 617, 609, 614, 605, - 624, 634, 633, 614, 608, 618, 614, 426, 628, 427, - 627, 611, 597, 590, 608, 594, 609, 612, 399, 619, - 610, 598, 592, 585, 590, 582, 597, 597, 428, 430, - 610, 579, 596, 596, 578, 605, 592, 588, 579, 432, - 435, 444, 573, 566, 571, 598, 582, 439, 441, 582, - 581, 563, 579, 564, 562, 566, 449, 452, 589, 573, - 559, 552, 570, 556, 571, 454, 457, 465, 460, 463, - 582, 581, 580, 551, 570, 468, 566, 565, 547, 563, - 544, 558, 556, 476, 471, 479, 542, 535, 540, 567, - - 551, 481, 565, 483, 485, 493, 495, 503, 564, 498, - 870, 529, 528, 547, 526, 545, 547, 528, 505, 556, - 555, 554, 553, 498, 508, 494, 415, 501, 870, 870, - 473, 870, 469, 419, 417, 405, 511, 391, 381, 513, - 521, 516, 870, 300, 296, 870, 309, 518, 523, 525, - 527, 529, 870, 870, 234, 250, 213, 531, 533, 207, - 870, 535, 537, 539, 541, 543, 545, 870, 870, 870, - 870 + 0, 0, 988, 989, 46, 48, 96, 62, 960, 48, + 948, 53, 26, 963, 58, 989, 80, 989, 83, 54, + 948, 64, 989, 74, 18, 955, 944, 92, 105, 85, + 932, 74, 78, 936, 84, 101, 105, 91, 104, 929, + 106, 136, 138, 134, 951, 135, 142, 955, 143, 144, + 145, 949, 146, 947, 149, 128, 925, 129, 130, 929, + 131, 137, 138, 923, 144, 921, 145, 193, 175, 183, + 942, 941, 920, 928, 938, 937, 936, 927, 934, 933, + 925, 918, 930, 929, 928, 927, 926, 908, 75, 924, + 923, 143, 905, 921, 896, 897, 918, 917, 894, 896, + + 897, 890, 902, 989, 902, 910, 909, 902, 888, 884, + 883, 882, 881, 880, 879, 878, 877, 876, 875, 874, + 873, 872, 871, 870, 869, 868, 867, 866, 189, 191, + 77, 877, 876, 154, 879, 866, 875, 872, 215, 989, + 989, 162, 190, 989, 989, 989, 206, 989, 989, 199, + 209, 989, 989, 989, 989, 989, 200, 204, 210, 989, + 989, 216, 907, 223, 989, 217, 208, 989, 989, 224, + 229, 231, 238, 248, 254, 989, 989, 875, 874, 253, + 255, 858, 866, 868, 868, 857, 189, 217, 849, 850, + 852, 258, 265, 272, 855, 848, 852, 844, 298, 892, + + 859, 858, 889, 888, 849, 854, 843, 851, 837, 846, + 849, 833, 844, 842, 847, 846, 989, 989, 243, 247, + 256, 267, 275, 271, 281, 274, 875, 285, 283, 280, + 280, 282, 329, 874, 825, 839, 839, 293, 245, 834, + 833, 277, 836, 823, 832, 829, 813, 817, 862, 810, + 827, 823, 823, 815, 805, 820, 822, 806, 832, 831, + 337, 809, 802, 806, 798, 814, 845, 844, 805, 800, + 808, 804, 346, 348, 350, 839, 303, 838, 801, 790, + 358, 835, 788, 796, 798, 798, 787, 306, 288, 779, + 780, 782, 311, 775, 359, 789, 778, 791, 789, 360, + + 789, 769, 784, 776, 775, 295, 358, 816, 767, 781, + 781, 766, 811, 777, 773, 766, 368, 375, 385, 380, + 382, 761, 755, 324, 769, 768, 345, 771, 758, 767, + 764, 276, 361, 371, 351, 366, 384, 395, 291, 799, + 396, 399, 403, 752, 797, 745, 759, 743, 406, 761, + 761, 760, 411, 413, 790, 753, 742, 736, 750, 739, + 751, 415, 783, 427, 438, 782, 781, 734, 742, 744, + 744, 733, 371, 378, 725, 726, 728, 440, 731, 724, + 728, 720, 736, 767, 766, 727, 722, 730, 726, 761, + 425, 714, 436, 708, 989, 989, 442, 446, 450, 712, + + 706, 710, 755, 718, 745, 448, 458, 752, 453, 461, + 426, 462, 437, 463, 466, 469, 471, 470, 751, 474, + 475, 476, 482, 750, 701, 715, 715, 700, 745, 711, + 707, 700, 741, 477, 484, 740, 739, 738, 737, 690, + 487, 689, 690, 447, 449, 697, 499, 516, 691, 684, + 688, 680, 696, 727, 726, 687, 682, 690, 686, 521, + 721, 514, 720, 683, 672, 666, 680, 669, 681, 705, + 506, 712, 703, 671, 666, 660, 664, 657, 669, 669, + 519, 523, 703, 654, 668, 668, 653, 698, 664, 660, + 653, 525, 528, 537, 648, 642, 646, 691, 654, 532, + + 534, 654, 653, 638, 651, 639, 637, 640, 542, 545, + 682, 645, 634, 628, 642, 631, 643, 547, 550, 558, + 553, 556, 675, 674, 673, 626, 663, 561, 638, 637, + 622, 635, 619, 630, 628, 569, 564, 572, 617, 611, + 615, 660, 623, 574, 658, 576, 578, 586, 588, 596, + 657, 591, 989, 605, 604, 619, 602, 617, 619, 603, + 598, 649, 648, 647, 646, 573, 601, 587, 408, 594, + 989, 989, 545, 989, 541, 495, 483, 500, 604, 503, + 493, 606, 614, 609, 989, 446, 444, 989, 449, 611, + 616, 618, 620, 622, 989, 989, 353, 323, 116, 624, + + 626, 94, 989, 628, 630, 632, 634, 636, 638, 989, + 989, 989, 989 } ; -static yyconst short int yy_def[572] = +static yyconst short int yy_def[614] = { 0, - 571, 1, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 0 + 613, 1, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 0 } ; -static yyconst short int yy_nxt[907] = +static yyconst short int yy_nxt[1043] = { 0, - 4, 4, 5, 6, 4, 7, 4, 8, 8, 4, - 9, 4, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 20, 21, 22, 23, 24, 25, 25, - 26, 27, 28, 25, 29, 30, 31, 31, 32, 32, - 60, 81, 48, 33, 34, 35, 55, 36, 159, 37, - 38, 160, 39, 61, 82, 40, 41, 49, 42, 58, - 50, 56, 161, 43, 45, 63, 44, 76, 46, 46, - 47, 47, 51, 65, 59, 52, 66, 53, 69, 73, - 64, 70, 77, 74, 78, 85, 87, 87, 79, 88, - 88, 67, 71, 68, 50, 55, 72, 58, 63, 66, - - 86, 70, 76, 85, 80, 97, 97, 138, 138, 52, - 56, 144, 59, 64, 67, 154, 72, 77, 86, 45, - 45, 118, 120, 119, 46, 46, 139, 139, 121, 140, - 89, 145, 154, 90, 141, 91, 154, 154, 154, 92, - 154, 154, 93, 94, 95, 154, 156, 157, 96, 150, - 150, 151, 151, 154, 159, 155, 164, 160, 165, 159, - 154, 154, 160, 159, 159, 158, 160, 160, 166, 162, - 159, 175, 175, 160, 163, 167, 159, 171, 168, 160, - 176, 176, 182, 184, 183, 189, 190, 150, 150, 185, - 169, 170, 172, 219, 219, 154, 219, 219, 219, 173, - - 174, 193, 193, 159, 219, 219, 219, 219, 541, 198, - 198, 222, 220, 219, 199, 219, 297, 200, 298, 201, - 227, 226, 563, 202, 338, 221, 203, 204, 205, 224, - 228, 225, 206, 223, 230, 231, 231, 243, 229, 232, - 232, 235, 244, 241, 236, 247, 219, 237, 237, 242, - 242, 275, 264, 265, 275, 340, 235, 276, 276, 562, - 277, 277, 280, 281, 235, 248, 299, 236, 241, 561, - 159, 159, 300, 160, 160, 159, 311, 311, 160, 284, - 312, 312, 285, 275, 286, 321, 321, 338, 287, 320, - 320, 288, 289, 290, 275, 324, 324, 291, 325, 325, - - 321, 321, 328, 332, 338, 338, 339, 329, 338, 338, - 338, 338, 338, 338, 338, 159, 394, 394, 160, 341, - 376, 555, 355, 333, 346, 345, 377, 347, 356, 356, - 355, 554, 374, 342, 375, 553, 357, 357, 348, 343, - 363, 363, 364, 344, 349, 365, 406, 365, 366, 338, - 366, 367, 367, 368, 368, 381, 381, 159, 159, 355, - 160, 160, 355, 399, 399, 393, 393, 406, 394, 394, - 365, 405, 405, 365, 406, 406, 366, 408, 406, 405, - 405, 406, 409, 406, 406, 406, 400, 406, 159, 406, - 540, 160, 406, 401, 407, 431, 431, 414, 413, 402, - - 403, 434, 410, 404, 415, 418, 458, 458, 419, 411, - 416, 420, 420, 436, 537, 412, 541, 417, 428, 428, - 429, 435, 365, 406, 542, 366, 437, 418, 418, 439, - 440, 419, 547, 450, 451, 467, 467, 468, 468, 476, - 476, 477, 478, 478, 477, 452, 485, 485, 486, 486, - 494, 479, 480, 494, 546, 502, 495, 495, 503, 496, - 496, 504, 504, 477, 505, 505, 502, 507, 507, 503, - 508, 508, 506, 506, 477, 511, 511, 494, 520, 520, - 494, 545, 502, 519, 519, 544, 520, 520, 525, 525, - 526, 526, 527, 527, 502, 502, 502, 503, 503, 503, - - 526, 526, 504, 504, 502, 528, 528, 503, 543, 543, - 506, 506, 536, 536, 537, 539, 539, 540, 548, 548, - 549, 549, 541, 552, 552, 556, 556, 538, 550, 551, - 557, 557, 558, 558, 559, 559, 560, 560, 564, 564, - 565, 565, 566, 566, 567, 567, 568, 568, 568, 568, - 569, 569, 570, 570, 406, 406, 406, 494, 535, 534, - 533, 532, 531, 530, 529, 338, 502, 524, 406, 523, - 522, 521, 518, 517, 516, 515, 514, 513, 512, 510, - 509, 338, 338, 338, 501, 500, 499, 377, 498, 497, - 406, 493, 492, 491, 490, 489, 488, 487, 484, 338, - - 483, 482, 481, 475, 474, 473, 406, 472, 471, 470, - 469, 406, 466, 465, 464, 463, 462, 461, 460, 459, - 219, 429, 457, 456, 455, 300, 454, 453, 338, 452, - 449, 448, 447, 446, 406, 406, 445, 444, 443, 442, - 441, 438, 433, 432, 430, 219, 219, 219, 355, 154, - 427, 426, 425, 338, 424, 423, 422, 421, 338, 406, - 365, 364, 398, 219, 397, 396, 395, 392, 391, 154, - 390, 389, 388, 387, 338, 338, 386, 385, 384, 383, - 382, 380, 379, 378, 373, 372, 371, 370, 369, 154, - 154, 275, 362, 361, 360, 185, 359, 358, 219, 354, - - 353, 352, 351, 154, 350, 338, 337, 336, 335, 334, - 331, 330, 327, 326, 323, 322, 319, 318, 317, 219, - 316, 315, 314, 313, 219, 310, 309, 308, 307, 306, - 305, 304, 121, 303, 302, 301, 296, 295, 294, 293, - 292, 241, 283, 282, 154, 235, 279, 278, 274, 273, - 272, 271, 219, 219, 270, 269, 268, 267, 266, 263, - 262, 261, 260, 259, 258, 257, 256, 255, 154, 254, - 253, 252, 251, 250, 249, 246, 245, 240, 239, 238, - 154, 234, 233, 219, 218, 217, 216, 215, 214, 213, - 212, 211, 210, 209, 154, 154, 208, 207, 159, 197, - - 196, 195, 194, 192, 191, 188, 187, 186, 181, 180, - 179, 178, 177, 154, 153, 152, 149, 148, 147, 146, - 143, 142, 137, 136, 135, 134, 133, 132, 131, 130, - 129, 128, 127, 126, 125, 124, 123, 122, 117, 116, - 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, - 105, 104, 103, 102, 101, 100, 99, 98, 83, 74, - 62, 54, 84, 83, 75, 62, 57, 54, 571, 3, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - - 571, 571, 571, 571, 571, 571 + 4, 4, 4, 5, 4, 6, 4, 7, 7, 4, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 4, 30, 31, 32, 11, 33, 34, 35, + 16, 36, 18, 37, 38, 21, 39, 23, 24, 25, + 40, 23, 41, 42, 42, 43, 43, 102, 44, 45, + 46, 76, 47, 81, 48, 49, 79, 50, 103, 51, + 52, 84, 53, 82, 77, 71, 54, 97, 55, 80, + 94, 56, 57, 58, 85, 59, 60, 61, 72, 62, + 98, 63, 64, 86, 65, 583, 90, 68, 66, 95, + + 67, 69, 69, 70, 70, 106, 87, 99, 73, 91, + 113, 100, 74, 88, 115, 108, 92, 158, 107, 159, + 118, 110, 114, 182, 101, 605, 116, 183, 93, 109, + 89, 73, 119, 111, 88, 74, 95, 120, 92, 124, + 125, 122, 127, 129, 129, 130, 130, 71, 76, 121, + 93, 89, 126, 123, 128, 79, 84, 86, 90, 97, + 72, 77, 106, 194, 110, 113, 115, 118, 80, 85, + 87, 91, 98, 120, 122, 107, 111, 114, 116, 119, + 125, 127, 139, 139, 68, 121, 123, 186, 69, 69, + 162, 194, 126, 128, 68, 163, 180, 180, 181, 181, + + 194, 194, 195, 131, 187, 194, 132, 194, 133, 194, + 199, 194, 134, 200, 135, 136, 137, 194, 194, 138, + 192, 192, 193, 193, 199, 199, 131, 200, 200, 132, + 194, 224, 199, 225, 134, 200, 135, 136, 137, 199, + 196, 138, 200, 197, 261, 201, 198, 204, 261, 199, + 202, 205, 200, 208, 207, 199, 203, 261, 200, 206, + 217, 217, 218, 218, 226, 231, 232, 211, 261, 227, + 192, 192, 261, 194, 209, 261, 261, 378, 210, 233, + 233, 261, 261, 262, 261, 212, 261, 273, 273, 274, + 274, 283, 378, 264, 281, 284, 213, 263, 214, 199, + + 282, 282, 353, 353, 275, 238, 238, 276, 239, 269, + 287, 240, 199, 241, 265, 200, 379, 242, 268, 243, + 244, 245, 270, 267, 246, 266, 386, 288, 271, 272, + 275, 239, 604, 276, 240, 339, 277, 277, 261, 242, + 340, 243, 244, 245, 306, 307, 246, 317, 337, 317, + 338, 275, 378, 318, 318, 319, 319, 320, 321, 281, + 199, 199, 378, 200, 200, 354, 354, 378, 324, 317, + 368, 325, 378, 326, 369, 362, 362, 327, 372, 328, + 329, 330, 363, 363, 331, 378, 317, 364, 364, 365, + 365, 324, 363, 363, 325, 373, 378, 378, 382, 327, + + 378, 328, 329, 330, 378, 603, 331, 199, 381, 583, + 200, 380, 397, 416, 397, 417, 383, 584, 398, 398, + 399, 399, 405, 405, 406, 418, 199, 448, 407, 200, + 419, 408, 385, 387, 409, 409, 384, 199, 448, 407, + 200, 378, 408, 397, 388, 410, 410, 423, 423, 435, + 435, 397, 389, 436, 436, 441, 441, 436, 436, 407, + 447, 447, 407, 448, 448, 408, 449, 448, 447, 447, + 448, 448, 448, 442, 451, 448, 448, 448, 199, 443, + 476, 200, 597, 460, 444, 445, 461, 446, 478, 462, + 462, 470, 470, 471, 473, 473, 596, 477, 595, 479, + + 407, 443, 582, 408, 448, 456, 444, 445, 455, 579, + 452, 457, 450, 500, 500, 460, 453, 448, 461, 589, + 458, 454, 460, 481, 482, 459, 509, 509, 492, 493, + 510, 510, 518, 518, 519, 520, 520, 519, 494, 527, + 527, 528, 528, 536, 521, 522, 536, 588, 544, 537, + 537, 545, 538, 538, 546, 546, 519, 547, 547, 544, + 549, 549, 545, 550, 550, 548, 548, 519, 553, 553, + 536, 562, 562, 536, 587, 544, 561, 561, 586, 562, + 562, 567, 567, 568, 568, 569, 569, 544, 544, 544, + 545, 545, 545, 568, 568, 546, 546, 544, 570, 570, + + 545, 585, 585, 548, 548, 578, 578, 579, 581, 581, + 582, 590, 590, 591, 591, 583, 594, 594, 598, 598, + 580, 592, 593, 599, 599, 600, 600, 601, 601, 602, + 602, 606, 606, 607, 607, 608, 608, 609, 609, 610, + 610, 610, 610, 611, 611, 612, 612, 448, 448, 448, + 536, 577, 576, 575, 574, 573, 572, 571, 378, 544, + 566, 448, 565, 564, 563, 560, 559, 558, 557, 556, + 555, 554, 552, 551, 378, 378, 378, 543, 542, 541, + 419, 540, 539, 448, 535, 534, 533, 532, 531, 530, + 529, 526, 378, 525, 524, 523, 517, 516, 515, 448, + + 514, 513, 512, 511, 448, 508, 507, 506, 505, 504, + 503, 502, 501, 261, 471, 499, 498, 497, 340, 496, + 495, 378, 494, 491, 490, 489, 488, 448, 448, 487, + 486, 485, 484, 483, 480, 475, 474, 472, 261, 261, + 261, 397, 194, 469, 468, 467, 378, 466, 465, 464, + 463, 378, 448, 407, 406, 440, 261, 439, 438, 437, + 434, 433, 194, 432, 431, 430, 429, 378, 378, 428, + 427, 426, 425, 424, 422, 421, 420, 415, 414, 413, + 412, 411, 194, 194, 317, 404, 403, 402, 227, 401, + 400, 261, 396, 395, 394, 393, 392, 391, 194, 390, + + 378, 377, 376, 375, 374, 371, 370, 367, 366, 361, + 360, 359, 261, 358, 357, 356, 355, 261, 352, 351, + 350, 349, 348, 347, 346, 345, 344, 163, 343, 342, + 341, 336, 335, 334, 333, 332, 281, 323, 322, 194, + 275, 316, 315, 314, 313, 261, 261, 312, 311, 310, + 309, 308, 305, 304, 303, 302, 301, 300, 299, 298, + 297, 296, 295, 194, 294, 293, 292, 291, 290, 289, + 286, 285, 280, 279, 278, 194, 261, 260, 259, 258, + 257, 256, 255, 254, 253, 252, 251, 250, 249, 194, + 194, 248, 247, 199, 237, 236, 235, 234, 230, 229, + + 228, 223, 222, 221, 220, 219, 216, 215, 194, 191, + 190, 189, 188, 185, 184, 177, 176, 169, 168, 165, + 161, 160, 156, 155, 154, 153, 152, 149, 148, 146, + 145, 144, 141, 140, 179, 178, 177, 176, 175, 174, + 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, + 161, 160, 157, 156, 155, 154, 153, 152, 151, 150, + 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, + 104, 124, 117, 112, 104, 94, 83, 75, 104, 117, + 112, 105, 104, 96, 83, 78, 75, 613, 3, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613 } ; -static yyconst short int yy_chk[907] = +static yyconst short int yy_chk[1043] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 6, 6, 7, 7, - 15, 27, 9, 7, 7, 7, 12, 7, 111, 7, - 7, 111, 7, 15, 27, 7, 7, 9, 7, 14, - 10, 12, 111, 7, 8, 17, 7, 24, 8, 8, - 8, 8, 10, 19, 14, 10, 19, 10, 21, 22, - 17, 21, 24, 22, 26, 30, 31, 31, 26, 32, - 32, 19, 21, 19, 33, 35, 21, 36, 38, 39, - - 30, 40, 42, 44, 26, 46, 46, 87, 87, 33, - 35, 92, 36, 38, 39, 103, 40, 42, 44, 45, - 47, 68, 69, 68, 47, 47, 88, 88, 69, 89, - 45, 92, 107, 45, 89, 45, 101, 110, 115, 45, - 118, 119, 45, 45, 45, 120, 103, 107, 45, 97, - 97, 97, 97, 127, 123, 101, 119, 123, 120, 130, - 125, 131, 130, 132, 133, 110, 132, 133, 123, 115, - 134, 138, 138, 134, 118, 125, 135, 132, 127, 135, - 139, 139, 145, 146, 145, 150, 150, 151, 151, 146, - 130, 131, 133, 177, 178, 154, 179, 182, 181, 134, - - 135, 154, 154, 159, 188, 180, 183, 184, 560, 159, - 159, 179, 177, 187, 159, 186, 248, 159, 248, 159, - 184, 183, 557, 159, 293, 178, 159, 159, 159, 181, - 186, 182, 159, 180, 188, 189, 189, 199, 187, 190, - 190, 193, 199, 198, 193, 202, 219, 193, 193, 198, - 198, 231, 219, 219, 232, 293, 235, 231, 231, 556, - 232, 232, 235, 235, 237, 202, 249, 237, 241, 555, - 253, 255, 249, 253, 255, 260, 264, 264, 260, 241, - 265, 265, 241, 275, 241, 276, 276, 292, 241, 275, - 275, 241, 241, 241, 277, 280, 280, 241, 281, 281, - - 277, 277, 284, 287, 294, 295, 292, 284, 296, 297, - 298, 299, 301, 302, 303, 309, 356, 356, 309, 294, - 334, 547, 311, 287, 299, 298, 334, 301, 311, 311, - 312, 545, 333, 295, 333, 544, 312, 312, 302, 296, - 320, 320, 320, 297, 303, 324, 370, 325, 324, 338, - 325, 324, 324, 325, 325, 338, 338, 351, 353, 355, - 351, 353, 357, 364, 364, 355, 355, 371, 357, 357, - 365, 367, 367, 368, 372, 369, 368, 370, 373, 368, - 368, 374, 371, 375, 376, 379, 365, 380, 392, 378, - 539, 392, 538, 365, 369, 399, 399, 376, 375, 365, - - 365, 402, 372, 365, 378, 381, 429, 429, 381, 373, - 379, 381, 381, 403, 536, 374, 527, 380, 393, 393, - 393, 402, 405, 406, 527, 405, 403, 418, 420, 406, - 406, 420, 535, 418, 418, 439, 439, 440, 440, 450, - 450, 450, 451, 451, 451, 452, 458, 458, 459, 459, - 467, 452, 452, 468, 534, 476, 467, 467, 476, 468, - 468, 476, 476, 476, 477, 477, 478, 479, 479, 478, - 480, 480, 478, 478, 478, 486, 486, 494, 495, 495, - 496, 533, 502, 494, 494, 531, 496, 496, 502, 502, - 504, 504, 505, 505, 506, 526, 507, 506, 526, 507, - - 506, 506, 507, 507, 508, 510, 510, 508, 528, 528, - 508, 508, 519, 519, 519, 525, 525, 525, 537, 537, - 540, 540, 541, 542, 542, 548, 548, 524, 541, 541, - 549, 549, 550, 550, 551, 551, 552, 552, 558, 558, - 559, 559, 562, 562, 563, 563, 564, 564, 565, 565, - 566, 566, 567, 567, 523, 522, 521, 520, 518, 517, - 516, 515, 514, 513, 512, 509, 503, 501, 500, 499, - 498, 497, 493, 492, 491, 490, 489, 488, 487, 485, - 484, 483, 482, 481, 475, 474, 473, 472, 471, 470, - 469, 466, 465, 464, 463, 462, 461, 460, 457, 456, - - 455, 454, 453, 449, 448, 447, 446, 445, 444, 443, - 442, 441, 438, 437, 436, 435, 434, 433, 432, 431, - 430, 428, 427, 426, 425, 424, 423, 422, 421, 419, - 417, 416, 415, 414, 413, 412, 411, 410, 409, 408, - 407, 404, 401, 400, 398, 397, 396, 395, 394, 391, - 390, 389, 388, 387, 386, 385, 384, 383, 382, 377, - 366, 363, 362, 361, 360, 359, 358, 354, 352, 350, - 349, 348, 347, 346, 345, 344, 343, 342, 341, 340, - 339, 337, 336, 335, 332, 331, 330, 329, 328, 327, - 326, 321, 319, 318, 317, 316, 315, 314, 313, 310, - - 308, 307, 306, 305, 304, 300, 291, 290, 289, 288, - 286, 285, 283, 282, 279, 278, 274, 273, 272, 271, - 270, 269, 268, 267, 266, 263, 262, 261, 259, 258, - 257, 256, 254, 252, 251, 250, 247, 246, 245, 244, - 243, 242, 240, 239, 238, 236, 234, 233, 230, 229, - 228, 227, 226, 225, 224, 223, 222, 221, 220, 218, - 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, - 207, 206, 205, 204, 203, 201, 200, 197, 196, 195, - 194, 192, 191, 185, 174, 173, 172, 171, 170, 169, - 168, 167, 166, 165, 164, 163, 162, 161, 160, 158, - - 157, 156, 155, 153, 152, 149, 148, 147, 144, 143, - 142, 141, 140, 121, 99, 98, 96, 95, 94, 93, - 91, 90, 86, 85, 84, 82, 81, 80, 79, 78, - 77, 76, 75, 74, 73, 72, 71, 70, 67, 66, - 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, - 55, 54, 53, 52, 51, 50, 49, 48, 43, 41, - 37, 34, 29, 28, 23, 16, 13, 11, 3, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, - - 571, 571, 571, 571, 571, 571 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 5, 5, 6, 6, 25, 6, 6, + 6, 10, 6, 13, 6, 6, 12, 6, 25, 6, + 6, 15, 6, 13, 10, 8, 6, 22, 6, 12, + 20, 6, 6, 6, 15, 6, 6, 6, 8, 6, + 22, 6, 6, 17, 6, 602, 19, 7, 6, 20, + + 6, 7, 7, 7, 7, 28, 17, 24, 8, 19, + 32, 24, 8, 17, 33, 29, 19, 89, 28, 89, + 35, 30, 32, 131, 24, 599, 33, 131, 19, 29, + 17, 30, 35, 30, 36, 30, 38, 36, 37, 38, + 39, 37, 41, 42, 42, 43, 43, 44, 46, 36, + 37, 36, 39, 37, 41, 47, 49, 50, 51, 53, + 44, 46, 55, 142, 56, 58, 59, 61, 47, 49, + 50, 51, 53, 62, 63, 55, 56, 58, 59, 61, + 65, 67, 69, 69, 70, 62, 63, 134, 70, 70, + 92, 143, 65, 67, 68, 92, 129, 129, 130, 130, + + 150, 157, 142, 68, 134, 158, 68, 147, 68, 167, + 151, 159, 68, 151, 68, 68, 68, 162, 166, 68, + 139, 139, 139, 139, 164, 170, 68, 164, 170, 68, + 171, 187, 172, 187, 68, 172, 68, 68, 68, 173, + 143, 68, 173, 147, 219, 151, 150, 159, 220, 174, + 157, 162, 174, 167, 166, 175, 158, 221, 175, 164, + 180, 180, 181, 181, 188, 192, 192, 172, 222, 188, + 193, 193, 224, 194, 170, 226, 223, 332, 171, 194, + 194, 230, 225, 219, 229, 173, 228, 231, 231, 232, + 232, 239, 339, 221, 238, 239, 174, 220, 175, 199, + + 238, 238, 306, 306, 277, 199, 199, 277, 199, 226, + 242, 199, 293, 199, 222, 293, 332, 199, 225, 199, + 199, 199, 228, 224, 199, 223, 339, 242, 229, 230, + 233, 199, 598, 233, 199, 289, 233, 233, 261, 199, + 289, 199, 199, 199, 261, 261, 199, 273, 288, 274, + 288, 275, 335, 273, 273, 274, 274, 275, 275, 281, + 295, 300, 333, 295, 300, 307, 307, 336, 281, 317, + 324, 281, 334, 281, 324, 317, 317, 281, 327, 281, + 281, 281, 318, 318, 281, 337, 319, 320, 320, 321, + 321, 281, 319, 319, 281, 327, 338, 341, 335, 281, + + 342, 281, 281, 281, 343, 597, 281, 349, 334, 569, + 349, 333, 353, 373, 354, 373, 336, 569, 353, 353, + 354, 354, 362, 362, 362, 374, 391, 411, 364, 391, + 374, 364, 338, 341, 364, 364, 337, 393, 413, 365, + 393, 378, 365, 397, 342, 365, 365, 378, 378, 397, + 397, 399, 343, 398, 398, 406, 406, 399, 399, 407, + 409, 409, 410, 412, 414, 410, 411, 415, 410, 410, + 416, 418, 417, 407, 413, 420, 421, 422, 434, 407, + 444, 434, 589, 423, 407, 407, 423, 407, 445, 423, + 423, 435, 435, 435, 441, 441, 587, 444, 586, 445, + + 447, 407, 581, 447, 580, 418, 407, 407, 417, 578, + 414, 420, 412, 471, 471, 462, 415, 448, 462, 577, + 421, 416, 460, 448, 448, 422, 481, 481, 460, 460, + 482, 482, 492, 492, 492, 493, 493, 493, 494, 500, + 500, 501, 501, 509, 494, 494, 510, 576, 518, 509, + 509, 518, 510, 510, 518, 518, 518, 519, 519, 520, + 521, 521, 520, 522, 522, 520, 520, 520, 528, 528, + 536, 537, 537, 538, 575, 544, 536, 536, 573, 538, + 538, 544, 544, 546, 546, 547, 547, 548, 568, 549, + 548, 568, 549, 548, 548, 549, 549, 550, 552, 552, + + 550, 570, 570, 550, 550, 561, 561, 561, 567, 567, + 567, 579, 579, 582, 582, 583, 584, 584, 590, 590, + 566, 583, 583, 591, 591, 592, 592, 593, 593, 594, + 594, 600, 600, 601, 601, 604, 604, 605, 605, 606, + 606, 607, 607, 608, 608, 609, 609, 565, 564, 563, + 562, 560, 559, 558, 557, 556, 555, 554, 551, 545, + 543, 542, 541, 540, 539, 535, 534, 533, 532, 531, + 530, 529, 527, 526, 525, 524, 523, 517, 516, 515, + 514, 513, 512, 511, 508, 507, 506, 505, 504, 503, + 502, 499, 498, 497, 496, 495, 491, 490, 489, 488, + + 487, 486, 485, 484, 483, 480, 479, 478, 477, 476, + 475, 474, 473, 472, 470, 469, 468, 467, 466, 465, + 464, 463, 461, 459, 458, 457, 456, 455, 454, 453, + 452, 451, 450, 449, 446, 443, 442, 440, 439, 438, + 437, 436, 433, 432, 431, 430, 429, 428, 427, 426, + 425, 424, 419, 408, 405, 404, 403, 402, 401, 400, + 394, 392, 390, 389, 388, 387, 386, 385, 384, 383, + 382, 381, 380, 379, 377, 376, 375, 372, 371, 370, + 369, 368, 367, 366, 363, 361, 360, 359, 358, 357, + 356, 355, 352, 351, 350, 348, 347, 346, 345, 344, + + 340, 331, 330, 329, 328, 326, 325, 323, 322, 316, + 315, 314, 313, 312, 311, 310, 309, 308, 305, 304, + 303, 302, 301, 299, 298, 297, 296, 294, 292, 291, + 290, 287, 286, 285, 284, 283, 282, 280, 279, 278, + 276, 272, 271, 270, 269, 268, 267, 266, 265, 264, + 263, 262, 260, 259, 258, 257, 256, 255, 254, 253, + 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, + 241, 240, 237, 236, 235, 234, 227, 216, 215, 214, + 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, + 203, 202, 201, 200, 198, 197, 196, 195, 191, 190, + + 189, 186, 185, 184, 183, 182, 179, 178, 163, 138, + 137, 136, 135, 133, 132, 128, 127, 126, 125, 124, + 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, + 113, 112, 111, 110, 109, 108, 107, 106, 105, 103, + 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, + 91, 90, 88, 87, 86, 85, 84, 83, 82, 81, + 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, + 66, 64, 60, 57, 54, 52, 48, 45, 40, 34, + 31, 27, 26, 21, 14, 11, 9, 3, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613 } ; static yy_state_type yy_last_accepting_state; @@ -749,12 +793,31 @@ static char *yy_last_accepting_cpos; char *yytext; #line 1 "dtimep.lex" #define INITIAL 0 -#line 3 "dtimep.lex" +#line 6 "dtimep.lex" #include #include + /* Since we're looking at a string at a time, don't worry about + * wrapping to the next buffer. + */ +#define yywrap() 1 +#define YY_SKIP_YYWRAP + #define YY_NO_UNPUT -#define YY_DECL struct tws * dparsetime(char *lexstr) + + /* This is the tricky thing that makes this function cool. We + * replace the traditional int yylex(void) declaration with our + * dparsetime() declaration, essentially piggy-backing off the + * utility of the yylex() function and adding what we need to make + * the parsing function useful to us. + */ +#define YY_DECL struct tws *dparsetime(char *lexstr) + + /* yyerminate() is called after the input string is matched to + * completion (actually, when the lexer reaches an EOF). The only + * thing that really needs to be in this macro function is the + * return call, which must be substituted inline into dparsetime. + */ #define yyterminate() (void)yy_delete_buffer(lexhandle); \ if(!(tw.tw_flags & TW_SUCC)) { \ @@ -832,44 +895,59 @@ static int day_map[] = { 3 /*11 - Wed */ }; -#define INIT() { cp = yytext;} -#define SETWDAY() { cp++; \ - tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \ - tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; \ - SKIPA(); } -#define SETMON() { cp++; \ - tw.tw_mon = month_map[(cp[0] + cp[1]) & 0x1f]; \ - SKIPA(); } +/* The SET* macros will parse for the appropriate field, and leave the + * cp pointer at the first character after the desired field. Be + * careful with variable-length fields or alpha-num mixes. + + * The SKIP* macros skip over characters of a particular class and + * leave cp at the position of the first character that doesn't match + * that class. Correspondingly, SKIPTO* skips until it reaches a + * character of a particular class. + */ + +#define INIT() { cp = yytext;} +#define SETWDAY() { cp++; \ + tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \ + tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; \ + SKIPA(); } +#define SETMON() { cp++; \ + tw.tw_mon = month_map[(cp[0] + cp[1]) & 0x1f]; \ + SKIPA(); } #define SETMON_NUM() { tw.tw_mon = atoi(cp)-1; \ - SKIPD(); } -#define SETYEAR() { tw.tw_year = atoi(cp); \ - SKIPD(); } -#define SETDAY() { tw.tw_mday = atoi(cp); \ - tw.tw_flags |= TW_YES; \ - SKIPD(); } -#define SETTIME() { tw.tw_hour = atoi(cp); \ - cp += 2; \ - SKIPTOD(); \ - tw.tw_min = atoi(cp); \ - cp += 2; \ - if(*cp == ':') { tw.tw_sec = atoi(++cp); SKIPD(); } \ - } -#define SETZONE(x) { tw.tw_zone = ((x)/100)*60+(x)%100; \ - tw.tw_flags |= TW_SZEXP; \ - SKIPD(); } -#define SETDST() { tw.tw_flags |= TW_DST; } -#define SKIPD() { while ( isdigit(*cp++) ) ; \ - --cp; } -#define SKIPTOD() { while ( !isdigit(*cp++) ) ; \ - --cp; } -#define SKIPA() { while ( isalpha(*cp++) ) ; \ - --cp; } -#define SKIPTOA() { while ( !isalpha(*cp++) ) ; \ - --cp; } -#define SKIPSP() { while ( isspace(*cp++) ) ; \ - --cp; } -#define SKIPTOSP() { while ( !isspace(*cp++) ) ; \ - --cp; } + SKIPD(); } +#define SETYEAR() { tw.tw_year = atoi(cp); \ + SKIPD(); } +#define SETDAY() { tw.tw_mday = atoi(cp); \ + tw.tw_flags |= TW_YES; \ + SKIPD(); } +#define SETTIME() { tw.tw_hour = atoi(cp); \ + cp += 2; \ + SKIPTOD(); \ + tw.tw_min = atoi(cp); \ + cp += 2; \ + if(*cp == ':') { \ + tw.tw_sec = atoi(++cp); SKIPD(); } } +#define SETZONE(x) { tw.tw_zone = ((x)/100)*60+(x)%100; \ + tw.tw_flags |= TW_SZEXP; \ + SKIPD(); } +#define SETDST() { tw.tw_flags |= TW_DST; } +#define SKIPD() { while ( isdigit(*cp++) ) ; \ + --cp; } +#define SKIPTOD() { while ( !isdigit(*cp++) ) ; \ + --cp; } +#define SKIPA() { while ( isalpha(*cp++) ) ; \ + --cp; } +#define SKIPTOA() { while ( !isalpha(*cp++) ) ; \ + --cp; } +#define SKIPSP() { while ( isspace(*cp++) ) ; \ + --cp; } +#define SKIPTOSP() { while ( !isspace(*cp++) ) ; \ + --cp; } +/* The year can either be 2 digits, or 4. However, after +Y2K, we found that some MUA were reporting the year 100, hence +the middle term here. yyterminate() resolves the actual +issues with 2-digit years. +*/ /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1020,16 +1098,19 @@ YY_DECL register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; -#line 159 "dtimep.lex" +#line 197 "dtimep.lex" + /* This section begins the definition of dparsetime(). + Put here any local variable definitions and initializations */ YY_BUFFER_STATE lexhandle; - register char *cp; /* *cp is internal to the lexing function yylex() */ + register char *cp; static struct tws tw; memset(&tw,0,sizeof(struct tws)); + lexhandle = yy_scan_string(lexstr); @@ -1083,13 +1164,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 572 ) + if ( yy_current_state >= 614 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 870 ); + while ( yy_base[yy_current_state] != 989 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1117,7 +1198,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 171 "dtimep.lex" +#line 212 "dtimep.lex" { INIT(); SETWDAY(); @@ -1129,11 +1210,11 @@ YY_RULE_SETUP SETTIME(); SKIPTOD(); SETYEAR(); - } + } YY_BREAK case 2: YY_RULE_SETUP -#line 184 "dtimep.lex" +#line 225 "dtimep.lex" { INIT(); SETWDAY(); @@ -1145,11 +1226,11 @@ YY_RULE_SETUP SETYEAR(); SKIPTOD(); SETTIME(); - } + } YY_BREAK case 3: YY_RULE_SETUP -#line 196 "dtimep.lex" +#line 237 "dtimep.lex" { INIT(); SETDAY(); @@ -1159,11 +1240,11 @@ YY_RULE_SETUP SETYEAR(); SKIPTOD(); SETTIME(); - } + } YY_BREAK case 4: YY_RULE_SETUP -#line 206 "dtimep.lex" +#line 247 "dtimep.lex" { INIT(); SETWDAY(); @@ -1175,11 +1256,11 @@ YY_RULE_SETUP SETYEAR(); SKIPTOD(); SETTIME(); - } + } YY_BREAK case 5: YY_RULE_SETUP -#line 218 "dtimep.lex" +#line 259 "dtimep.lex" { INIT(); SETWDAY(); @@ -1189,11 +1270,11 @@ YY_RULE_SETUP SETDAY(); SKIPTOD(); SETYEAR(); - } + } YY_BREAK case 6: YY_RULE_SETUP -#line 228 "dtimep.lex" +#line 269 "dtimep.lex" { INIT(); SETMON(); @@ -1203,11 +1284,11 @@ YY_RULE_SETUP SETYEAR(); SKIPTOA(); SETWDAY(); - } + } YY_BREAK case 7: YY_RULE_SETUP -#line 238 "dtimep.lex" +#line 279 "dtimep.lex" { INIT(); SETMON(); @@ -1215,11 +1296,11 @@ YY_RULE_SETUP SETDAY(); SKIPTOD(); SETYEAR(); - } + } YY_BREAK case 8: YY_RULE_SETUP -#line 246 "dtimep.lex" +#line 287 "dtimep.lex" { INIT(); if(europeandate) { @@ -1237,11 +1318,11 @@ YY_RULE_SETUP SETYEAR(); SKIPTOD(); SETTIME(); - } + } YY_BREAK case 9: YY_RULE_SETUP -#line 264 "dtimep.lex" +#line 305 "dtimep.lex" { INIT(); if(europeandate) { @@ -1257,173 +1338,168 @@ YY_RULE_SETUP } SKIPTOD(); SETYEAR(); - } + } YY_BREAK case 10: YY_RULE_SETUP -#line 281 "dtimep.lex" +#line 322 "dtimep.lex" YY_BREAK case 11: YY_RULE_SETUP -#line 282 "dtimep.lex" +#line 323 "dtimep.lex" tw.tw_hour += 12; YY_BREAK case 12: YY_RULE_SETUP -#line 284 "dtimep.lex" +#line 325 "dtimep.lex" { INIT(); SKIPTOD(); SETZONE(atoi(cp)); - } + } YY_BREAK case 13: YY_RULE_SETUP -#line 289 "dtimep.lex" +#line 330 "dtimep.lex" { INIT(); SKIPTOD(); SETZONE(-atoi(cp)); - } + } YY_BREAK case 14: YY_RULE_SETUP -#line 294 "dtimep.lex" +#line 335 "dtimep.lex" INIT(); SETZONE(0); YY_BREAK case 15: YY_RULE_SETUP -#line 295 "dtimep.lex" +#line 336 "dtimep.lex" INIT(); SETZONE(0); YY_BREAK case 16: YY_RULE_SETUP -#line 296 "dtimep.lex" +#line 337 "dtimep.lex" INIT(); SETZONE(200); YY_BREAK case 17: YY_RULE_SETUP -#line 297 "dtimep.lex" +#line 338 "dtimep.lex" INIT(); SETDST(); SETZONE(2); YY_BREAK case 18: YY_RULE_SETUP -#line 298 "dtimep.lex" +#line 339 "dtimep.lex" INIT(); SETZONE(-500); YY_BREAK case 19: YY_RULE_SETUP -#line 299 "dtimep.lex" +#line 340 "dtimep.lex" INIT(); SETDST(); SETZONE(-500); YY_BREAK case 20: YY_RULE_SETUP -#line 300 "dtimep.lex" +#line 341 "dtimep.lex" INIT(); SETZONE(-600); YY_BREAK case 21: YY_RULE_SETUP -#line 301 "dtimep.lex" +#line 342 "dtimep.lex" INIT(); SETDST(); SETZONE(-600); YY_BREAK case 22: YY_RULE_SETUP -#line 302 "dtimep.lex" +#line 343 "dtimep.lex" INIT(); SETZONE(-700); YY_BREAK case 23: YY_RULE_SETUP -#line 303 "dtimep.lex" +#line 344 "dtimep.lex" INIT(); SETDST(); SETZONE(-700); YY_BREAK case 24: YY_RULE_SETUP -#line 304 "dtimep.lex" +#line 345 "dtimep.lex" INIT(); SETZONE(-800); YY_BREAK case 25: YY_RULE_SETUP -#line 305 "dtimep.lex" +#line 346 "dtimep.lex" INIT(); SETDST(); SETZONE(-800); YY_BREAK case 26: YY_RULE_SETUP -#line 306 "dtimep.lex" +#line 347 "dtimep.lex" INIT(); SETZONE(-330); YY_BREAK case 27: YY_RULE_SETUP -#line 307 "dtimep.lex" +#line 348 "dtimep.lex" INIT(); SETZONE(-400); YY_BREAK case 28: YY_RULE_SETUP -#line 308 "dtimep.lex" +#line 349 "dtimep.lex" INIT(); SETDST(); SETZONE(-400); YY_BREAK case 29: YY_RULE_SETUP -#line 309 "dtimep.lex" +#line 350 "dtimep.lex" INIT(); SETZONE(-900); YY_BREAK case 30: YY_RULE_SETUP -#line 310 "dtimep.lex" +#line 351 "dtimep.lex" INIT(); SETDST(); SETZONE(-900); YY_BREAK case 31: YY_RULE_SETUP -#line 311 "dtimep.lex" +#line 352 "dtimep.lex" INIT(); SETZONE(-1000); YY_BREAK case 32: YY_RULE_SETUP -#line 312 "dtimep.lex" +#line 353 "dtimep.lex" INIT(); SETDST(); SETZONE(-1000); YY_BREAK case 33: YY_RULE_SETUP -#line 313 "dtimep.lex" +#line 354 "dtimep.lex" INIT(); SETDST(); SETZONE(-100); YY_BREAK case 34: YY_RULE_SETUP -#line 314 "dtimep.lex" +#line 355 "dtimep.lex" { INIT(); SETZONE(100*(('a'-1) - tolower(*cp))); - } + } YY_BREAK case 35: YY_RULE_SETUP -#line 318 "dtimep.lex" +#line 359 "dtimep.lex" { INIT(); SETZONE(100*('a' - tolower(*cp))); - } + } YY_BREAK case 36: YY_RULE_SETUP -#line 322 "dtimep.lex" +#line 363 "dtimep.lex" { INIT(); SETZONE(100*(tolower(*cp) - 'm')); - } + } YY_BREAK case 37: YY_RULE_SETUP -#line 328 "dtimep.lex" +#line 367 "dtimep.lex" YY_BREAK case 38: YY_RULE_SETUP -#line 329 "dtimep.lex" - - YY_BREAK -case 39: -YY_RULE_SETUP -#line 333 "dtimep.lex" +#line 368 "dtimep.lex" ECHO; YY_BREAK case YY_STATE_EOF(INITIAL): @@ -1717,7 +1793,7 @@ static yy_state_type yy_get_previous_state() while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 572 ) + if ( yy_current_state >= 614 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1752,11 +1828,11 @@ yy_state_type yy_current_state; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 572 ) + if ( yy_current_state >= 614 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 571); + yy_is_jam = (yy_current_state == 613); return yy_is_jam ? 0 : yy_current_state; } @@ -2311,4 +2387,4 @@ int main() return 0; } #endif -#line 333 "dtimep.lex" +#line 368 "dtimep.lex" diff --git a/sbr/dtimep.lex b/sbr/dtimep.lex index 693925e..4f01980 100644 --- a/sbr/dtimep.lex +++ b/sbr/dtimep.lex @@ -1,10 +1,32 @@ -%option noyywrap +%e 2000 +%p 5000 +%n 1000 +%a 4000 %{ #include #include + /* Since we're looking at a string at a time, don't worry about + * wrapping to the next buffer. + */ +#define yywrap() 1 +#define YY_SKIP_YYWRAP + #define YY_NO_UNPUT -#define YY_DECL struct tws * dparsetime(char *lexstr) + + /* This is the tricky thing that makes this function cool. We + * replace the traditional int yylex(void) declaration with our + * dparsetime() declaration, essentially piggy-backing off the + * utility of the yylex() function and adding what we need to make + * the parsing function useful to us. + */ +#define YY_DECL struct tws *dparsetime(char *lexstr) + + /* yyerminate() is called after the input string is matched to + * completion (actually, when the lexer reaches an EOF). The only + * thing that really needs to be in this macro function is the + * return call, which must be substituted inline into dparsetime. + */ #define yyterminate() (void)yy_delete_buffer(lexhandle); \ if(!(tw.tw_flags & TW_SUCC)) { \ @@ -82,73 +104,89 @@ static int day_map[] = { 3 /*11 - Wed */ }; -#define INIT() { cp = yytext;} -#define SETWDAY() { cp++; \ - tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \ - tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; \ - SKIPA(); } -#define SETMON() { cp++; \ - tw.tw_mon = month_map[(cp[0] + cp[1]) & 0x1f]; \ - SKIPA(); } +/* The SET* macros will parse for the appropriate field, and leave the + * cp pointer at the first character after the desired field. Be + * careful with variable-length fields or alpha-num mixes. + + * The SKIP* macros skip over characters of a particular class and + * leave cp at the position of the first character that doesn't match + * that class. Correspondingly, SKIPTO* skips until it reaches a + * character of a particular class. + */ + +#define INIT() { cp = yytext;} +#define SETWDAY() { cp++; \ + tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \ + tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; \ + SKIPA(); } +#define SETMON() { cp++; \ + tw.tw_mon = month_map[(cp[0] + cp[1]) & 0x1f]; \ + SKIPA(); } #define SETMON_NUM() { tw.tw_mon = atoi(cp)-1; \ - SKIPD(); } -#define SETYEAR() { tw.tw_year = atoi(cp); \ - SKIPD(); } -#define SETDAY() { tw.tw_mday = atoi(cp); \ - tw.tw_flags |= TW_YES; \ - SKIPD(); } -#define SETTIME() { tw.tw_hour = atoi(cp); \ - cp += 2; \ - SKIPTOD(); \ - tw.tw_min = atoi(cp); \ - cp += 2; \ - if(*cp == ':') { tw.tw_sec = atoi(++cp); SKIPD(); } \ - } -#define SETZONE(x) { tw.tw_zone = ((x)/100)*60+(x)%100; \ - tw.tw_flags |= TW_SZEXP; \ - SKIPD(); } -#define SETDST() { tw.tw_flags |= TW_DST; } -#define SKIPD() { while ( isdigit(*cp++) ) ; \ - --cp; } -#define SKIPTOD() { while ( !isdigit(*cp++) ) ; \ - --cp; } -#define SKIPA() { while ( isalpha(*cp++) ) ; \ - --cp; } -#define SKIPTOA() { while ( !isalpha(*cp++) ) ; \ - --cp; } -#define SKIPSP() { while ( isspace(*cp++) ) ; \ - --cp; } -#define SKIPTOSP() { while ( !isspace(*cp++) ) ; \ - --cp; } + SKIPD(); } +#define SETYEAR() { tw.tw_year = atoi(cp); \ + SKIPD(); } +#define SETDAY() { tw.tw_mday = atoi(cp); \ + tw.tw_flags |= TW_YES; \ + SKIPD(); } +#define SETTIME() { tw.tw_hour = atoi(cp); \ + cp += 2; \ + SKIPTOD(); \ + tw.tw_min = atoi(cp); \ + cp += 2; \ + if(*cp == ':') { \ + tw.tw_sec = atoi(++cp); SKIPD(); } } +#define SETZONE(x) { tw.tw_zone = ((x)/100)*60+(x)%100; \ + tw.tw_flags |= TW_SZEXP; \ + SKIPD(); } +#define SETDST() { tw.tw_flags |= TW_DST; } +#define SKIPD() { while ( isdigit(*cp++) ) ; \ + --cp; } +#define SKIPTOD() { while ( !isdigit(*cp++) ) ; \ + --cp; } +#define SKIPA() { while ( isalpha(*cp++) ) ; \ + --cp; } +#define SKIPTOA() { while ( !isalpha(*cp++) ) ; \ + --cp; } +#define SKIPSP() { while ( isspace(*cp++) ) ; \ + --cp; } +#define SKIPTOSP() { while ( !isspace(*cp++) ) ; \ + --cp; } %} -sun (sun(day)?) -mon (mon(day)?) -tue (tue(sday)?) -wed (wed(nesday)?) -thu (thu(rsday)?) -fri (fri(day)?) -sat (sat(urday)?) +sun ([Ss]un(day)?) +mon ([Mm]on(day)?) +tue ([Tt]ue(sday)?) +wed ([Ww]ed(nesday)?) +thu ([Tt]hu(rsday)?) +fri ([Ff]ri(day)?) +sat ([Ss]at(urday)?) DAY ({sun}|{mon}|{tue}|{wed}|{thu}|{fri}|{sat}) -jan (jan(uary)?) -feb (feb(ruary)?) -mar (mar(ch)?) -apr (apr(il)?) -may (may) -jun (jun(e)?) -jul (jul(y)?) -aug (aug(ust)?) -sep (sep(tember)?) -oct (oct(ober)?) -nov (nov(ember)?) -dec (dec(ember)?) +jan ([Jj]an(uary)?) +feb ([Ff]eb(ruary)?) +mar ([Mm]ar(ch)?) +apr ([Aa]pr(il)?) +may ([Mm]ay) +jun ([Jj]un(e)?) +jul ([Jj]ul(y)?) +aug ([Aa]ug(ust)?) +sep ([Ss]ep(tember)?) +oct ([Oo]ct(ober)?) +nov ([Nn]ov(ember)?) +dec ([Dd]ec(ember)?) MONTH ({jan}|{feb}|{mar}|{apr}|{may}|{jun}|{jul}|{aug}|{sep}|{oct}|{nov}|{dec}) TIME ({D}:{d}{d}(:{d}{d})?) + /* The year can either be 2 digits, or 4. However, after + Y2K, we found that some MUA were reporting the year 100, hence + the middle term here. yyterminate() resolves the actual + issues with 2-digit years. + */ + YEAR (({d}{d})|(1{d}{d})|({d}{4})) w ([ \t]*) @@ -158,17 +196,20 @@ d [0-9] %% %{ + /* This section begins the definition of dparsetime(). + Put here any local variable definitions and initializations */ YY_BUFFER_STATE lexhandle; - register char *cp; /* *cp is internal to the lexing function yylex() */ + register char *cp; static struct tws tw; memset(&tw,0,sizeof(struct tws)); + lexhandle = yy_scan_string(lexstr); %} -{DAY}","?{W}{MONTH}{W}{D}{W}{TIME}{W}{YEAR} { +{DAY}","?{W}{MONTH}{W}{D}{W}{TIME}{W}{YEAR} { INIT(); SETWDAY(); SKIPTOA(); @@ -179,9 +220,9 @@ d [0-9] SETTIME(); SKIPTOD(); SETYEAR(); - } + } -{DAY}","?{W}{D}{W}{MONTH}{W}{YEAR}{W}{TIME} { +{DAY}","?{W}{D}{W}{MONTH}{W}{YEAR}{W}{TIME} { INIT(); SETWDAY(); SKIPTOD(); @@ -192,8 +233,8 @@ d [0-9] SETYEAR(); SKIPTOD(); SETTIME(); - } -{D}{W}{MONTH}{W}{YEAR}{W}{TIME} { + } +{D}{W}{MONTH}{W}{YEAR}{W}{TIME} { INIT(); SETDAY(); SKIPTOA(); @@ -202,8 +243,8 @@ d [0-9] SETYEAR(); SKIPTOD(); SETTIME(); - } -{DAY}","?{W}{MONTH}{W}{D}","?{W}{YEAR}","?{W}{TIME} { + } +{DAY}","?{W}{MONTH}{W}{D}","?{W}{YEAR}","?{W}{TIME} { INIT(); SETWDAY(); SKIPTOA(); @@ -214,8 +255,8 @@ d [0-9] SETYEAR(); SKIPTOD(); SETTIME(); - } -{DAY}","?{W}{MONTH}{W}{D}","?{W}{YEAR} { + } +{DAY}","?{W}{MONTH}{W}{D}","?{W}{YEAR} { INIT(); SETWDAY(); SKIPTOA(); @@ -224,8 +265,8 @@ d [0-9] SETDAY(); SKIPTOD(); SETYEAR(); - } -{MONTH}{W}{D}","?{W}{YEAR}","?{W}{DAY} { + } +{MONTH}{W}{D}","?{W}{YEAR}","?{W}{DAY} { INIT(); SETMON(); SKIPTOD(); @@ -234,16 +275,16 @@ d [0-9] SETYEAR(); SKIPTOA(); SETWDAY(); - } -{MONTH}{W}{D}","?{W}{YEAR} { + } +{MONTH}{W}{D}","?{W}{YEAR} { INIT(); SETMON(); SKIPTOD(); SETDAY(); SKIPTOD(); SETYEAR(); - } -{D}("-"|"/"){D}("-"|"/"){YEAR}{W}{TIME} { + } +{D}("-"|"/"){D}("-"|"/"){YEAR}{W}{TIME} { INIT(); if(europeandate) { /* DD/MM/YY */ @@ -260,8 +301,8 @@ d [0-9] SETYEAR(); SKIPTOD(); SETTIME(); - } -{D}("-"|"/"){D}("-"|"/"){YEAR} { + } +{D}("-"|"/"){D}("-"|"/"){YEAR} { INIT(); if(europeandate) { /* DD/MM/YY */ @@ -276,57 +317,51 @@ d [0-9] } SKIPTOD(); SETYEAR(); - } + } -"[Aa][Mm]" -"[Pp][Mm]" tw.tw_hour += 12; +"[Aa][Mm]" +"[Pp][Mm]" tw.tw_hour += 12; -"+"{D}{d}{d} { +"+"{D}{d}{d} { INIT(); SKIPTOD(); SETZONE(atoi(cp)); - } -"-"{D}{d}{d} { + } +"-"{D}{d}{d} { INIT(); SKIPTOD(); SETZONE(-atoi(cp)); - } -"-"?("ut"|"UT") INIT(); SETZONE(0); -"-"?("gmt"|"GMT") INIT(); SETZONE(0); -"-"?("jst"|"JST") INIT(); SETZONE(200); -"-"?("jdt"|"JDT") INIT(); SETDST(); SETZONE(2); -"-"?("est"|"EST") INIT(); SETZONE(-500); -"-"?("edt"|"EDT") INIT(); SETDST(); SETZONE(-500); -"-"?("cst"|"CST") INIT(); SETZONE(-600); -"-"?("cdt"|"CDT") INIT(); SETDST(); SETZONE(-600); -"-"?("mst"|"MST") INIT(); SETZONE(-700); -"-"?("mdt"|"MDT") INIT(); SETDST(); SETZONE(-700); -"-"?("pst"|"PST") INIT(); SETZONE(-800); -"-"?("pdt"|"PDT") INIT(); SETDST(); SETZONE(-800); -"-"?("nst"|"NST") INIT(); SETZONE(-330); -"-"?("ast"|"AST") INIT(); SETZONE(-400); -"-"?("adt"|"ADT") INIT(); SETDST(); SETZONE(-400); -"-"?("yst"|"YST") INIT(); SETZONE(-900); -"-"?("ydt"|"YDT") INIT(); SETDST(); SETZONE(-900); -"-"?("hst"|"HST") INIT(); SETZONE(-1000); -"-"?("hdt"|"HDT") INIT(); SETDST(); SETZONE(-1000); -"-"?("bst"|"BST") INIT(); SETDST(); SETZONE(-100); -[a-i] { + } +"-"?("ut"|"UT") INIT(); SETZONE(0); +"-"?("gmt"|"GMT") INIT(); SETZONE(0); +"-"?("jst"|"JST") INIT(); SETZONE(200); +"-"?("jdt"|"JDT") INIT(); SETDST(); SETZONE(2); +"-"?("est"|"EST") INIT(); SETZONE(-500); +"-"?("edt"|"EDT") INIT(); SETDST(); SETZONE(-500); +"-"?("cst"|"CST") INIT(); SETZONE(-600); +"-"?("cdt"|"CDT") INIT(); SETDST(); SETZONE(-600); +"-"?("mst"|"MST") INIT(); SETZONE(-700); +"-"?("mdt"|"MDT") INIT(); SETDST(); SETZONE(-700); +"-"?("pst"|"PST") INIT(); SETZONE(-800); +"-"?("pdt"|"PDT") INIT(); SETDST(); SETZONE(-800); +"-"?("nst"|"NST") INIT(); SETZONE(-330); +"-"?("ast"|"AST") INIT(); SETZONE(-400); +"-"?("adt"|"ADT") INIT(); SETDST(); SETZONE(-400); +"-"?("yst"|"YST") INIT(); SETZONE(-900); +"-"?("ydt"|"YDT") INIT(); SETDST(); SETZONE(-900); +"-"?("hst"|"HST") INIT(); SETZONE(-1000); +"-"?("hdt"|"HDT") INIT(); SETDST(); SETZONE(-1000); +"-"?("bst"|"BST") INIT(); SETDST(); SETZONE(-100); +[a-iA-I] { INIT(); SETZONE(100*(('a'-1) - tolower(*cp))); - } -[k-m] { + } +[k-mK-M] { INIT(); SETZONE(100*('a' - tolower(*cp))); - } -[n-y] { + } +[n-yN-Y] { INIT(); SETZONE(100*(tolower(*cp) - 'm')); - } - - -\n -. - - - + } +.|\n -- 1.7.10.4