From 579518c78d0a277f487a03b03c450455089e6770 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Fri, 10 Jul 2015 10:11:51 -0500 Subject: Use `include` for import into namespace --- docs/content/3.manual/manual.yml | 6 +- lexer.c | 384 ++++---- lexer.h | 2 +- lexer.l | 1 + parser.c | 2011 +++++++++++++++++++------------------- parser.h | 112 +-- parser.y | 8 +- tests/jq.test | 6 +- 8 files changed, 1275 insertions(+), 1255 deletions(-) diff --git a/docs/content/3.manual/manual.yml b/docs/content/3.manual/manual.yml index 2fa890b5..a6bfae25 100644 --- a/docs/content/3.manual/manual.yml +++ b/docs/content/3.manual/manual.yml @@ -2737,8 +2737,8 @@ sections: in `.jq`. Modules imported by a program are searched for in a default search - path (see below). The `import` directive allows the importer to - alter this path. + path (see below). The `import` and `include` directives allow the + importer to alter this path. Paths in the a search path are subject to various substitutions. @@ -2795,7 +2795,7 @@ sections: string or array value (array of strings); this is the search path to be prefixed to the top-level search path. - - title: "`import RelativePathString [];`" + - title: "`include RelativePathString [];`" body: | Imports a module found at the given path relative to a diff --git a/lexer.c b/lexer.c index c71dc234..1ff4cba6 100644 --- a/lexer.c +++ b/lexer.c @@ -358,8 +358,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 48 -#define YY_END_OF_BUFFER 49 +#define YY_NUM_RULES 49 +#define YY_END_OF_BUFFER 50 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -367,24 +367,25 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[148] = +static yyconst flex_int16_t yy_accept[154] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 49, 47, 46, 46, 47, 38, 1, 33, - 33, 34, 35, 33, 33, 33, 33, 33, 37, 33, - 33, 33, 47, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 33, 42, 42, - 40, 43, 46, 2, 1, 28, 26, 24, 25, 32, - 37, 45, 45, 17, 27, 0, 30, 3, 31, 36, - 44, 0, 44, 44, 4, 44, 44, 44, 44, 44, - 44, 8, 44, 44, 44, 13, 44, 44, 44, 23, - 42, 41, 39, 41, 45, 0, 37, 29, 37, 0, - - 44, 12, 44, 44, 7, 44, 44, 14, 44, 44, - 44, 44, 44, 44, 18, 0, 41, 44, 44, 44, - 44, 11, 10, 44, 44, 44, 44, 44, 9, 41, - 44, 21, 19, 44, 44, 20, 44, 44, 41, 44, - 44, 5, 6, 15, 22, 16, 0 + 0, 0, 50, 48, 47, 47, 48, 39, 1, 34, + 34, 35, 36, 34, 34, 34, 34, 34, 38, 34, + 34, 34, 48, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 34, 43, 43, + 41, 44, 47, 2, 1, 29, 27, 25, 26, 33, + 38, 46, 46, 18, 28, 0, 31, 3, 32, 37, + 45, 0, 45, 45, 4, 45, 45, 45, 45, 45, + 45, 9, 45, 45, 45, 45, 14, 45, 45, 45, + 24, 43, 42, 40, 42, 46, 0, 38, 30, 38, + + 0, 45, 13, 45, 45, 8, 45, 45, 15, 45, + 45, 45, 45, 45, 45, 45, 19, 0, 42, 45, + 45, 45, 45, 12, 11, 45, 45, 45, 45, 45, + 45, 10, 42, 45, 22, 20, 45, 45, 45, 21, + 45, 45, 42, 45, 45, 5, 45, 7, 16, 23, + 17, 6, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -429,49 +430,51 @@ static yyconst flex_int32_t yy_meta[54] = 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[161] = +static yyconst flex_int16_t yy_base[167] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 51, 52, 306, 307, 57, 59, 283, 307, 0, 307, - 282, 307, 307, 281, 280, 279, 47, 47, 50, 278, - 277, 276, 0, 278, 48, 51, 53, 52, 37, 59, - 57, 66, 56, 63, 68, 70, 71, 274, 0, 0, - 307, 81, 90, 307, 0, 307, 307, 307, 307, 95, - 100, 0, 97, 273, 307, 106, 307, 307, 307, 0, - 275, 274, 85, 104, 273, 101, 77, 109, 110, 113, - 114, 272, 116, 119, 115, 271, 121, 122, 123, 307, - 0, 258, 307, 254, 0, 261, 258, 307, 254, 0, - - 124, 250, 132, 125, 248, 126, 134, 236, 135, 128, - 143, 136, 146, 147, 231, 157, 217, 222, 150, 156, - 155, 220, 217, 157, 158, 159, 161, 163, 215, 195, - 167, 193, 192, 169, 162, 188, 172, 173, 176, 168, - 175, 182, 164, 86, 78, 76, 307, 213, 222, 228, - 233, 238, 247, 256, 261, 266, 268, 273, 277, 281 + 51, 52, 318, 319, 57, 59, 295, 319, 0, 319, + 294, 319, 319, 293, 292, 291, 47, 47, 50, 290, + 289, 288, 0, 290, 48, 51, 53, 52, 37, 59, + 57, 66, 56, 63, 68, 70, 72, 286, 0, 0, + 319, 80, 90, 319, 0, 319, 319, 319, 319, 95, + 99, 0, 106, 285, 319, 110, 319, 319, 319, 0, + 285, 281, 86, 77, 277, 97, 101, 111, 113, 115, + 117, 274, 119, 120, 118, 121, 270, 122, 123, 124, + 319, 0, 257, 319, 255, 0, 254, 249, 319, 245, + + 0, 125, 239, 126, 127, 237, 128, 134, 234, 136, + 143, 147, 148, 149, 152, 154, 232, 165, 212, 210, + 157, 159, 158, 209, 208, 160, 161, 162, 163, 164, + 166, 207, 196, 171, 205, 204, 174, 167, 175, 201, + 170, 176, 190, 190, 184, 199, 194, 198, 197, 85, + 78, 76, 319, 230, 239, 245, 250, 255, 264, 273, + 278, 283, 285, 290, 294, 298 } ; -static yyconst flex_int16_t yy_def[161] = +static yyconst flex_int16_t yy_def[167] = { 0, - 147, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 148, 148, 147, 147, 147, 147, 147, 147, 149, 147, - 147, 147, 147, 147, 147, 147, 150, 147, 147, 147, - 147, 147, 151, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 147, 153, 153, - 147, 154, 147, 147, 149, 147, 147, 147, 147, 147, - 147, 155, 155, 147, 147, 147, 147, 147, 147, 151, - 152, 147, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 147, - 153, 147, 147, 156, 155, 147, 155, 147, 147, 157, - - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 154, 158, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 159, - 152, 152, 152, 152, 152, 152, 152, 152, 160, 152, - 152, 152, 152, 152, 152, 152, 0, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147 + 153, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 154, 154, 153, 153, 153, 153, 153, 153, 155, 153, + 153, 153, 153, 153, 153, 153, 156, 153, 153, 153, + 153, 153, 157, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 158, 153, 159, 159, + 153, 160, 153, 153, 155, 153, 153, 153, 153, 153, + 153, 161, 161, 153, 153, 153, 153, 153, 153, 157, + 158, 153, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 153, 159, 153, 153, 162, 161, 153, 161, 153, 153, + + 163, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 158, 160, 164, 158, + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 165, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 166, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 0, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153 } ; -static yyconst flex_int16_t yy_nxt[361] = +static yyconst flex_int16_t yy_nxt[373] = { 0, 14, 15, 16, 14, 17, 18, 19, 20, 21, 22, 23, 24, 25, 20, 26, 27, 28, 29, 20, 20, @@ -481,40 +484,42 @@ static yyconst flex_int16_t yy_nxt[361] = 22, 48, 23, 50, 50, 72, 51, 51, 53, 53, 53, 53, 60, 64, 61, 61, 72, 61, 65, 72, 72, 72, 78, 63, 72, 72, 66, 72, 73, 52, - 52, 72, 63, 77, 72, 66, 72, 84, 72, 72, - 93, 53, 53, 74, 72, 72, 72, 75, 76, 79, - - 81, 80, 82, 72, 72, 87, 85, 83, 88, 96, - 61, 96, 61, 86, 97, 61, 89, 61, 96, 72, - 96, 66, 72, 99, 104, 101, 66, 72, 72, 94, - 66, 72, 72, 72, 72, 66, 103, 72, 102, 72, - 72, 72, 72, 72, 72, 105, 72, 108, 106, 112, - 72, 111, 72, 72, 72, 113, 107, 114, 121, 109, - 110, 72, 122, 120, 72, 72, 147, 119, 72, 123, - 124, 125, 115, 72, 72, 72, 72, 72, 126, 72, - 72, 72, 72, 131, 127, 72, 72, 72, 134, 129, - 72, 72, 133, 72, 128, 132, 138, 140, 145, 136, - - 72, 137, 141, 135, 116, 94, 72, 143, 144, 142, - 72, 72, 146, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 55, 116, 55, 55, 55, 55, 55, 55, - 55, 62, 62, 72, 62, 72, 62, 70, 72, 70, - 72, 70, 71, 71, 71, 116, 71, 91, 91, 72, - 91, 91, 91, 91, 72, 91, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 95, 72, 95, 72, 95, - 117, 99, 117, 117, 118, 97, 118, 130, 99, 130, - 130, 139, 116, 139, 139, 92, 116, 92, 92, 72, - 72, 72, 100, 72, 98, 90, 72, 69, 68, 67, - - 59, 58, 57, 56, 54, 147, 13, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147 + 52, 72, 63, 77, 72, 66, 72, 85, 72, 94, + 72, 53, 53, 74, 72, 72, 72, 75, 76, 79, + + 81, 80, 82, 72, 72, 88, 86, 83, 84, 89, + 61, 103, 61, 87, 61, 72, 61, 90, 97, 72, + 97, 66, 97, 98, 97, 66, 102, 100, 95, 72, + 66, 72, 104, 72, 66, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 106, 105, 109, + 113, 107, 72, 112, 72, 114, 115, 122, 116, 108, + 123, 72, 110, 111, 124, 72, 72, 72, 121, 125, + 72, 126, 72, 117, 153, 72, 72, 72, 72, 72, + 72, 72, 72, 129, 72, 72, 127, 128, 72, 72, + 134, 137, 72, 72, 72, 136, 132, 130, 135, 142, + + 131, 144, 72, 140, 141, 148, 138, 145, 72, 147, + 139, 149, 72, 95, 146, 72, 72, 72, 118, 72, + 150, 151, 72, 72, 118, 72, 72, 72, 72, 152, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 55, + 118, 55, 55, 55, 55, 55, 55, 55, 62, 62, + 72, 62, 72, 62, 70, 72, 70, 72, 70, 71, + 71, 71, 100, 71, 92, 92, 98, 92, 92, 92, + 92, 100, 92, 93, 93, 93, 93, 93, 93, 93, + 93, 93, 96, 118, 96, 118, 96, 119, 72, 119, + 119, 120, 72, 120, 133, 72, 133, 133, 143, 101, + + 143, 143, 93, 72, 93, 93, 99, 91, 72, 69, + 68, 67, 59, 58, 57, 56, 54, 153, 13, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153 } ; -static yyconst flex_int16_t yy_chk[361] = +static yyconst flex_int16_t yy_chk[373] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -524,37 +529,39 @@ static yyconst flex_int16_t yy_chk[361] = 1, 1, 1, 11, 12, 39, 11, 12, 15, 15, 16, 16, 27, 28, 27, 29, 35, 29, 28, 36, 38, 37, 39, 27, 43, 41, 29, 40, 35, 11, - 12, 44, 27, 38, 42, 29, 45, 43, 46, 47, - 52, 53, 53, 36, 146, 77, 145, 36, 37, 40, - - 41, 40, 42, 73, 144, 46, 44, 42, 47, 63, - 60, 63, 60, 45, 63, 61, 47, 61, 66, 76, - 66, 60, 74, 66, 77, 73, 61, 78, 79, 52, - 60, 80, 81, 85, 83, 61, 76, 84, 74, 87, - 88, 89, 101, 104, 106, 78, 110, 80, 79, 85, - 103, 84, 107, 109, 112, 87, 79, 88, 104, 81, - 83, 111, 106, 103, 113, 114, 116, 101, 119, 107, - 109, 110, 89, 121, 120, 124, 125, 126, 111, 127, - 135, 128, 143, 119, 112, 131, 140, 134, 124, 114, - 137, 138, 121, 141, 113, 120, 128, 131, 140, 126, - - 142, 127, 134, 125, 139, 116, 136, 137, 138, 135, - 133, 132, 141, 148, 148, 148, 148, 148, 148, 148, - 148, 148, 149, 130, 149, 149, 149, 149, 149, 149, - 149, 150, 150, 129, 150, 123, 150, 151, 122, 151, - 118, 151, 152, 152, 152, 117, 152, 153, 153, 115, - 153, 153, 153, 153, 108, 153, 154, 154, 154, 154, - 154, 154, 154, 154, 154, 155, 105, 155, 102, 155, - 156, 99, 156, 156, 157, 97, 157, 158, 96, 158, - 158, 159, 94, 159, 159, 160, 92, 160, 160, 86, - 82, 75, 72, 71, 64, 48, 34, 32, 31, 30, - - 26, 25, 24, 21, 17, 13, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147 + 12, 44, 27, 38, 42, 29, 45, 43, 46, 52, + 47, 53, 53, 36, 152, 74, 151, 36, 37, 40, + + 41, 40, 42, 150, 73, 46, 44, 42, 42, 47, + 60, 74, 60, 45, 61, 76, 61, 47, 63, 77, + 63, 60, 66, 63, 66, 61, 73, 66, 52, 78, + 60, 79, 76, 80, 61, 81, 85, 83, 84, 86, + 88, 89, 90, 102, 104, 105, 107, 78, 77, 80, + 85, 79, 108, 84, 110, 86, 88, 104, 89, 79, + 105, 111, 81, 83, 107, 112, 113, 114, 102, 108, + 115, 110, 116, 90, 118, 121, 123, 122, 126, 127, + 128, 129, 130, 113, 131, 138, 111, 112, 141, 134, + 121, 126, 137, 139, 142, 123, 116, 114, 122, 131, + + 115, 134, 145, 129, 130, 141, 127, 137, 144, 139, + 128, 142, 147, 118, 138, 149, 148, 146, 143, 140, + 144, 145, 136, 135, 133, 132, 125, 124, 120, 147, + 154, 154, 154, 154, 154, 154, 154, 154, 154, 155, + 119, 155, 155, 155, 155, 155, 155, 155, 156, 156, + 117, 156, 109, 156, 157, 106, 157, 103, 157, 158, + 158, 158, 100, 158, 159, 159, 98, 159, 159, 159, + 159, 97, 159, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 161, 95, 161, 93, 161, 162, 87, 162, + 162, 163, 82, 163, 164, 75, 164, 164, 165, 72, + + 165, 165, 166, 71, 166, 166, 64, 48, 34, 32, + 31, 30, 26, 25, 24, 21, 17, 13, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153 } ; /* The intent behind this definition is that it'll catch @@ -590,7 +597,7 @@ struct lexer_param; static int enter(int opening, int state, yyscan_t yyscanner); static int try_exit(int closing, int state, yyscan_t yyscanner); #define YY_NO_INPUT 1 -#line 594 "lexer.c" +#line 601 "lexer.c" #define INITIAL 0 #define IN_PAREN 1 @@ -846,7 +853,7 @@ YY_DECL #line 38 "lexer.l" -#line 850 "lexer.c" +#line 857 "lexer.c" yylval = yylval_param; @@ -903,13 +910,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 >= 148 ) + if ( yy_current_state >= 154 ) 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] != 307 ); + while ( yy_base[yy_current_state] != 319 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -961,199 +968,204 @@ YY_RULE_SETUP case 6: YY_RULE_SETUP #line 46 "lexer.l" -{ return MODULE; } +{ return INCLUDE; } YY_BREAK case 7: YY_RULE_SETUP #line 47 "lexer.l" -{ return DEF; } +{ return MODULE; } YY_BREAK case 8: YY_RULE_SETUP #line 48 "lexer.l" -{ return IF; } +{ return DEF; } YY_BREAK case 9: YY_RULE_SETUP #line 49 "lexer.l" -{ return THEN; } +{ return IF; } YY_BREAK case 10: YY_RULE_SETUP #line 50 "lexer.l" -{ return ELSE; } +{ return THEN; } YY_BREAK case 11: YY_RULE_SETUP #line 51 "lexer.l" -{ return ELSE_IF; } +{ return ELSE; } YY_BREAK case 12: YY_RULE_SETUP #line 52 "lexer.l" -{ return AND; } +{ return ELSE_IF; } YY_BREAK case 13: YY_RULE_SETUP #line 53 "lexer.l" -{ return OR; } +{ return AND; } YY_BREAK case 14: YY_RULE_SETUP #line 54 "lexer.l" -{ return END; } +{ return OR; } YY_BREAK case 15: YY_RULE_SETUP #line 55 "lexer.l" -{ return REDUCE; } +{ return END; } YY_BREAK case 16: YY_RULE_SETUP #line 56 "lexer.l" -{ return FOREACH; } +{ return REDUCE; } YY_BREAK case 17: YY_RULE_SETUP #line 57 "lexer.l" -{ return DEFINEDOR; } +{ return FOREACH; } YY_BREAK case 18: YY_RULE_SETUP #line 58 "lexer.l" -{ return TRY; } +{ return DEFINEDOR; } YY_BREAK case 19: YY_RULE_SETUP #line 59 "lexer.l" -{ return CATCH; } +{ return TRY; } YY_BREAK case 20: YY_RULE_SETUP #line 60 "lexer.l" -{ return LABEL; } +{ return CATCH; } YY_BREAK case 21: YY_RULE_SETUP #line 61 "lexer.l" -{ return BREAK; } +{ return LABEL; } YY_BREAK case 22: YY_RULE_SETUP #line 62 "lexer.l" -{ return LOC; } +{ return BREAK; } YY_BREAK case 23: YY_RULE_SETUP #line 63 "lexer.l" -{ return SETPIPE; } +{ return LOC; } YY_BREAK case 24: YY_RULE_SETUP #line 64 "lexer.l" -{ return SETPLUS; } +{ return SETPIPE; } YY_BREAK case 25: YY_RULE_SETUP #line 65 "lexer.l" -{ return SETMINUS; } +{ return SETPLUS; } YY_BREAK case 26: YY_RULE_SETUP #line 66 "lexer.l" -{ return SETMULT; } +{ return SETMINUS; } YY_BREAK case 27: YY_RULE_SETUP #line 67 "lexer.l" -{ return SETDIV; } +{ return SETMULT; } YY_BREAK case 28: YY_RULE_SETUP #line 68 "lexer.l" -{ return SETMOD; } +{ return SETDIV; } YY_BREAK case 29: YY_RULE_SETUP #line 69 "lexer.l" -{ return SETDEFINEDOR; } +{ return SETMOD; } YY_BREAK case 30: YY_RULE_SETUP #line 70 "lexer.l" -{ return LESSEQ; } +{ return SETDEFINEDOR; } YY_BREAK case 31: YY_RULE_SETUP #line 71 "lexer.l" -{ return GREATEREQ; } +{ return LESSEQ; } YY_BREAK case 32: YY_RULE_SETUP #line 72 "lexer.l" -{ return REC; } +{ return GREATEREQ; } YY_BREAK case 33: YY_RULE_SETUP #line 73 "lexer.l" -{ return yytext[0];} +{ return REC; } YY_BREAK case 34: YY_RULE_SETUP -#line 75 "lexer.l" +#line 74 "lexer.l" +{ return yytext[0];} + YY_BREAK +case 35: +YY_RULE_SETUP +#line 76 "lexer.l" { return enter(yytext[0], YY_START, yyscanner); } YY_BREAK -case 35: +case 36: YY_RULE_SETUP -#line 79 "lexer.l" +#line 80 "lexer.l" { return try_exit(yytext[0], YY_START, yyscanner); } YY_BREAK -case 36: +case 37: YY_RULE_SETUP -#line 83 "lexer.l" +#line 84 "lexer.l" { yylval->literal = jv_string_sized(yytext + 1, yyleng - 1); return FORMAT; } YY_BREAK -case 37: +case 38: YY_RULE_SETUP -#line 87 "lexer.l" +#line 88 "lexer.l" { yylval->literal = jv_parse_sized(yytext, yyleng); return LITERAL; } YY_BREAK -case 38: +case 39: YY_RULE_SETUP -#line 91 "lexer.l" +#line 92 "lexer.l" { yy_push_state(IN_QQSTRING, yyscanner); return QQSTRING_START; } YY_BREAK -case 39: +case 40: YY_RULE_SETUP -#line 97 "lexer.l" +#line 98 "lexer.l" { return enter(QQSTRING_INTERP_START, YY_START, yyscanner); } YY_BREAK -case 40: +case 41: YY_RULE_SETUP -#line 100 "lexer.l" +#line 101 "lexer.l" { yy_pop_state(yyscanner); return QQSTRING_END; } YY_BREAK -case 41: -/* rule 41 can match eol */ +case 42: +/* rule 42 can match eol */ YY_RULE_SETUP -#line 104 "lexer.l" +#line 105 "lexer.l" { /* pass escapes to the json parser */ jv escapes = jv_string_fmt("\"%.*s\"", (int)yyleng, yytext); @@ -1162,50 +1174,50 @@ YY_RULE_SETUP return QQSTRING_TEXT; } YY_BREAK -case 42: -/* rule 42 can match eol */ +case 43: +/* rule 43 can match eol */ YY_RULE_SETUP -#line 111 "lexer.l" +#line 112 "lexer.l" { yylval->literal = jv_string_sized(yytext, yyleng); return QQSTRING_TEXT; } YY_BREAK -case 43: +case 44: YY_RULE_SETUP -#line 115 "lexer.l" +#line 116 "lexer.l" { return INVALID_CHARACTER; } YY_BREAK -case 44: +case 45: YY_RULE_SETUP -#line 121 "lexer.l" +#line 122 "lexer.l" { yylval->literal = jv_string(yytext); return IDENT;} YY_BREAK -case 45: +case 46: YY_RULE_SETUP -#line 122 "lexer.l" +#line 123 "lexer.l" { yylval->literal = jv_string(yytext+1); return FIELD;} YY_BREAK -case 46: -/* rule 46 can match eol */ +case 47: +/* rule 47 can match eol */ YY_RULE_SETUP -#line 124 "lexer.l" +#line 125 "lexer.l" {} YY_BREAK -case 47: +case 48: YY_RULE_SETUP -#line 126 "lexer.l" +#line 127 "lexer.l" { return INVALID_CHARACTER; } YY_BREAK -case 48: +case 49: YY_RULE_SETUP -#line 128 "lexer.l" +#line 129 "lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1209 "lexer.c" +#line 1221 "lexer.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(IN_PAREN): case YY_STATE_EOF(IN_BRACKET): @@ -1504,7 +1516,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) 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 >= 148 ) + if ( yy_current_state >= 154 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1533,11 +1545,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) 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 >= 148 ) + if ( yy_current_state >= 154 ) 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 == 147); + yy_is_jam = (yy_current_state == 153); return yy_is_jam ? 0 : yy_current_state; } @@ -2369,7 +2381,7 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 128 "lexer.l" +#line 129 "lexer.l" /* perhaps these should be calls... */ diff --git a/lexer.h b/lexer.h index 9e0ecef8..0eb85067 100644 --- a/lexer.h +++ b/lexer.h @@ -354,7 +354,7 @@ extern int jq_yylex \ #undef YY_DECL #endif -#line 128 "lexer.l" +#line 129 "lexer.l" #line 361 "lexer.h" diff --git a/lexer.l b/lexer.l index 98ea9167..8e461810 100644 --- a/lexer.l +++ b/lexer.l @@ -43,6 +43,7 @@ struct lexer_param; "==" { return EQ; } "as" { return AS; } "import" { return IMPORT; } +"include" { return INCLUDE; } "module" { return MODULE; } "def" { return DEF; } "if" { return IF; } diff --git a/parser.c b/parser.c index 75584b99..c210a758 100644 --- a/parser.c +++ b/parser.c @@ -142,33 +142,34 @@ struct lexer_param; DEF = 269, MODULE = 270, IMPORT = 271, - IF = 272, - THEN = 273, - ELSE = 274, - ELSE_IF = 275, - REDUCE = 276, - FOREACH = 277, - END = 278, - AND = 279, - OR = 280, - TRY = 281, - CATCH = 282, - LABEL = 283, - BREAK = 284, - LOC = 285, - SETPIPE = 286, - SETPLUS = 287, - SETMINUS = 288, - SETMULT = 289, - SETDIV = 290, - SETDEFINEDOR = 291, - LESSEQ = 292, - GREATEREQ = 293, - QQSTRING_START = 294, - QQSTRING_TEXT = 295, - QQSTRING_INTERP_START = 296, - QQSTRING_INTERP_END = 297, - QQSTRING_END = 298 + INCLUDE = 272, + IF = 273, + THEN = 274, + ELSE = 275, + ELSE_IF = 276, + REDUCE = 277, + FOREACH = 278, + END = 279, + AND = 280, + OR = 281, + TRY = 282, + CATCH = 283, + LABEL = 284, + BREAK = 285, + LOC = 286, + SETPIPE = 287, + SETPLUS = 288, + SETMINUS = 289, + SETMULT = 290, + SETDIV = 291, + SETDEFINEDOR = 292, + LESSEQ = 293, + GREATEREQ = 294, + QQSTRING_START = 295, + QQSTRING_TEXT = 296, + QQSTRING_INTERP_START = 297, + QQSTRING_INTERP_END = 298, + QQSTRING_END = 299 }; #endif /* Tokens. */ @@ -186,33 +187,34 @@ struct lexer_param; #define DEF 269 #define MODULE 270 #define IMPORT 271 -#define IF 272 -#define THEN 273 -#define ELSE 274 -#define ELSE_IF 275 -#define REDUCE 276 -#define FOREACH 277 -#define END 278 -#define AND 279 -#define OR 280 -#define TRY 281 -#define CATCH 282 -#define LABEL 283 -#define BREAK 284 -#define LOC 285 -#define SETPIPE 286 -#define SETPLUS 287 -#define SETMINUS 288 -#define SETMULT 289 -#define SETDIV 290 -#define SETDEFINEDOR 291 -#define LESSEQ 292 -#define GREATEREQ 293 -#define QQSTRING_START 294 -#define QQSTRING_TEXT 295 -#define QQSTRING_INTERP_START 296 -#define QQSTRING_INTERP_END 297 -#define QQSTRING_END 298 +#define INCLUDE 272 +#define IF 273 +#define THEN 274 +#define ELSE 275 +#define ELSE_IF 276 +#define REDUCE 277 +#define FOREACH 278 +#define END 279 +#define AND 280 +#define OR 281 +#define TRY 282 +#define CATCH 283 +#define LABEL 284 +#define BREAK 285 +#define LOC 286 +#define SETPIPE 287 +#define SETPLUS 288 +#define SETMINUS 289 +#define SETMULT 290 +#define SETDIV 291 +#define SETDEFINEDOR 292 +#define LESSEQ 293 +#define GREATEREQ 294 +#define QQSTRING_START 295 +#define QQSTRING_TEXT 296 +#define QQSTRING_INTERP_START 297 +#define QQSTRING_INTERP_END 298 +#define QQSTRING_END 299 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED @@ -224,7 +226,7 @@ union YYSTYPE jv literal; block blk; -#line 228 "parser.c" /* yacc.c:355 */ +#line 230 "parser.c" /* yacc.c:355 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -251,7 +253,7 @@ int yyparse (block* answer, int* errors, struct locfile* locations, struct lexer #endif /* !YY_YY_PARSER_H_INCLUDED */ /* Copy the second part of user declarations. */ -#line 113 "parser.y" /* yacc.c:358 */ +#line 114 "parser.y" /* yacc.c:358 */ #include "lexer.h" struct lexer_param { @@ -407,7 +409,7 @@ static block gen_update(block object, block val, int optype) { } -#line 411 "parser.c" /* yacc.c:358 */ +#line 413 "parser.c" /* yacc.c:358 */ #ifdef short # undef short @@ -651,21 +653,21 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 27 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 2061 +#define YYLAST 2015 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 65 +#define YYNTOKENS 66 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 26 /* YYNRULES -- Number of rules. */ -#define YYNRULES 155 +#define YYNRULES 156 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 307 +#define YYNSTATES 310 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 298 +#define YYMAXUTOK 299 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -677,16 +679,16 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 58, 53, 2, 2, - 56, 57, 51, 49, 45, 50, 60, 52, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 59, 55, - 47, 46, 48, 54, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 59, 54, 2, 2, + 57, 58, 52, 50, 46, 51, 61, 53, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 60, 56, + 48, 47, 49, 55, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 61, 2, 62, 2, 2, 2, 2, 2, 2, + 2, 62, 2, 63, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 63, 44, 64, 2, 2, 2, 2, + 2, 2, 2, 64, 45, 65, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -703,29 +705,29 @@ static const yytype_uint8 yytranslate[] = 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43 + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 271, 271, 274, 279, 282, 292, 295, 300, 303, - 308, 312, 316, 320, 324, 328, 331, 336, 340, 344, - 349, 361, 365, 369, 373, 377, 381, 385, 389, 393, - 397, 401, 405, 409, 413, 417, 421, 425, 431, 437, - 441, 445, 449, 453, 457, 461, 465, 469, 474, 483, - 490, 496, 508, 519, 533, 538, 544, 547, 552, 557, - 564, 564, 568, 568, 575, 578, 581, 587, 590, 595, - 598, 601, 607, 610, 613, 621, 625, 628, 631, 634, - 637, 640, 643, 646, 649, 653, 659, 662, 665, 668, - 671, 674, 677, 680, 683, 686, 689, 692, 695, 698, - 701, 704, 707, 714, 718, 722, 734, 739, 740, 741, - 742, 745, 748, 753, 758, 762, 765, 770, 773, 778, - 781, 786, 789, 792, 795, 798, 803, 806, 809, 812, - 815, 818, 821, 824, 827, 830, 833, 836, 839, 842, - 845, 848, 851, 854, 859, 862, 863, 864, 867, 870, - 873, 876, 880, 884, 888, 891 + 0, 272, 272, 275, 280, 283, 293, 296, 301, 304, + 309, 313, 317, 321, 325, 329, 332, 337, 341, 345, + 350, 362, 366, 370, 374, 378, 382, 386, 390, 394, + 398, 402, 406, 410, 414, 418, 422, 426, 432, 438, + 442, 446, 450, 454, 458, 462, 466, 470, 475, 484, + 491, 497, 509, 520, 534, 539, 545, 548, 553, 558, + 565, 565, 569, 569, 576, 579, 582, 588, 591, 596, + 599, 602, 608, 611, 614, 622, 626, 629, 632, 635, + 638, 641, 644, 647, 650, 654, 660, 663, 666, 669, + 672, 675, 678, 681, 684, 687, 690, 693, 696, 699, + 702, 705, 708, 715, 719, 723, 735, 740, 741, 742, + 743, 746, 749, 754, 759, 763, 766, 771, 774, 779, + 782, 787, 790, 793, 796, 799, 804, 807, 810, 813, + 816, 819, 822, 825, 828, 831, 834, 837, 840, 843, + 846, 849, 852, 855, 858, 863, 866, 867, 868, 871, + 874, 877, 880, 884, 888, 892, 895 }; #endif @@ -736,18 +738,19 @@ static const char *const yytname[] = { "$end", "error", "$undefined", "INVALID_CHARACTER", "IDENT", "FIELD", "LITERAL", "FORMAT", "\"..\"", "\"%=\"", "\"==\"", "\"!=\"", "\"//\"", - "\"as\"", "\"def\"", "\"module\"", "\"import\"", "\"if\"", "\"then\"", - "\"else\"", "\"elif\"", "\"reduce\"", "\"foreach\"", "\"end\"", - "\"and\"", "\"or\"", "\"try\"", "\"catch\"", "\"label\"", "\"break\"", - "\"__loc__\"", "\"|=\"", "\"+=\"", "\"-=\"", "\"*=\"", "\"/=\"", - "\"//=\"", "\"<=\"", "\">=\"", "QQSTRING_START", "QQSTRING_TEXT", - "QQSTRING_INTERP_START", "QQSTRING_INTERP_END", "QQSTRING_END", "'|'", - "','", "'='", "'<'", "'>'", "'+'", "'-'", "'*'", "'/'", "'%'", "'?'", - "';'", "'('", "')'", "'$'", "':'", "'.'", "'['", "']'", "'{'", "'}'", - "$accept", "TopLevel", "Module", "Imports", "FuncDefs", "Exp", "Import", - "FuncDef", "Params", "Param", "String", "@1", "@2", "QQString", - "ElseBody", "ExpD", "Term", "Args", "Arg", "Pattern", "ArrayPats", - "ObjPats", "ObjPat", "Keyword", "MkDict", "MkDictPair", YY_NULLPTR + "\"as\"", "\"def\"", "\"module\"", "\"import\"", "\"include\"", "\"if\"", + "\"then\"", "\"else\"", "\"elif\"", "\"reduce\"", "\"foreach\"", + "\"end\"", "\"and\"", "\"or\"", "\"try\"", "\"catch\"", "\"label\"", + "\"break\"", "\"__loc__\"", "\"|=\"", "\"+=\"", "\"-=\"", "\"*=\"", + "\"/=\"", "\"//=\"", "\"<=\"", "\">=\"", "QQSTRING_START", + "QQSTRING_TEXT", "QQSTRING_INTERP_START", "QQSTRING_INTERP_END", + "QQSTRING_END", "'|'", "','", "'='", "'<'", "'>'", "'+'", "'-'", "'*'", + "'/'", "'%'", "'?'", "';'", "'('", "')'", "'$'", "':'", "'.'", "'['", + "']'", "'{'", "'}'", "$accept", "TopLevel", "Module", "Imports", + "FuncDefs", "Exp", "Import", "FuncDef", "Params", "Param", "String", + "@1", "@2", "QQString", "ElseBody", "ExpD", "Term", "Args", "Arg", + "Pattern", "ArrayPats", "ObjPats", "ObjPat", "Keyword", "MkDict", + "MkDictPair", YY_NULLPTR }; #endif @@ -760,57 +763,57 @@ static const yytype_uint16 yytoknum[] = 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 124, 44, 61, 60, 62, 43, - 45, 42, 47, 37, 63, 59, 40, 41, 36, 58, - 46, 91, 93, 123, 125 + 295, 296, 297, 298, 299, 124, 44, 61, 60, 62, + 43, 45, 42, 47, 37, 63, 59, 40, 41, 36, + 58, 46, 91, 93, 123, 125 }; # endif -#define YYPACT_NINF -151 +#define YYPACT_NINF -152 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-151))) + (!!((Yystate) == (-152))) -#define YYTABLE_NINF -145 +#define YYTABLE_NINF -146 #define yytable_value_is_error(Yytable_value) \ - (!!((Yytable_value) == (-145))) + (!!((Yytable_value) == (-146))) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { - -5, 844, 5, 28, -22, -19, -151, 10, -151, 52, - 844, 764, 764, 844, 2, 0, -151, 844, 465, 18, - 274, 402, 140, 1322, 844, -151, 6, -151, -3, 844, - 28, 844, -151, -151, -17, 1744, 16, 46, 30, 59, - -151, 60, -151, 19, 8, 1167, -151, -151, -151, 67, - 10, 24, 47, -151, 980, -18, 49, -151, -151, -151, - -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, - -151, -151, -151, -151, -151, 491, 112, 61, 69, 66, - 86, 844, 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 844, -151, -151, 1898, 79, -20, - -3, 376, 638, -151, 1898, 844, -151, 1898, -10, -151, - -151, 11, 844, 552, -20, -20, 578, 92, -151, 72, - -151, -151, -151, -151, -151, -151, 336, -151, 618, 80, - 1198, -151, 618, 618, -151, 336, 1960, 1978, 1978, 1929, - 2007, 182, 1960, 1960, 1960, 1960, 1960, 1960, 1978, 1978, - 1898, 1929, 1960, 1978, 1978, 19, 19, 88, 88, 88, - -151, 139, -20, 899, 101, 94, 84, 844, 96, 934, - 21, -151, 1369, -151, 844, -151, 83, -151, 147, -2, - -151, 1416, -151, 1698, 116, 117, -151, -151, 844, -151, - 844, -151, 107, -151, 618, 130, 1, 119, 121, 130, - 130, -151, -151, -151, -8, 122, 844, 171, 123, -12, - -151, 125, 844, -151, -151, 1026, -151, 698, 131, 724, - 183, -151, -151, -151, -151, 11, 127, -151, 844, 844, - -151, 844, 844, 1898, 1775, -151, 618, 618, 618, -20, - -151, -20, 1229, -151, -20, 899, -151, -20, 1898, 134, - 135, 1072, -151, -151, 1463, 784, -151, 844, 1821, 1867, - 1510, 1557, -151, 130, 130, 130, -151, -151, 132, -151, - -151, -151, -151, -151, 136, -151, -151, 1604, 1651, -151, - 844, 844, 844, -20, -151, -151, -151, 1698, 1260, 1118, - -151, -151, -151, 844, -151, 1291, -151 + 25, 981, 51, 44, 7, -2, -152, 17, -152, 61, + 981, 600, 600, 981, 15, 0, -152, 981, 155, 23, + 276, 488, 339, 1405, 981, -152, 1, -152, 3, 3, + 981, 44, 981, -152, -152, -19, 1724, 6, 8, 45, + 71, -152, 75, -152, 65, 22, 1250, -152, -152, -152, + 80, 17, 56, 50, -152, 1104, -18, 55, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, 552, 117, 62, + 63, 69, 90, 981, 981, 981, 981, 981, 981, 981, + 981, 981, 981, 981, 981, 981, 981, 981, 981, 981, + 981, 981, 981, 981, 981, 981, 981, -152, -152, 1880, + 83, -25, 3, 424, 113, 737, -152, 1880, 981, -152, + 1880, -14, -152, -152, 18, 981, 614, -25, -25, 676, + 94, -152, 14, -152, -152, -152, -152, -152, -152, 393, + -152, 594, 82, 1281, -152, 594, 594, -152, 393, 1942, + 334, 334, 1911, 1960, 200, 1942, 1942, 1942, 1942, 1942, + 1942, 334, 334, 1880, 1911, 1942, 334, 334, 65, 65, + 91, 91, 91, -152, 140, -25, 1037, 100, 92, 85, + 981, 95, 1072, 19, -152, 1437, -152, 981, -152, 89, + -152, 145, -10, -152, 1469, -152, 1677, 96, 97, -152, + -152, 981, -152, 981, -152, 105, -152, 594, 110, 10, + 98, 104, 110, 110, -152, -152, -152, -11, 106, 981, + 153, 107, -16, -152, 108, 981, -152, -152, 1136, -152, + 798, 115, 859, 161, -152, -152, -152, -152, 18, 112, + -152, 981, 981, -152, 981, 981, 1880, 1755, -152, 594, + 594, 594, -25, -152, -25, 1312, -152, -25, 1037, -152, + -25, 1880, 119, 120, 1168, -152, -152, 1501, 920, -152, + 981, 1802, 1849, 1533, 1565, -152, 110, 110, 110, -152, + -152, 116, -152, -152, -152, -152, -152, 126, -152, -152, + 1597, 1629, -152, 981, 981, 981, -25, -152, -152, -152, + 1677, 1343, 1200, -152, -152, -152, 981, -152, 1374, -152 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -820,51 +823,51 @@ static const yytype_uint8 yydefact[] = { 4, 0, 0, 6, 105, 81, 96, 98, 73, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, - 0, 0, 0, 0, 0, 97, 47, 1, 0, 8, - 6, 0, 77, 62, 0, 0, 0, 0, 18, 0, - 75, 0, 64, 32, 0, 0, 104, 103, 84, 0, - 0, 83, 0, 101, 0, 0, 153, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 0, 0, 151, 0, 0, - 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 47, 1, 0, 0, + 8, 6, 0, 77, 62, 0, 0, 0, 0, 18, + 0, 75, 0, 64, 32, 0, 0, 104, 103, 84, + 0, 0, 83, 0, 101, 0, 0, 154, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 0, 0, 152, + 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 21, 5, 10, 80, 0, - 0, 0, 0, 3, 2, 8, 7, 113, 0, 111, - 64, 0, 0, 0, 0, 0, 0, 0, 74, 0, - 107, 99, 85, 79, 108, 100, 0, 110, 0, 0, - 0, 152, 0, 0, 102, 0, 40, 41, 42, 25, - 24, 23, 27, 31, 34, 36, 39, 26, 45, 46, - 28, 29, 22, 43, 44, 30, 33, 35, 37, 38, - 76, 0, 0, 0, 0, 82, 0, 0, 89, 0, - 0, 50, 0, 9, 0, 106, 0, 59, 0, 0, - 56, 0, 16, 0, 0, 0, 19, 17, 0, 65, - 0, 61, 0, 147, 0, 148, 71, 0, 0, 150, - 149, 146, 114, 117, 0, 0, 0, 0, 0, 0, - 119, 0, 0, 78, 109, 0, 88, 0, 87, 0, - 0, 52, 112, 63, 58, 0, 0, 54, 0, 0, - 15, 0, 0, 20, 0, 70, 0, 0, 0, 0, - 115, 0, 0, 121, 0, 0, 116, 0, 11, 95, - 94, 0, 86, 49, 0, 0, 57, 0, 0, 0, - 0, 0, 66, 69, 155, 154, 118, 122, 0, 124, - 120, 123, 92, 91, 93, 51, 48, 0, 0, 68, - 0, 0, 0, 0, 90, 53, 55, 0, 0, 0, - 125, 67, 12, 0, 14, 0, 13 + 0, 0, 0, 0, 0, 0, 0, 21, 5, 10, + 80, 0, 0, 0, 0, 0, 3, 2, 8, 7, + 113, 0, 111, 64, 0, 0, 0, 0, 0, 0, + 0, 74, 0, 107, 99, 85, 79, 108, 100, 0, + 110, 0, 0, 0, 153, 0, 0, 102, 0, 40, + 41, 42, 25, 24, 23, 27, 31, 34, 36, 39, + 26, 45, 46, 28, 29, 22, 43, 44, 30, 33, + 35, 37, 38, 76, 0, 0, 0, 0, 82, 0, + 0, 89, 0, 0, 50, 0, 9, 0, 106, 0, + 59, 0, 0, 56, 0, 16, 0, 0, 0, 19, + 17, 0, 65, 0, 61, 0, 148, 0, 149, 71, + 0, 0, 151, 150, 147, 114, 117, 0, 0, 0, + 0, 0, 0, 119, 0, 0, 78, 109, 0, 88, + 0, 87, 0, 0, 52, 112, 63, 58, 0, 0, + 54, 0, 0, 15, 0, 0, 20, 0, 70, 0, + 0, 0, 0, 115, 0, 0, 121, 0, 0, 116, + 0, 11, 95, 94, 0, 86, 49, 0, 0, 57, + 0, 0, 0, 0, 0, 66, 69, 156, 155, 118, + 122, 0, 124, 120, 123, 92, 91, 93, 51, 48, + 0, 0, 68, 0, 0, 0, 0, 90, 53, 55, + 0, 0, 0, 125, 67, 12, 0, 14, 0, 13 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -151, -151, -151, 164, 87, -1, -151, -11, -151, -40, - 4, -151, -151, 81, -94, -129, -4, -151, 23, -122, - -151, -151, -50, -150, -105, -151 + -152, -152, -152, 152, 70, -1, -152, -12, -152, -51, + 4, -152, -152, 66, -110, -141, -4, -152, 5, -125, + -152, -152, -67, -151, -103, -152 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 2, 3, 29, 113, 107, 30, 24, 189, 190, - 25, 42, 120, 129, 240, 205, 26, 118, 119, 174, - 214, 219, 220, 78, 79, 80 + -1, 2, 3, 30, 116, 109, 31, 24, 192, 193, + 25, 43, 123, 132, 243, 208, 26, 121, 122, 177, + 217, 222, 223, 80, 81, 82 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -872,482 +875,472 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 23, 40, 194, 195, 50, 27, 108, 36, 37, 35, - 1, 108, 38, 209, 210, 187, 43, 45, 115, 109, - 54, 108, 46, 221, 51, 229, 77, 136, 114, 124, - 117, 203, 112, 255, 31, 32, 16, 249, 171, 121, - 211, 172, 122, 173, 28, 184, 137, 185, 47, 33, - 213, 108, 256, 235, 250, 236, 34, 126, 41, 125, - 39, 110, 111, 127, 128, 130, 110, 111, 132, 188, - 102, 103, 104, 105, 140, 245, 110, 111, 133, 230, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 115, 221, 110, 111, 138, 134, - 179, 182, 199, 200, 175, 201, 141, 273, 274, 275, - 142, 191, 193, 199, 200, 197, 233, 276, 143, 277, - 144, 145, 279, 170, 206, 281, 198, 207, 206, 206, - 77, 55, 105, 212, 56, 222, 224, 50, 223, 77, - 226, 234, 136, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 300, 241, 242, 246, 253, 225, 218, 247, 16, - 248, 251, 254, 117, 257, 262, 267, 265, 282, 283, - 294, 293, 82, 83, 116, 266, 75, 243, 76, 244, - 206, 186, 183, 301, -144, 280, 85, 232, 0, 0, - 0, 0, 0, 0, 0, 252, 0, 0, 0, 93, - 94, 258, 0, 0, 0, 0, 261, 0, 264, 98, - 99, 100, 101, 102, 103, 104, 105, 268, 269, 0, - 270, 271, 206, 206, 206, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 218, - 0, 0, 0, 0, 287, 0, 288, 0, 0, 0, - 0, 0, 0, 0, -72, 48, 0, 0, 49, -72, - 0, 50, 0, -72, -72, -72, -72, -72, 0, 297, - 298, 299, -72, -72, -72, 0, 0, -72, -72, -72, - 0, -72, 305, 0, 0, -72, -72, -72, -72, -72, - -72, -72, -72, 16, 0, 0, -72, 0, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - 0, -72, 0, -72, -72, -72, -72, 202, -72, 0, - 56, 0, 0, 50, 0, 0, 0, 0, 0, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 0, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 176, 0, 0, - 4, 5, 6, 7, 8, 0, 0, 0, 0, 0, - 9, 0, 75, 10, 76, 0, 0, 11, 12, 0, - -144, 0, 13, 52, 14, 15, 4, 5, 6, 7, - 8, 0, 0, 0, 0, 16, 9, 0, 0, 10, - 0, 0, 0, 11, 12, 0, 17, 0, 13, 0, - 14, 15, 18, 0, 19, 177, 20, 21, 178, 22, - 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 0, 0, 0, 18, 0, - 19, 0, 20, 21, 53, 22, 44, 0, 0, 4, - 5, 6, 7, 8, 0, 0, 0, 0, 0, 9, + 23, 41, 197, 198, 212, 213, 110, 37, 38, 36, + 51, 110, 39, 110, 111, 110, 44, 46, 118, 127, + 55, 128, 190, 232, 52, 224, 79, 47, 139, 117, + 258, 120, 114, 115, 174, 252, 206, 175, 124, 176, + 1, 125, 187, 16, 188, 214, 238, 140, 239, 259, + 216, 27, 253, 33, 48, 202, 203, 34, 204, 42, + 28, 29, 112, 113, 32, 35, 248, 112, 113, 112, + 113, 112, 113, 129, 40, 130, 143, 191, 233, 131, + 133, 135, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 118, 224, 276, 277, + 278, 136, 182, 137, 185, 141, 178, 104, 105, 106, + 107, 144, 145, 146, 194, 196, 183, 279, 200, 280, + 202, 203, 282, 236, 147, 284, 148, 209, 173, 201, + 210, 209, 209, 79, 215, 225, 107, 226, 227, 237, + 229, 139, 79, 244, 245, 249, 45, 256, 250, 4, + 5, 6, 7, 8, 251, 268, 254, 257, 260, 9, + 265, 303, 270, 10, 285, 286, 296, 11, 12, 228, + 221, 297, 13, 119, 14, 15, 120, 269, 186, 189, + 304, 283, 235, 0, 0, 16, 0, 0, 0, 0, + 246, 0, 247, 209, 0, 0, 17, 0, 0, 0, + 84, 85, 18, 0, 19, 0, 20, 21, 255, 22, + 0, 0, 0, 0, 261, 87, 0, 0, 0, 264, + 0, 267, 0, 0, 0, 0, 0, 0, 95, 96, + 271, 272, 0, 273, 274, 209, 209, 209, 100, 101, + 102, 103, 104, 105, 106, 107, 0, 0, 0, 0, + 0, 0, 221, 0, 0, 0, 0, 290, 0, 291, + 0, 0, 0, 0, 0, 0, -72, 49, 0, 0, + 50, -72, 0, 51, 0, -72, -72, -72, -72, -72, + 0, 0, 300, 301, 302, -72, -72, -72, 0, 0, + -72, -72, -72, 0, -72, 308, 0, 0, -72, -72, + -72, -72, -72, -72, -72, -72, 16, 0, 0, -72, + 0, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, 0, -72, 0, -72, -72, -72, -72, + 56, -72, 0, 57, -146, -146, 51, 0, 0, 0, + 0, 0, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 0, -146, -146, 0, 0, 0, 0, 0, 16, + 0, 0, -146, -146, 102, 103, 104, 105, 106, 107, + 0, 0, 0, 0, 205, 0, 77, 57, 78, 0, + 51, 0, 0, 0, -145, 0, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 179, 0, 0, 4, 5, + 6, 7, 8, 16, 0, 0, 0, 0, 9, 0, 0, 0, 10, 0, 0, 0, 11, 12, 0, 0, - 0, 13, 139, 14, 15, 4, 5, 6, 7, 8, - 0, 0, 0, 0, 16, 9, 0, 0, 10, 0, - 0, 0, 11, 12, 0, 17, 0, 13, 0, 14, - 15, 18, 0, 19, 0, 20, 21, 0, 22, 0, - 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 0, 0, 0, 0, 0, 18, 0, 19, - 0, 20, 21, 192, 22, 0, 4, 5, 6, 7, - 8, 0, 0, 0, 0, 0, 9, 0, 0, 10, - 0, 0, 0, 11, 12, 0, 0, 0, 13, 196, - 14, 15, 4, 5, 6, 7, 8, 0, 0, 0, - 0, 16, 9, 0, 0, 10, 0, 0, 0, 11, - 12, 0, 17, 0, 13, 0, 14, 15, 18, 0, - 19, 0, 20, 21, 0, 22, 0, 16, 0, 0, - 0, 0, 4, 5, 6, 7, 8, 0, 17, 0, - 0, 0, 0, 0, 18, 0, 19, 0, 20, 21, - 0, 22, 4, 5, 6, 7, 8, 15, 0, 0, - 0, 180, 9, 0, 0, 10, 0, 16, 0, 11, - 12, 0, 0, 0, 13, 0, 14, 15, 204, 0, - 0, 0, 0, 0, 18, 0, 19, 16, 20, 21, - 0, 22, 0, 0, 0, 0, 0, 0, 17, 0, - 0, 0, 0, 181, 18, 0, 19, 0, 20, 21, + 77, 13, 78, 14, 15, 0, 0, 0, -145, 0, + 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, + 0, 18, 0, 19, 180, 20, 21, 181, 22, 53, + 0, 0, 4, 5, 6, 7, 8, 0, 0, 0, + 0, 0, 9, 0, 0, 0, 10, 0, 0, 0, + 11, 12, 0, 0, 0, 13, 0, 14, 15, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, + 0, 0, 0, 0, 0, 18, 0, 19, 0, 20, + 21, 54, 22, 142, 0, 0, 4, 5, 6, 7, + 8, 0, 0, 0, 0, 0, 9, 0, 0, 0, + 10, 0, 0, 0, 11, 12, 0, 0, 0, 13, + 0, 14, 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 16, 0, 0, 0, 0, 0, 4, 5, + 6, 7, 8, 17, 4, 5, 6, 7, 8, 18, + 0, 19, 0, 20, 21, 195, 22, 0, 4, 5, + 6, 7, 8, 0, 15, 0, 0, 0, 9, 0, + 15, 0, 10, 0, 16, 0, 11, 12, 0, 0, + 16, 13, 0, 14, 15, 207, 0, 0, 0, 0, + 0, 18, 0, 19, 16, 20, 21, 18, 22, 19, + 0, 20, 21, 0, 22, 17, 0, 0, 0, 0, + 0, 18, 0, 19, 0, 20, 21, 199, 22, 0, + 4, 5, 6, 7, 8, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 10, 0, 0, 0, 11, 12, + 0, 0, 0, 13, 0, 14, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, + 0, 0, 0, 18, 0, 19, 0, 20, 21, 0, + 22, 4, 5, 6, 7, 8, 0, 0, 0, 0, + 0, 9, 0, 0, 0, 10, 0, 0, 0, 11, + 12, 0, 0, 0, 13, 0, 14, 15, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, + 0, 0, 0, 184, 18, 0, 19, 0, 20, 21, 0, 22, 4, 5, 6, 7, 8, 0, 0, 0, - 0, 0, 9, 0, 0, 10, 0, 0, 0, 11, - 12, 0, 0, 0, 13, 0, 14, 15, 4, 5, - 6, 7, 8, 0, 0, 0, 0, 16, 9, 0, - 0, 10, 0, 0, 0, 11, 12, 0, 17, 0, - 13, 0, 14, 15, 18, 0, 19, 0, 20, 21, - 260, 22, 0, 16, 0, 0, 0, 0, 4, 5, - 6, 7, 8, 0, 17, 0, 0, 0, 0, 263, - 18, 0, 19, 0, 20, 21, 0, 22, 4, 5, - 6, 7, 8, 15, 0, 0, 0, 0, 9, 0, - 0, 10, 0, 16, 0, 11, 12, 0, 0, 0, - 13, 0, 14, 15, 0, 0, 0, 0, 0, 0, - 18, 0, 19, 16, 20, 21, 0, 22, 0, 0, - 0, 0, 0, 0, 17, 0, 0, 0, 0, 286, - 18, 0, 19, 0, 20, 21, 0, 22, 4, 5, - 6, 7, 8, 0, 0, 0, 0, 0, 9, 0, - 0, 10, 0, 0, 0, 11, 12, 0, 0, 0, - 13, 0, 14, 15, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, - 18, 0, 19, 215, 20, 21, 50, 22, 0, 0, - 0, 0, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 0, 0, 9, 0, 0, 0, 10, 0, 0, 0, + 11, 12, 0, 0, 0, 13, 0, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, - 0, 0, 0, 81, 82, 83, 84, 0, 0, 0, - 0, 0, 0, 0, 0, 216, 0, 217, 85, 86, - 0, 0, 0, 0, 0, 87, 88, 89, 90, 91, - 92, 93, 94, 0, 0, 0, 0, 0, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 81, - 82, 83, 84, 227, 0, 0, 228, 0, 0, 0, - 0, 0, 0, 0, 85, 86, 0, 0, 0, 0, - 0, 87, 88, 89, 90, 91, 92, 93, 94, 0, - 0, 0, 0, 0, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 81, 82, 83, 84, 0, - 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, - 85, 86, 0, 0, 0, 0, 0, 87, 88, 89, - 90, 91, 92, 93, 94, 0, 0, 0, 0, 0, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 81, 82, 83, 84, 0, 0, 0, 259, 0, - 0, 0, 0, 0, 0, 0, 85, 86, 0, 0, - 0, 0, 0, 87, 88, 89, 90, 91, 92, 93, - 94, 0, 0, 0, 0, 0, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 81, 82, 83, - 84, 0, 0, 0, 284, 0, 0, 0, 0, 0, - 0, 0, 85, 86, 0, 0, 0, 0, 0, 87, - 88, 89, 90, 91, 92, 93, 94, 0, 0, 0, - 0, 0, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 303, 0, 304, 81, 82, 83, 84, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 85, 86, 0, 0, 0, 0, 0, 87, 88, - 89, 90, 91, 92, 93, 94, 0, 81, 82, 83, - 84, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 85, 86, 131, 0, 0, 0, 0, 87, - 88, 89, 90, 91, 92, 93, 94, 0, 81, 82, - 83, 84, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 85, 86, 208, 0, 0, 0, 0, - 87, 88, 89, 90, 91, 92, 93, 94, 0, 81, - 82, 83, 84, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 85, 86, 278, 0, 0, 0, - 0, 87, 88, 89, 90, 91, 92, 93, 94, 0, - 81, 82, 83, 84, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 85, 86, 302, 0, 0, - 0, 0, 87, 88, 89, 90, 91, 92, 93, 94, - 0, 81, 82, 83, 84, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 85, 86, 306, 0, - 0, 0, 0, 87, 88, 89, 90, 91, 92, 93, - 94, 0, 0, 0, 0, 0, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 81, 82, - 83, 84, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 85, 86, 0, 0, 0, 0, 0, - 87, 88, 89, 90, 91, 92, 93, 94, 0, 0, - 0, 0, 0, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 231, 81, 82, 83, 84, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 85, 86, 0, 0, 0, 0, 0, 87, 88, 89, - 90, 91, 92, 93, 94, 0, 0, 0, 0, 0, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 237, 81, 82, 83, 84, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 85, 86, 0, - 0, 0, 0, 0, 87, 88, 89, 90, 91, 92, - 93, 94, 0, 0, 0, 0, 0, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 285, 81, - 82, 83, 84, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 85, 86, 0, 0, 0, 0, - 0, 87, 88, 89, 90, 91, 92, 93, 94, 0, - 0, 0, 0, 0, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104,