Merge branch 'master' of https://github.com/stedolan/jq into contains-operator

Conflicts:
	lexer.gen.c
	parser.gen.c
	parser.gen.h
	parser.gen.info
	parser.y
This commit is contained in:
Stephen Roantree committed 2012-10-25 10:02:02 -07:00
commit 50bcbc2271
3 files changed
+289 -280

No files matched your search

+108 -108
View File
@@ -573,8 +573,8 @@ static const yytype_uint16 yyprhs[] =
0, 0, 3, 5, 7, 8, 11, 14, 21, 27,
31, 35, 39, 43, 47, 51, 55, 59, 63, 67,
71, 75, 79, 83, 87, 91, 95, 99, 103, 107,
111, 115, 119, 123, 125, 127, 131, 137, 146, 147,
150, 155, 161, 165, 169, 171, 173, 177, 180, 185,
111, 115, 119, 123, 125, 129, 135, 144, 145, 148,
153, 159, 163, 167, 169, 171, 175, 178, 183, 187,
189, 191, 195, 199, 202, 206, 209, 211, 216, 220,
224, 229, 233, 234, 236, 240, 244, 248, 252, 254,
260
@@ -595,13 +595,13 @@ static const yytype_int8 yyrhs[] =
-1, 54, 22, 54, -1, 54, 6, 54, -1, 54,
7, 54, -1, 54, 36, 54, -1, 54, 37, 54,
-1, 54, 24, 54, -1, 54, 25, 54, -1, 54,
26, 54, -1, 55, -1, 60, -1, 27, 57, 31,
-1, 10, 4, 43, 54, 32, -1, 10, 4, 44,
4, 45, 43, 54, 32, -1, -1, 57, 28, -1,
57, 29, 54, 30, -1, 14, 54, 12, 54, 58,
-1, 13, 54, 15, -1, 59, 33, 59, -1, 60,
-1, 46, -1, 60, 46, 4, -1, 46, 4, -1,
60, 47, 54, 48, -1, 60, 47, 48, -1, 5,
26, 54, -1, 60, -1, 27, 57, 31, -1, 10,
4, 43, 54, 32, -1, 10, 4, 44, 4, 45,
43, 54, 32, -1, -1, 57, 28, -1, 57, 29,
54, 30, -1, 14, 54, 12, 54, 58, -1, 13,
54, 15, -1, 59, 33, 59, -1, 60, -1, 46,
-1, 60, 46, 4, -1, 46, 4, -1, 60, 47,
54, 48, -1, 60, 47, 48, -1, 5, -1, 55,
-1, 44, 54, 45, -1, 47, 54, 48, -1, 47,
48, -1, 49, 61, 50, -1, 42, 4, -1, 4,
-1, 4, 44, 54, 45, -1, 44, 1, 45, -1,
@@ -618,11 +618,11 @@ static const yytype_uint16 yyrline[] =
0, 185, 185, 188, 193, 196, 201, 205, 212, 215,
220, 229, 233, 237, 241, 245, 249, 253, 257, 261,
265, 269, 273, 277, 281, 285, 289, 293, 297, 301,
305, 309, 313, 317, 321, 326, 331, 337, 345, 348,
351, 357, 360, 365, 369, 375, 378, 381, 385, 388,
391, 394, 397, 400, 403, 408, 412, 416, 426, 427,
428, 429, 432, 435, 436, 437, 440, 443, 446, 450,
453
305, 309, 313, 317, 322, 327, 333, 341, 344, 347,
353, 356, 361, 365, 371, 374, 377, 381, 384, 387,
390, 393, 396, 399, 402, 407, 411, 415, 425, 426,
427, 428, 431, 434, 435, 436, 439, 442, 445, 449,
452
};
#endif
@@ -664,8 +664,8 @@ static const yytype_uint8 yyr1[] =
0, 51, 52, 52, 53, 53, 54, 54, 54, 54,
54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
54, 54, 54, 54, 54, 55, 56, 56, 57, 57,
57, 58, 58, 59, 59, 60, 60, 60, 60, 60,
54, 54, 54, 54, 55, 56, 56, 57, 57, 57,
58, 58, 59, 59, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 61, 61, 61, 61, 62, 62, 62, 62,
62
@@ -677,8 +677,8 @@ static const yytype_uint8 yyr2[] =
0, 2, 1, 1, 0, 2, 2, 6, 5, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 1, 1, 3, 5, 8, 0, 2,
4, 5, 3, 3, 1, 1, 3, 2, 4, 3,
3, 3, 3, 1, 3, 5, 8, 0, 2, 4,
5, 3, 3, 1, 1, 3, 2, 4, 3, 1,
1, 3, 3, 2, 3, 2, 1, 4, 3, 3,
4, 3, 0, 1, 3, 3, 3, 3, 1, 5,
5
@@ -689,22 +689,22 @@ static const yytype_uint8 yyr2[] =
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
4, 56, 50, 0, 0, 38, 0, 0, 45, 0,
0, 0, 3, 2, 33, 4, 34, 0, 0, 0,
0, 0, 55, 0, 0, 47, 0, 53, 0, 0,
4, 56, 49, 0, 0, 37, 0, 0, 44, 0,
0, 0, 3, 2, 50, 4, 33, 0, 0, 0,
0, 0, 55, 0, 0, 46, 0, 53, 0, 0,
68, 0, 0, 0, 63, 1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
6, 0, 0, 0, 0, 0, 0, 9, 0, 39,
0, 35, 58, 51, 59, 52, 0, 61, 0, 0,
6, 0, 0, 0, 0, 0, 0, 9, 0, 38,
0, 34, 58, 51, 59, 52, 0, 61, 0, 0,
0, 0, 54, 0, 26, 27, 13, 12, 11, 15,
19, 21, 23, 25, 14, 30, 31, 32, 16, 17,
10, 28, 29, 18, 20, 22, 24, 0, 46, 0,
49, 0, 57, 0, 0, 0, 0, 0, 65, 66,
44, 0, 0, 67, 64, 0, 60, 48, 36, 0,
0, 0, 8, 40, 0, 0, 0, 0, 0, 0,
0, 43, 70, 69, 7, 0, 42, 0, 37, 0,
41
10, 28, 29, 18, 20, 22, 24, 0, 45, 0,
48, 0, 57, 0, 0, 0, 0, 0, 65, 66,
43, 0, 0, 67, 64, 0, 60, 47, 35, 0,
0, 0, 8, 39, 0, 0, 0, 0, 0, 0,
0, 42, 70, 69, 7, 0, 41, 0, 36, 0,
40
};
/* YYDEFGOTO[NTERM-NUM]. */
@@ -726,13 +726,13 @@ static const yytype_int16 yypact[] =
179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
179, 179, 179, 179, 179, 179, 179, 179, 179, -76,
662, -8, 72, 106, 374, 179, 73, -76, 179, -76,
179, -76, -76, -76, -76, -76, 74, -76, 163, 34,
410, 163, -76, 74, 807, 807, 734, 813, 786, 760,
179, -76, -76, -76, -76, -76, 74, -76, 165, 34,
410, 165, -76, 74, 807, 807, 734, 813, 786, 760,
760, 760, 760, 760, 760, 807, 807, 807, 698, 734,
760, 807, 807, -16, -16, -76, -76, 77, -76, 37,
-76, 259, -76, 482, 41, 446, 518, 48, -76, 54,
-20, 45, 50, 54, -76, 58, -76, -76, -76, 51,
179, 179, -76, -76, 163, 163, 163, 179, 179, 554,
179, 179, -76, -76, 165, 165, 165, 179, 179, 554,
590, -76, 54, 54, 698, 626, -76, 179, -76, 446,
-76
};
@@ -766,12 +766,12 @@ static const yytype_int16 yytable[] =
139, 140, 23, 5, 0, 1, 2, 144, 145, 0,
0, 3, 4, 0, 0, 0, 0, 149, 6, 0,
7, 0, 8, 9, 110, 10, 79, 0, 5, 1,
2, 0, 0, 0, 0, 3, 4, 1, 2, 0,
0, 0, 0, 6, 0, 7, 0, 8, 9, 0,
2, 0, 0, 0, 0, 3, 4, 0, 0, 1,
2, 0, 0, 6, 0, 7, 0, 8, 9, 0,
10, 0, 5, 1, 2, 0, 0, 0, 0, 3,
4, 0, 0, 0, 0, 0, 0, 6, 0, 7,
0, 8, 9, 0, 10, 6, 5, 7, 0, 8,
9, 0, 10, 0, 0, 0, 0, 0, 0, 0,
4, 0, 5, 0, 0, 0, 0, 6, 0, 7,
0, 8, 9, 0, 10, 0, 5, 6, 0, 7,
0, 8, 9, 0, 10, 0, 0, 0, 0, 0,
0, 6, 0, 7, 0, 8, 9, 0, 10, 36,
37, 38, 0, 0, 0, 0, 0, 0, 0, 39,
40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
@@ -862,12 +862,12 @@ static const yytype_int16 yycheck[] =
130, 131, 1, 27, -1, 4, 5, 137, 138, -1,
-1, 10, 11, -1, -1, -1, -1, 147, 42, -1,
44, -1, 46, 47, 48, 49, 1, -1, 27, 4,
5, -1, -1, -1, -1, 10, 11, 4, 5, -1,
-1, -1, -1, 42, -1, 44, -1, 46, 47, -1,
5, -1, -1, -1, -1, 10, 11, -1, -1, 4,
5, -1, -1, 42, -1, 44, -1, 46, 47, -1,
49, -1, 27, 4, 5, -1, -1, -1, -1, 10,
11, -1, -1, -1, -1, -1, -1, 42, -1, 44,
-1, 46, 47, -1, 49, 42, 27, 44, -1, 46,
47, -1, 49, -1, -1, -1, -1, -1, -1, -1,
11, -1, 27, -1, -1, -1, -1, 42, -1, 44,
-1, 46, 47, -1, 49, -1, 27, 42, -1, 44,
-1, 46, 47, -1, 49, -1, -1, -1, -1, -1,
-1, 42, -1, 44, -1, 46, 47, -1, 49, 6,
7, 8, -1, -1, -1, -1, -1, -1, -1, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
@@ -2266,33 +2266,24 @@ yyreduce:
/* Line 1806 of yacc.c */
#line 317 "parser.y"
{
(yyval.blk) = (yyvsp[(1) - (1)].blk);
{
(yyval.blk) = (yyvsp[(1) - (1)].blk);
}
break;
case 34:
/* Line 1806 of yacc.c */
#line 321 "parser.y"
{
(yyval.blk) = (yyvsp[(1) - (1)].blk);
#line 322 "parser.y"
{
(yyval.blk) = (yyvsp[(2) - (3)].blk);
}
break;
case 35:
/* Line 1806 of yacc.c */
#line 326 "parser.y"
{
(yyval.blk) = (yyvsp[(2) - (3)].blk);
}
break;
case 36:
/* Line 1806 of yacc.c */
#line 331 "parser.y"
#line 327 "parser.y"
{
block body = block_join((yyvsp[(4) - (5)].blk), gen_op_simple(RET));
(yyval.blk) = gen_op_block_defn_rec(CLOSURE_CREATE, jv_string_value((yyvsp[(2) - (5)].literal)), body);
@@ -2300,10 +2291,10 @@ yyreduce:
}
break;
case 37:
case 36:
/* Line 1806 of yacc.c */
#line 337 "parser.y"
#line 333 "parser.y"
{
block body = block_bind(gen_op_block_unbound(CLOSURE_PARAM, jv_string_value((yyvsp[(4) - (8)].literal))), block_join((yyvsp[(7) - (8)].blk), gen_op_simple(RET)), OP_IS_CALL_PSEUDO);
(yyval.blk) = gen_op_block_defn_rec(CLOSURE_CREATE, jv_string_value((yyvsp[(2) - (8)].literal)), body);
@@ -2312,48 +2303,57 @@ yyreduce:
}
break;
case 37:
/* Line 1806 of yacc.c */
#line 341 "parser.y"
{
(yyval.blk) = gen_op_const(LOADK, jv_string(""));
}
break;
case 38:
/* Line 1806 of yacc.c */
#line 345 "parser.y"
#line 344 "parser.y"
{
(yyval.blk) = gen_op_const(LOADK, jv_string(""));
(yyval.blk) = gen_binop((yyvsp[(1) - (2)].blk), gen_op_const(LOADK, (yyvsp[(2) - (2)].literal)), '+');
}
break;
case 39:
/* Line 1806 of yacc.c */
#line 348 "parser.y"
#line 347 "parser.y"
{
(yyval.blk) = gen_binop((yyvsp[(1) - (2)].blk), gen_op_const(LOADK, (yyvsp[(2) - (2)].literal)), '+');
(yyval.blk) = gen_binop((yyvsp[(1) - (4)].blk), gen_format((yyvsp[(3) - (4)].blk)), '+');
}
break;
case 40:
/* Line 1806 of yacc.c */
#line 351 "parser.y"
#line 353 "parser.y"
{
(yyval.blk) = gen_binop((yyvsp[(1) - (4)].blk), gen_format((yyvsp[(3) - (4)].blk)), '+');
(yyval.blk) = gen_cond((yyvsp[(2) - (5)].blk), (yyvsp[(4) - (5)].blk), (yyvsp[(5) - (5)].blk));
}
break;
case 41:
/* Line 1806 of yacc.c */
#line 357 "parser.y"
#line 356 "parser.y"
{
(yyval.blk) = gen_cond((yyvsp[(2) - (5)].blk), (yyvsp[(4) - (5)].blk), (yyvsp[(5) - (5)].blk));
(yyval.blk) = (yyvsp[(2) - (3)].blk);
}
break;
case 42:
/* Line 1806 of yacc.c */
#line 360 "parser.y"
{
(yyval.blk) = (yyvsp[(2) - (3)].blk);
#line 361 "parser.y"
{
(yyval.blk) = block_join((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk));
}
break;
@@ -2361,35 +2361,35 @@ yyreduce:
/* Line 1806 of yacc.c */
#line 365 "parser.y"
{
(yyval.blk) = block_join((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk));
{
(yyval.blk) = (yyvsp[(1) - (1)].blk);
}
break;
case 44:
/* Line 1806 of yacc.c */
#line 369 "parser.y"
#line 371 "parser.y"
{
(yyval.blk) = (yyvsp[(1) - (1)].blk);
(yyval.blk) = gen_noop();
}
break;
case 45:
/* Line 1806 of yacc.c */
#line 375 "parser.y"
#line 374 "parser.y"
{
(yyval.blk) = gen_noop();
(yyval.blk) = gen_index((yyvsp[(1) - (3)].blk), gen_op_const(LOADK, (yyvsp[(3) - (3)].literal)));
}
break;
case 46:
/* Line 1806 of yacc.c */
#line 378 "parser.y"
{
(yyval.blk) = gen_index((yyvsp[(1) - (3)].blk), gen_op_const(LOADK, (yyvsp[(3) - (3)].literal)));
#line 377 "parser.y"
{
(yyval.blk) = gen_index(gen_noop(), gen_op_const(LOADK, (yyvsp[(2) - (2)].literal)));
}
break;
@@ -2397,42 +2397,42 @@ yyreduce:
/* Line 1806 of yacc.c */
#line 381 "parser.y"
{
(yyval.blk) = gen_index(gen_noop(), gen_op_const(LOADK, (yyvsp[(2) - (2)].literal)));
{
(yyval.blk) = gen_index((yyvsp[(1) - (4)].blk), (yyvsp[(3) - (4)].blk));
}
break;
case 48:
/* Line 1806 of yacc.c */
#line 385 "parser.y"
#line 384 "parser.y"
{
(yyval.blk) = gen_index((yyvsp[(1) - (4)].blk), (yyvsp[(3) - (4)].blk));
(yyval.blk) = block_join((yyvsp[(1) - (3)].blk), gen_op_simple(EACH));
}
break;
case 49:
/* Line 1806 of yacc.c */
#line 388 "parser.y"
#line 387 "parser.y"
{
(yyval.blk) = block_join((yyvsp[(1) - (3)].blk), gen_op_simple(EACH));
(yyval.blk) = gen_op_const(LOADK, (yyvsp[(1) - (1)].literal));
}
break;
case 50:
/* Line 1806 of yacc.c */
#line 391 "parser.y"
#line 390 "parser.y"
{
(yyval.blk) = gen_op_const(LOADK, (yyvsp[(1) - (1)].literal));
(yyval.blk) = (yyvsp[(1) - (1)].blk);
}
break;
case 51:
/* Line 1806 of yacc.c */
#line 394 "parser.y"
#line 393 "parser.y"
{
(yyval.blk) = (yyvsp[(2) - (3)].blk);
}
@@ -2441,7 +2441,7 @@ yyreduce:
case 52:
/* Line 1806 of yacc.c */
#line 397 "parser.y"
#line 396 "parser.y"
{
(yyval.blk) = gen_collect((yyvsp[(2) - (3)].blk));
}
@@ -2450,7 +2450,7 @@ yyreduce:
case 53:
/* Line 1806 of yacc.c */
#line 400 "parser.y"
#line 399 "parser.y"
{
(yyval.blk) = gen_op_const(LOADK, jv_array());
}
@@ -2459,7 +2459,7 @@ yyreduce:
case 54:
/* Line 1806 of yacc.c */
#line 403 "parser.y"
#line 402 "parser.y"
{
(yyval.blk) = gen_subexp(gen_op_const(LOADK, jv_object()));
block_append(&(yyval.blk), (yyvsp[(2) - (3)].blk));
@@ -2470,7 +2470,7 @@ yyreduce:
case 55:
/* Line 1806 of yacc.c */
#line 408 "parser.y"
#line 407 "parser.y"
{
(yyval.blk) = gen_location((yyloc), gen_op_var_unbound(LOADV, jv_string_value((yyvsp[(2) - (2)].literal))));
jv_free((yyvsp[(2) - (2)].literal));
@@ -2480,7 +2480,7 @@ yyreduce:
case 56:
/* Line 1806 of yacc.c */
#line 412 "parser.y"
#line 411 "parser.y"
{
(yyval.blk) = gen_location((yyloc), gen_op_call(CALL_1_1, gen_op_block_unbound(CLOSURE_REF, jv_string_value((yyvsp[(1) - (1)].literal)))));
jv_free((yyvsp[(1) - (1)].literal));
@@ -2490,7 +2490,7 @@ yyreduce:
case 57:
/* Line 1806 of yacc.c */
#line 416 "parser.y"
#line 415 "parser.y"
{
(yyval.blk) = gen_op_call(CALL_1_1,
block_join(gen_op_block_unbound(CLOSURE_REF, jv_string_value((yyvsp[(1) - (4)].literal))),
@@ -2506,35 +2506,35 @@ yyreduce:
case 58:
/* Line 1806 of yacc.c */
#line 426 "parser.y"
#line 425 "parser.y"
{ (yyval.blk) = gen_noop(); }
break;
case 59:
/* Line 1806 of yacc.c */
#line 427 "parser.y"
#line 426 "parser.y"
{ (yyval.blk) = gen_noop(); }
break;
case 60:
/* Line 1806 of yacc.c */
#line 428 "parser.y"
#line 427 "parser.y"
{ (yyval.blk) = (yyvsp[(1) - (4)].blk); }
break;
case 61:
/* Line 1806 of yacc.c */
#line 429 "parser.y"
#line 428 "parser.y"
{ (yyval.blk) = gen_noop(); }
break;
case 62:
/* Line 1806 of yacc.c */
#line 432 "parser.y"
#line 431 "parser.y"
{
(yyval.blk)=gen_noop();
}
@@ -2543,28 +2543,28 @@ yyreduce:
case 63:
/* Line 1806 of yacc.c */
#line 435 "parser.y"
#line 434 "parser.y"
{ (yyval.blk) = (yyvsp[(1) - (1)].blk); }
break;
case 64:
/* Line 1806 of yacc.c */
#line 436 "parser.y"
#line 435 "parser.y"
{ (yyval.blk)=block_join((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk)); }
break;
case 65:
/* Line 1806 of yacc.c */
#line 437 "parser.y"
#line 436 "parser.y"
{ (yyval.blk) = (yyvsp[(3) - (3)].blk); }
break;
case 66:
/* Line 1806 of yacc.c */
#line 440 "parser.y"
#line 439 "parser.y"
{
(yyval.blk) = gen_dictpair(gen_op_const(LOADK, (yyvsp[(1) - (3)].literal)), (yyvsp[(3) - (3)].blk));
}
@@ -2573,7 +2573,7 @@ yyreduce:
case 67:
/* Line 1806 of yacc.c */
#line 443 "parser.y"
#line 442 "parser.y"
{
(yyval.blk) = gen_dictpair((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk));
}
@@ -2582,7 +2582,7 @@ yyreduce:
case 68:
/* Line 1806 of yacc.c */
#line 446 "parser.y"
#line 445 "parser.y"
{
(yyval.blk) = gen_dictpair(gen_op_const(LOADK, jv_copy((yyvsp[(1) - (1)].literal))),
gen_index(gen_noop(), gen_op_const(LOADK, (yyvsp[(1) - (1)].literal))));
@@ -2592,7 +2592,7 @@ yyreduce:
case 69:
/* Line 1806 of yacc.c */
#line 450 "parser.y"
#line 449 "parser.y"
{
(yyval.blk) = gen_dictpair((yyvsp[(2) - (5)].blk), (yyvsp[(5) - (5)].blk));
}
@@ -2601,7 +2601,7 @@ yyreduce:
case 70:
/* Line 1806 of yacc.c */
#line 453 "parser.y"
#line 452 "parser.y"
{ (yyval.blk) = (yyvsp[(5) - (5)].blk); }
break;
@@ -2846,7 +2846,7 @@ yyreturn:
/* Line 2067 of yacc.c */
#line 454 "parser.y"
#line 453 "parser.y"
int jq_parse(struct locfile* locations, block* answer) {
+178 -168
View File
@@ -40,30 +40,30 @@ Grammar
29 | Exp "<=" Exp
30 | Exp ">=" Exp
31 | Exp "contains" Exp
32 | String
33 | Term
32 | Term
34 String: QQSTRING_START QQString QQSTRING_END
33 String: QQSTRING_START QQString QQSTRING_END
35 FuncDef: "def" IDENT ':' Exp ';'
36 | "def" IDENT '(' IDENT ')' ':' Exp ';'
34 FuncDef: "def" IDENT ':' Exp ';'
35 | "def" IDENT '(' IDENT ')' ':' Exp ';'
37 QQString: /* empty */
38 | QQString QQSTRING_TEXT
39 | QQString QQSTRING_INTERP_START Exp QQSTRING_INTERP_END
36 QQString: /* empty */
37 | QQString QQSTRING_TEXT
38 | QQString QQSTRING_INTERP_START Exp QQSTRING_INTERP_END
40 ElseBody: "elif" Exp "then" Exp ElseBody
41 | "else" Exp "end"
39 ElseBody: "elif" Exp "then" Exp ElseBody
40 | "else" Exp "end"
42 ExpD: ExpD '|' ExpD
43 | Term
41 ExpD: ExpD '|' ExpD
42 | Term
44 Term: '.'
45 | Term '.' IDENT
46 | '.' IDENT
47 | Term '[' Exp ']'
48 | Term '[' ']'
49 | LITERAL
43 Term: '.'
44 | Term '.' IDENT
45 | '.' IDENT
46 | Term '[' Exp ']'
47 | Term '[' ']'
48 | LITERAL
49 | String
50 | '(' Exp ')'
51 | '[' Exp ']'
52 | '[' ']'
@@ -92,38 +92,38 @@ Terminals, with rules where they appear
$end (0) 0
'$' (36) 6 54
'(' (40) 36 50 56 57 68 69
')' (41) 36 50 56 57 68 69
'(' (40) 35 50 56 57 68 69
')' (41) 35 50 56 57 68 69
'*' (42) 21
'+' (43) 17
',' (44) 16 63 64
'-' (45) 19
'.' (46) 44 45 46
'.' (46) 43 44 45
'/' (47) 23
':' (58) 35 36 65 66 68 69
';' (59) 35 36
':' (58) 34 35 65 66 68 69
';' (59) 34 35
'<' (60) 27
'=' (61) 9
'>' (62) 28
'[' (91) 47 48 51 52 58 59
']' (93) 47 48 51 52 58 59
'[' (91) 46 47 51 52 58 59
']' (93) 46 47 51 52 58 59
'{' (123) 53 60
'|' (124) 6 15 42
'|' (124) 6 15 41
'}' (125) 53 60
error (256) 8 57 58 59 60 64 69
INVALID_CHARACTER (258)
IDENT (259) 6 35 36 45 46 54 55 56 65 67
LITERAL (260) 49
IDENT (259) 6 34 35 44 45 54 55 56 65 67
LITERAL (260) 48
"==" (261) 25
"!=" (262) 26
"//" (263) 12
"as" (264) 6
"def" (265) 35 36
"def" (265) 34 35
"if" (266) 7 8
"then" (267) 7 40
"else" (268) 41
"elif" (269) 40
"end" (270) 41
"then" (267) 7 39
"else" (268) 40
"elif" (269) 39
"end" (270) 40
"and" (271) 11
"or" (272) 10
"|=" (273) 14
@@ -135,11 +135,11 @@ LITERAL (260) 49
"<=" (279) 29
">=" (280) 30
"contains" (281) 31
QQSTRING_START (282) 34
QQSTRING_TEXT (283) 38
QQSTRING_INTERP_START (284) 39
QQSTRING_INTERP_END (285) 39
QQSTRING_END (286) 34
QQSTRING_START (282) 33
QQSTRING_TEXT (283) 37
QQSTRING_INTERP_START (284) 38
QQSTRING_INTERP_END (285) 38
QQSTRING_END (286) 33
Nonterminals, with rules where they appear
@@ -152,22 +152,22 @@ FuncDefs (53)
on left: 3 4, on right: 2 4
Exp (54)
on left: 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, on right: 1 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 35 36 39 40
41 47 50 51 56 68
25 26 27 28 29 30 31 32, on right: 1 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 34 35 38 39 40
46 50 51 56 68
String (55)
on left: 34, on right: 32 66
on left: 33, on right: 49 66
FuncDef (56)
on left: 35 36, on right: 4 5
on left: 34 35, on right: 4 5
QQString (57)
on left: 37 38 39, on right: 34 38 39
on left: 36 37 38, on right: 33 37 38
ElseBody (58)
on left: 40 41, on right: 7 40
on left: 39 40, on right: 7 39
ExpD (59)
on left: 42 43, on right: 42 65 66 68 69
on left: 41 42, on right: 41 65 66 68 69
Term (60)
on left: 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60, on right:
6 33 43 45 47 48 59
on left: 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60,
on right: 6 32 42 44 46 47 59
MkDict (61)
on left: 61 62 63 64, on right: 53 63 64
MkDictPair (62)
@@ -211,15 +211,15 @@ state 1
state 2
49 Term: LITERAL .
48 Term: LITERAL .
$default reduce using rule 49 (Term)
$default reduce using rule 48 (Term)
state 3
35 FuncDef: "def" . IDENT ':' Exp ';'
36 | "def" . IDENT '(' IDENT ')' ':' Exp ';'
34 FuncDef: "def" . IDENT ':' Exp ';'
35 | "def" . IDENT '(' IDENT ')' ':' Exp ';'
IDENT shift, and go to state 18
@@ -248,9 +248,9 @@ state 4
state 5
34 String: QQSTRING_START . QQString QQSTRING_END
33 String: QQSTRING_START . QQString QQSTRING_END
$default reduce using rule 37 (QQString)
$default reduce using rule 36 (QQString)
QQString go to state 21
@@ -287,12 +287,12 @@ state 7
state 8
44 Term: '.' .
46 | '.' . IDENT
43 Term: '.' .
45 | '.' . IDENT
IDENT shift, and go to state 25
$default reduce using rule 44 (Term)
$default reduce using rule 43 (Term)
state 9
@@ -407,9 +407,9 @@ state 13
state 14
32 Exp: String .
49 Term: String .
$default reduce using rule 32 (Exp)
$default reduce using rule 49 (Term)
state 15
@@ -440,17 +440,17 @@ state 15
state 16
6 Exp: Term . "as" '$' IDENT '|' Exp
33 | Term .
45 Term: Term . '.' IDENT
47 | Term . '[' Exp ']'
48 | Term . '[' ']'
32 | Term .
44 Term: Term . '.' IDENT
46 | Term . '[' Exp ']'
47 | Term . '[' ']'
59 | Term . '[' error ']'
"as" shift, and go to state 61
'.' shift, and go to state 62
'[' shift, and go to state 63
$default reduce using rule 33 (Exp)
$default reduce using rule 32 (Exp)
state 17
@@ -476,8 +476,8 @@ state 17
state 18
35 FuncDef: "def" IDENT . ':' Exp ';'
36 | "def" IDENT . '(' IDENT ')' ':' Exp ';'
34 FuncDef: "def" IDENT . ':' Exp ';'
35 | "def" IDENT . '(' IDENT ')' ':' Exp ';'
':' shift, and go to state 65
'(' shift, and go to state 66
@@ -561,9 +561,9 @@ state 20
state 21
34 String: QQSTRING_START QQString . QQSTRING_END
38 QQString: QQString . QQSTRING_TEXT
39 | QQString . QQSTRING_INTERP_START Exp QQSTRING_INTERP_END
33 String: QQSTRING_START QQString . QQSTRING_END
37 QQString: QQString . QQSTRING_TEXT
38 | QQString . QQSTRING_INTERP_START Exp QQSTRING_INTERP_END
QQSTRING_TEXT shift, and go to state 69
QQSTRING_INTERP_START shift, and go to state 70
@@ -639,9 +639,9 @@ state 24
state 25
46 Term: '.' IDENT .
45 Term: '.' IDENT .
$default reduce using rule 46 (Term)
$default reduce using rule 45 (Term)
state 26
@@ -1337,15 +1337,15 @@ state 61
state 62
45 Term: Term '.' . IDENT
44 Term: Term '.' . IDENT
IDENT shift, and go to state 108
state 63
47 Term: Term '[' . Exp ']'
48 | Term '[' . ']'
46 Term: Term '[' . Exp ']'
47 | Term '[' . ']'
59 | Term '[' . error ']'
error shift, and go to state 109
@@ -1422,7 +1422,7 @@ state 64
state 65
35 FuncDef: "def" IDENT ':' . Exp ';'
34 FuncDef: "def" IDENT ':' . Exp ';'
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
@@ -1443,7 +1443,7 @@ state 65
state 66
36 FuncDef: "def" IDENT '(' . IDENT ')' ':' Exp ';'
35 FuncDef: "def" IDENT '(' . IDENT ')' ':' Exp ';'
IDENT shift, and go to state 114
@@ -1478,14 +1478,14 @@ state 68
state 69
38 QQString: QQString QQSTRING_TEXT .
37 QQString: QQString QQSTRING_TEXT .
$default reduce using rule 38 (QQString)
$default reduce using rule 37 (QQString)
state 70
39 QQString: QQString QQSTRING_INTERP_START . Exp QQSTRING_INTERP_END
38 QQString: QQString QQSTRING_INTERP_START . Exp QQSTRING_INTERP_END
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
@@ -1506,9 +1506,9 @@ state 70
state 71
34 String: QQSTRING_START QQString QQSTRING_END .
33 String: QQSTRING_START QQString QQSTRING_END .
$default reduce using rule 34 (String)
$default reduce using rule 33 (String)
state 72
@@ -1566,16 +1566,18 @@ state 78
65 MkDictPair: IDENT ':' . ExpD
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
'$' shift, and go to state 6
'(' shift, and go to state 7
'.' shift, and go to state 8
'[' shift, and go to state 9
'{' shift, and go to state 10
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
QQSTRING_START shift, and go to state 5
'$' shift, and go to state 6
'(' shift, and go to state 7
'.' shift, and go to state 8
'[' shift, and go to state 9
'{' shift, and go to state 10
ExpD go to state 119
Term go to state 120
String go to state 14
ExpD go to state 119
Term go to state 120
state 79
@@ -1642,16 +1644,18 @@ state 81
66 MkDictPair: String ':' . ExpD
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
'$' shift, and go to state 6
'(' shift, and go to state 7
'.' shift, and go to state 8
'[' shift, and go to state 9
'{' shift, and go to state 10
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
QQSTRING_START shift, and go to state 5
'$' shift, and go to state 6
'(' shift, and go to state 7
'.' shift, and go to state 8
'[' shift, and go to state 9
'{' shift, and go to state 10
ExpD go to state 123
Term go to state 120
String go to state 14
ExpD go to state 123
Term go to state 120
state 82
@@ -2719,9 +2723,9 @@ state 107
state 108
45 Term: Term '.' IDENT .
44 Term: Term '.' IDENT .
$default reduce using rule 45 (Term)
$default reduce using rule 44 (Term)
state 109
@@ -2733,9 +2737,9 @@ state 109
state 110
48 Term: Term '[' ']' .
47 Term: Term '[' ']' .
$default reduce using rule 48 (Term)
$default reduce using rule 47 (Term)
state 111
@@ -2763,7 +2767,7 @@ state 111
29 | Exp . "<=" Exp
30 | Exp . ">=" Exp
31 | Exp . "contains" Exp
47 Term: Term '[' Exp . ']'
46 Term: Term '[' Exp . ']'
"==" shift, and go to state 36
"!=" shift, and go to state 37
@@ -2823,7 +2827,7 @@ state 113
29 | Exp . "<=" Exp
30 | Exp . ">=" Exp
31 | Exp . "contains" Exp
35 FuncDef: "def" IDENT ':' Exp . ';'
34 FuncDef: "def" IDENT ':' Exp . ';'
"==" shift, and go to state 36
"!=" shift, and go to state 37
@@ -2853,7 +2857,7 @@ state 113
state 114
36 FuncDef: "def" IDENT '(' IDENT . ')' ':' Exp ';'
35 FuncDef: "def" IDENT '(' IDENT . ')' ':' Exp ';'
')' shift, and go to state 129
@@ -2939,7 +2943,7 @@ state 116
29 | Exp . "<=" Exp
30 | Exp . ">=" Exp
31 | Exp . "contains" Exp
39 QQString: QQString QQSTRING_INTERP_START Exp . QQSTRING_INTERP_END
38 QQString: QQString QQSTRING_INTERP_START Exp . QQSTRING_INTERP_END
"==" shift, and go to state 36
"!=" shift, and go to state 37
@@ -2983,7 +2987,7 @@ state 118
state 119
42 ExpD: ExpD . '|' ExpD
41 ExpD: ExpD . '|' ExpD
65 MkDictPair: IDENT ':' ExpD .
'|' shift, and go to state 134
@@ -2993,16 +2997,16 @@ state 119
state 120
43 ExpD: Term .
45 Term: Term . '.' IDENT
47 | Term . '[' Exp ']'
48 | Term . '[' ']'
42 ExpD: Term .
44 Term: Term . '.' IDENT
46 | Term . '[' Exp ']'
47 | Term . '[' ']'
59 | Term . '[' error ']'
'.' shift, and go to state 62
'[' shift, and go to state 63
$default reduce using rule 43 (ExpD)
$default reduce using rule 42 (ExpD)
state 121
@@ -3021,7 +3025,7 @@ state 122
state 123
42 ExpD: ExpD . '|' ExpD
41 ExpD: ExpD . '|' ExpD
66 MkDictPair: String ':' ExpD .
'|' shift, and go to state 134
@@ -3052,28 +3056,28 @@ state 126
state 127
47 Term: Term '[' Exp ']' .
46 Term: Term '[' Exp ']' .
$default reduce using rule 47 (Term)
$default reduce using rule 46 (Term)
state 128
35 FuncDef: "def" IDENT ':' Exp ';' .
34 FuncDef: "def" IDENT ':' Exp ';' .
$default reduce using rule 35 (FuncDef)
$default reduce using rule 34 (FuncDef)
state 129
36 FuncDef: "def" IDENT '(' IDENT ')' . ':' Exp ';'
35 FuncDef: "def" IDENT '(' IDENT ')' . ':' Exp ';'
':' shift, and go to state 138
state 130
41 ElseBody: "else" . Exp "end"
40 ElseBody: "else" . Exp "end"
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
@@ -3094,7 +3098,7 @@ state 130
state 131
40 ElseBody: "elif" . Exp "then" Exp ElseBody
39 ElseBody: "elif" . Exp "then" Exp ElseBody
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
@@ -3122,57 +3126,63 @@ state 132
state 133
39 QQString: QQString QQSTRING_INTERP_START Exp QQSTRING_INTERP_END .
38 QQString: QQString QQSTRING_INTERP_START Exp QQSTRING_INTERP_END .
$default reduce using rule 39 (QQString)
$default reduce using rule 38 (QQString)
state 134
42 ExpD: ExpD '|' . ExpD
41 ExpD: ExpD '|' . ExpD
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
'$' shift, and go to state 6
'(' shift, and go to state 7
'.' shift, and go to state 8
'[' shift, and go to state 9
'{' shift, and go to state 10
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
QQSTRING_START shift, and go to state 5
'$' shift, and go to state 6
'(' shift, and go to state 7
'.' shift, and go to state 8
'[' shift, and go to state 9
'{' shift, and go to state 10
ExpD go to state 141
Term go to state 120
String go to state 14
ExpD go to state 141
Term go to state 120
state 135
69 MkDictPair: '(' error ')' ':' . ExpD
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
'$' shift, and go to state 6
'(' shift, and go to state 7
'.' shift, and go to state 8
'[' shift, and go to state 9
'{' shift, and go to state 10
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
QQSTRING_START shift, and go to state 5
'$' shift, and go to state 6
'(' shift, and go to state 7
'.' shift, and go to state 8
'[' shift, and go to state 9
'{' shift, and go to state 10
ExpD go to state 142
Term go to state 120
String go to state 14
ExpD go to state 142
Term go to state 120
state 136
68 MkDictPair: '(' Exp ')' ':' . ExpD
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
'$' shift, and go to state 6
'(' shift, and go to state 7
'.' shift, and go to state 8
'[' shift, and go to state 9
'{' shift, and go to state 10
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
QQSTRING_START shift, and go to state 5
'$' shift, and go to state 6
'(' shift, and go to state 7
'.' shift, and go to state 8
'[' shift, and go to state 9
'{' shift, and go to state 10
ExpD go to state 143
Term go to state 120
String go to state 14
ExpD go to state 143
Term go to state 120
state 137
@@ -3198,7 +3208,7 @@ state 137
state 138
36 FuncDef: "def" IDENT '(' IDENT ')' ':' . Exp ';'
35 FuncDef: "def" IDENT '(' IDENT ')' ':' . Exp ';'
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
@@ -3242,7 +3252,7 @@ state 139
29 | Exp . "<=" Exp
30 | Exp . ">=" Exp
31 | Exp . "contains" Exp
41 ElseBody: "else" Exp . "end"
40 ElseBody: "else" Exp . "end"
"==" shift, and go to state 36
"!=" shift, and go to state 37
@@ -3295,7 +3305,7 @@ state 140
29 | Exp . "<=" Exp
30 | Exp . ">=" Exp
31 | Exp . "contains" Exp
40 ElseBody: "elif" Exp . "then" Exp ElseBody
39 ElseBody: "elif" Exp . "then" Exp ElseBody
"==" shift, and go to state 36
"!=" shift, and go to state 37
@@ -3325,15 +3335,15 @@ state 140
state 141
42 ExpD: ExpD . '|' ExpD
42 | ExpD '|' ExpD .
41 ExpD: ExpD . '|' ExpD
41 | ExpD '|' ExpD .
$default reduce using rule 42 (ExpD)
$default reduce using rule 41 (ExpD)
state 142
42 ExpD: ExpD . '|' ExpD
41 ExpD: ExpD . '|' ExpD
69 MkDictPair: '(' error ')' ':' ExpD .
'|' shift, and go to state 134
@@ -3343,7 +3353,7 @@ state 142
state 143
42 ExpD: ExpD . '|' ExpD
41 ExpD: ExpD . '|' ExpD
68 MkDictPair: '(' Exp ')' ':' ExpD .
'|' shift, and go to state 134
@@ -3429,7 +3439,7 @@ state 145
29 | Exp . "<=" Exp
30 | Exp . ">=" Exp
31 | Exp . "contains" Exp
36 FuncDef: "def" IDENT '(' IDENT ')' ':' Exp . ';'
35 FuncDef: "def" IDENT '(' IDENT ')' ':' Exp . ';'
"==" shift, and go to state 36
"!=" shift, and go to state 37
@@ -3459,14 +3469,14 @@ state 145
state 146
41 ElseBody: "else" Exp "end" .
40 ElseBody: "else" Exp "end" .
$default reduce using rule 41 (ElseBody)
$default reduce using rule 40 (ElseBody)
state 147
40 ElseBody: "elif" Exp "then" . Exp ElseBody
39 ElseBody: "elif" Exp "then" . Exp ElseBody
IDENT shift, and go to state 1
LITERAL shift, and go to state 2
@@ -3487,9 +3497,9 @@ state 147
state 148
36 FuncDef: "def" IDENT '(' IDENT ')' ':' Exp ';' .
35 FuncDef: "def" IDENT '(' IDENT ')' ':' Exp ';' .
$default reduce using rule 36 (FuncDef)
$default reduce using rule 35 (FuncDef)
state 149
@@ -3517,7 +3527,7 @@ state 149
29 | Exp . "<=" Exp
30 | Exp . ">=" Exp
31 | Exp . "contains" Exp
40 ElseBody: "elif" Exp "then" Exp . ElseBody
39 ElseBody: "elif" Exp "then" Exp . ElseBody
"==" shift, and go to state 36
"!=" shift, and go to state 37
@@ -3550,6 +3560,6 @@ state 149
state 150
40 ElseBody: "elif" Exp "then" Exp ElseBody .
39 ElseBody: "elif" Exp "then" Exp ElseBody .
$default reduce using rule 40 (ElseBody)
$default reduce using rule 39 (ElseBody)
+3 -4
View File
@@ -314,10 +314,6 @@ Exp "contains" Exp {
$$ = gen_binop($1, $3, CONTAINS);
} |
String {
$$ = $1;
} |
Term {
$$ = $1;
}
@@ -391,6 +387,9 @@ Term '[' ']' {
LITERAL {
$$ = gen_op_const(LOADK, $1);
} |
String {
$$ = $1;
} |
'(' Exp ')' {
$$ = $2;
} |