Some error handlers

master
Yevgen Muntyan 2006-03-08 03:12:18 -06:00
parent 13e72f4c98
commit d2372b5238
3 changed files with 340 additions and 293 deletions

View File

@ -194,7 +194,7 @@ ms_lex_parse_number (MSLex *lex,
{
if (value > 1000000)
{
g_print ("syntax error, number is too big\n", G_STRLOC);
g_print ("syntax error, number is too big\n");
return ms_lex_error (parser);
}
@ -203,7 +203,7 @@ ms_lex_parse_number (MSLex *lex,
}
else if (IS_WORD (c))
{
g_print ("syntax error, number followed by word char\n", G_STRLOC);
g_print ("syntax error, number followed by word char\n");
return ms_lex_error (parser);
}
else

View File

@ -669,18 +669,18 @@ union yyalloc
#endif
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 47
#define YYFINAL 52
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 651
#define YYLAST 713
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 49
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 16
/* YYNRULES -- Number of rules. */
#define YYNRULES 61
#define YYNRULES 66
/* YYNRULES -- Number of states. */
#define YYNSTATES 127
#define YYNSTATES 139
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
@ -728,26 +728,27 @@ static const unsigned char yytranslate[] =
YYRHS. */
static const unsigned char yyprhs[] =
{
0, 0, 3, 5, 7, 10, 13, 15, 16, 18,
20, 22, 24, 26, 28, 30, 33, 39, 44, 52,
58, 66, 68, 70, 72, 76, 83, 89, 95, 99,
103, 107, 111, 115, 119, 123, 127, 131, 135, 139,
143, 146, 149, 152, 156, 158, 160, 162, 166, 170,
174, 180, 185, 190, 194, 195, 197, 201, 202, 204,
208, 212
0, 0, 3, 5, 7, 10, 13, 16, 18, 19,
21, 23, 25, 27, 29, 31, 33, 36, 42, 47,
55, 61, 69, 71, 73, 75, 79, 86, 93, 99,
105, 109, 113, 117, 121, 125, 129, 133, 137, 141,
145, 149, 153, 156, 159, 162, 166, 168, 170, 172,
176, 180, 184, 188, 192, 196, 202, 207, 212, 216,
217, 219, 223, 224, 226, 230, 234
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yysigned_char yyrhs[] =
{
50, 0, -1, 51, -1, 52, -1, 51, 52, -1,
53, 37, -1, 6, -1, -1, 56, -1, 55, -1,
54, -1, 57, -1, 17, -1, 18, -1, 19, -1,
19, 56, -1, 12, 56, 13, 51, 14, -1, 13,
51, 12, 56, -1, 15, 64, 16, 56, 13, 51,
14, -1, 8, 56, 9, 51, 11, -1, 8, 56,
9, 51, 10, 51, 11, -1, 60, -1, 59, -1,
58, -1, 3, 38, 56, -1, 60, 39, 56, 40,
1, 37, -1, 53, 37, -1, 6, -1, -1, 56,
-1, 55, -1, 54, -1, 57, -1, 17, -1, 18,
-1, 19, -1, 19, 56, -1, 12, 56, 13, 51,
14, -1, 13, 51, 12, 56, -1, 15, 64, 16,
56, 13, 51, 14, -1, 8, 56, 9, 51, 11,
-1, 8, 56, 9, 51, 10, 51, 11, -1, 60,
-1, 59, -1, 58, -1, 3, 38, 56, -1, 60,
39, 56, 40, 38, 56, -1, 60, 39, 1, 40,
38, 56, -1, 60, 41, 3, 38, 56, -1, 60,
42, 60, 43, 60, -1, 56, 30, 56, -1, 56,
29, 56, -1, 56, 32, 56, -1, 56, 31, 56,
@ -756,24 +757,25 @@ static const yysigned_char yyrhs[] =
-1, 56, 35, 56, -1, 56, 22, 56, -1, 56,
23, 56, -1, 29, 60, -1, 26, 60, -1, 36,
60, -1, 60, 33, 60, -1, 7, -1, 4, -1,
64, -1, 44, 53, 45, -1, 39, 61, 40, -1,
46, 62, 47, -1, 39, 56, 28, 56, 40, -1,
60, 44, 61, 45, -1, 60, 39, 56, 40, -1,
60, 41, 3, -1, -1, 56, -1, 61, 48, 56,
-1, -1, 63, -1, 62, 48, 63, -1, 3, 38,
56, -1, 3, -1
64, -1, 44, 53, 45, -1, 44, 1, 45, -1,
39, 61, 40, -1, 39, 1, 40, -1, 46, 62,
47, -1, 46, 1, 47, -1, 39, 56, 28, 56,
40, -1, 60, 44, 61, 45, -1, 60, 39, 56,
40, -1, 60, 41, 3, -1, -1, 56, -1, 61,
48, 56, -1, -1, 63, -1, 62, 48, 63, -1,
3, 38, 56, -1, 3, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const unsigned short int yyrline[] =
{
0, 401, 401, 404, 405, 409, 410, 413, 414, 415,
416, 417, 418, 419, 420, 421, 424, 425, 426, 430,
431, 434, 435, 436, 440, 441, 442, 445, 449, 450,
451, 452, 454, 455, 457, 458, 459, 460, 461, 462,
463, 464, 465, 466, 470, 471, 472, 473, 474, 475,
476, 477, 478, 479, 482, 483, 484, 487, 488, 489,
492, 495
0, 401, 401, 404, 405, 409, 410, 411, 414, 415,
416, 417, 418, 419, 420, 421, 422, 425, 426, 427,
431, 432, 435, 436, 437, 441, 442, 443, 444, 447,
451, 452, 453, 454, 456, 457, 459, 460, 461, 462,
463, 464, 465, 466, 467, 468, 472, 473, 474, 475,
476, 477, 478, 479, 480, 481, 482, 483, 484, 487,
488, 489, 492, 493, 494, 497, 500
};
#endif
@ -810,25 +812,25 @@ static const unsigned short int yytoknum[] =
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const unsigned char yyr1[] =
{
0, 49, 50, 51, 51, 52, 52, 53, 53, 53,
53, 53, 53, 53, 53, 53, 54, 54, 54, 55,
55, 56, 56, 56, 57, 57, 57, 58, 59, 59,
0, 49, 50, 51, 51, 52, 52, 52, 53, 53,
53, 53, 53, 53, 53, 53, 53, 54, 54, 54,
55, 55, 56, 56, 56, 57, 57, 57, 57, 58,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 61, 61, 61, 62, 62, 62,
63, 64
59, 59, 59, 59, 59, 59, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 61,
61, 61, 62, 62, 62, 63, 64
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const unsigned char yyr2[] =
{
0, 2, 1, 1, 2, 2, 1, 0, 1, 1,
1, 1, 1, 1, 1, 2, 5, 4, 7, 5,
7, 1, 1, 1, 3, 6, 5, 5, 3, 3,
0, 2, 1, 1, 2, 2, 2, 1, 0, 1,
1, 1, 1, 1, 1, 1, 2, 5, 4, 7,
5, 7, 1, 1, 1, 3, 6, 6, 5, 5,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2, 2, 2, 3, 1, 1, 1, 3, 3, 3,
5, 4, 4, 3, 0, 1, 3, 0, 1, 3,
3, 1
3, 3, 2, 2, 2, 3, 1, 1, 1, 3,
3, 3, 3, 3, 3, 5, 4, 4, 3, 0,
1, 3, 0, 1, 3, 3, 1
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@ -836,217 +838,232 @@ static const unsigned char yyr2[] =
means the default is an error. */
static const unsigned char yydefact[] =
{
7, 61, 45, 6, 44, 0, 0, 7, 0, 12,
13, 14, 0, 0, 0, 54, 7, 57, 0, 2,
3, 0, 10, 9, 8, 11, 23, 22, 21, 46,
0, 61, 0, 21, 0, 7, 0, 15, 41, 40,
42, 55, 0, 0, 0, 0, 58, 1, 4, 5,
0, 0, 66, 47, 7, 46, 0, 0, 0, 0,
13, 14, 15, 0, 0, 0, 0, 0, 0, 0,
0, 3, 0, 11, 10, 9, 12, 24, 23, 22,
48, 5, 0, 66, 0, 22, 0, 0, 0, 16,
43, 42, 44, 0, 60, 0, 0, 0, 0, 0,
0, 63, 1, 4, 6, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 54, 24, 7, 0,
0, 7, 0, 0, 0, 48, 0, 47, 0, 49,
0, 34, 35, 38, 39, 32, 33, 29, 28, 31,
30, 36, 37, 43, 0, 53, 0, 55, 0, 7,
0, 53, 7, 17, 0, 0, 56, 60, 59, 52,
0, 0, 51, 7, 19, 52, 16, 7, 50, 0,
26, 27, 7, 7, 25, 20, 18
0, 59, 25, 0, 0, 0, 0, 0, 0, 52,
0, 51, 0, 50, 49, 54, 0, 53, 0, 36,
37, 40, 41, 34, 35, 31, 30, 33, 32, 38,
39, 45, 0, 0, 58, 0, 60, 0, 0, 0,
58, 0, 18, 0, 0, 61, 65, 64, 0, 57,
0, 0, 56, 0, 20, 57, 17, 0, 55, 0,
0, 28, 29, 0, 0, 27, 26, 21, 19
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yysigned_char yydefgoto[] =
{
-1, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 33, 42, 45, 46, 29
-1, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 35, 45, 50, 51, 30
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -40
#define YYPACT_NINF -36
static const short int yypact[] =
{
347, -34, -40, -40, -40, 14, 14, 347, 12, -40,
-40, 14, 111, 111, 111, 14, 421, 17, 24, 171,
-40, 8, -40, -40, 584, -40, -40, -40, -10, -40,
14, -40, 449, -3, 469, 391, 32, 584, -36, -36,
-36, 568, -39, 4, 18, -37, -40, -40, -40, -40,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 111, 14, 52, 111, 14, 584, 347, 14,
54, 347, 14, 14, 14, -40, 14, -40, 14, -40,
17, 1, 1, 1, 1, -40, 35, 600, 600, 616,
616, 1, 1, -36, 505, 23, 3, 584, 6, 127,
526, -40, 215, 469, 489, 547, 584, 584, -40, 26,
14, 111, -40, 347, -40, -40, -40, 347, -40, 14,
584, -36, 259, 303, 584, -40, -40
374, -35, -31, -36, -36, -36, 483, 483, 374, 22,
-36, -36, 483, 15, 15, 15, 2, 462, 9, 11,
154, -36, -10, -36, -36, 646, -36, -36, -36, 135,
-36, -36, 483, -36, 511, 145, 531, 418, 18, 646,
19, 19, 19, -4, 630, -24, -5, -2, 6, 24,
-15, -36, -36, -36, -36, 483, 483, 483, 483, 483,
483, 483, 483, 483, 483, 483, 483, 15, 103, 61,
15, 483, 646, 374, 483, 62, 374, 483, 483, -36,
483, -36, 483, -36, -36, -36, 483, -36, 65, 20,
20, 20, 20, -36, 47, 662, 662, 678, 678, 20,
20, 19, 32, 567, 36, 8, 646, -22, 198, 588,
-36, 242, 531, 551, 609, 646, 646, -36, 37, 39,
483, 15, -36, 374, -36, -36, -36, 374, -36, 483,
483, 646, 19, 286, 330, 646, 646, -36, -36
};
/* YYPGOTO[NTERM-NUM]. */
static const yysigned_char yypgoto[] =
{
-40, -40, -5, -13, 51, -40, -40, 22, -40, -40,
-40, 0, 21, -40, -11, 62
-36, -36, -7, -16, 73, -36, -36, 23, -36, -36,
-36, 0, 25, -36, 5, 89
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -8
static const yysigned_char yytable[] =
#define YYTABLE_NINF -63
static const short int yytable[] =
{
28, 75, 35, 69, 30, 70, 48, 28, 66, 76,
79, 80, 38, 39, 40, 31, 28, 31, 2, 28,
44, 4, 48, 62, 47, 54, 55, 32, 34, 63,
62, 64, 65, 37, 66, 28, 69, 41, 70, 65,
12, 66, 69, 13, 70, 49, 111, 66, 73, 77,
14, 112, 67, 15, 76, 95, 78, 101, 16, 54,
17, 110, 93, 99, 119, 96, 102, 43, 28, 108,
36, 28, 81, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 0, 94, 48, 98, 97, 48,
0, 100, 0, 0, 103, 104, 105, 0, 106, 28,
107, 0, 28, 0, 0, 0, 0, 0, 122, 48,
48, 121, 123, 28, 31, 2, 0, 28, 4, 0,
0, 0, 28, 28, 0, 0, 0, 0, 0, 0,
1, 2, 120, 3, 4, 5, 0, 113, 114, 6,
7, 124, 8, 0, 9, 10, 11, 0, 0, 0,
15, 0, 0, 12, 0, 16, 13, 17, 0, 0,
0, 0, 0, 14, 0, 0, 15, 0, 0, 0,
0, 16, 0, 17, 1, 2, 0, 3, 4, 5,
0, 0, 0, 6, 7, 0, 8, 0, 9, 10,
11, 0, 0, 0, 0, 0, 0, 12, 0, 0,
13, 0, 0, 0, 0, 0, 0, 14, -7, 0,
15, 0, 0, 0, 0, 16, 0, 17, 1, 2,
0, 3, 4, 5, 0, 0, 0, 6, 7, 116,
8, 0, 9, 10, 11, 0, 0, 0, 0, 0,
0, 12, 0, 0, 13, 0, 0, 0, 0, 0,
0, 14, 0, 0, 15, 0, 0, 0, 0, 16,
0, 17, 1, 2, 0, 3, 4, 5, 0, 0,
125, 6, 7, 0, 8, 0, 9, 10, 11, 0,
0, 0, 0, 0, 0, 12, 0, 0, 13, 0,
0, 0, 0, 0, 0, 14, 0, 0, 15, 0,
0, 0, 0, 16, 0, 17, 1, 2, 0, 3,
4, 5, 0, 0, 0, 6, 7, 126, 8, 0,
9, 10, 11, 0, 0, 0, 0, 0, 0, 12,
0, 0, 13, 0, 0, 0, 0, 0, 0, 14,
0, 0, 15, 0, 0, 0, 0, 16, 0, 17,
1, 2, 0, 3, 4, 5, 0, 0, 0, 6,
7, 0, 8, 0, 9, 10, 11, 0, 0, 0,
0, 0, 0, 12, 0, 0, 13, 0, 0, 0,
0, 0, 0, 14, 0, 0, 15, 0, 0, 0,
0, 16, 0, 17, 1, 2, 0, 3, 4, 5,
0, 0, 0, 72, 7, 0, 8, 0, 9, 10,
11, 0, 0, 0, 0, 0, 0, 12, 0, 0,
13, 0, 0, 0, 1, 2, 0, 14, 4, 5,
15, 0, 0, 6, 7, 16, 8, 17, 9, 10,
11, 0, 0, 0, 0, 0, 0, 12, 0, 0,
13, 0, 0, 0, 0, 0, 0, 14, 68, 0,
15, 0, 0, 0, 0, 16, 0, 17, 0, 50,
51, 52, 53, 54, 55, 0, 0, 0, 56, 57,
58, 59, 71, 60, 61, 0, 0, 0, 0, 50,
51, 52, 53, 54, 55, 0, 0, 0, 56, 57,
58, 59, 117, 60, 61, 0, 0, 0, 0, 50,
51, 52, 53, 54, 55, 0, 0, 0, 56, 57,
58, 59, 0, 60, 61, 50, 51, 52, 53, 54,
55, 0, 0, 0, 56, 57, 58, 59, 0, 60,
61, 0, 0, 0, 0, 109, 50, 51, 52, 53,
54, 55, 0, 0, 0, 56, 57, 58, 59, 0,
60, 61, 0, 0, 0, 0, 115, 50, 51, 52,
53, 54, 55, 0, 0, 0, 56, 57, 58, 59,
0, 60, 61, 0, 0, 0, 0, 118, 50, 51,
52, 53, 54, 55, 0, 0, 74, 56, 57, 58,
59, 0, 60, 61, 50, 51, 52, 53, 54, 55,
0, 0, 0, 56, 57, 58, 59, 0, 60, 61,
50, 51, 52, 53, 54, 55, 0, 0, 0, 0,
0, 58, 59, 0, 60, 61, 50, 51, 52, 53,
54, 55, 0, 0, 0, 0, 0, 0, 0, 0,
60, 61
29, 37, 31, 43, 53, 33, 3, 32, 29, 5,
48, 52, 49, 40, 41, 42, 81, 29, 33, 3,
29, 53, 5, 122, 82, 33, 82, 54, 13, 34,
36, 14, 87, 88, 78, 39, 79, 29, 15, 44,
83, 16, -59, 84, 59, 60, 17, 74, 18, 75,
-59, 121, 71, 85, 16, 72, -62, -62, 74, 17,
75, 18, 86, 71, 104, 110, 108, 101, 49, 111,
105, 59, 118, 29, 120, 129, 29, 130, 89, 90,
91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
47, 103, 53, 117, 106, 53, 107, 109, 38, 0,
112, 113, 0, 114, 102, 115, 33, 3, 29, 116,
5, 29, 0, 0, 0, 0, 133, 53, 53, 0,
134, 132, 0, 29, 0, 0, 0, 29, 0, 13,
0, 0, 14, 29, 29, 0, 0, 0, 0, 15,
0, 0, 16, 131, 0, 0, 0, 17, 0, 18,
0, 0, 135, 136, -2, 1, 0, 2, 3, 0,
4, 5, 6, 0, 0, 0, 7, 8, 67, 9,
0, 10, 11, 12, 68, 0, 69, 70, 67, 71,
13, 0, 0, 14, 74, 0, 75, 70, 0, 71,
15, -8, 0, 16, 0, 0, 0, 0, 17, 1,
18, 2, 3, 0, 4, 5, 6, 0, 123, 124,
7, 8, 0, 9, 0, 10, 11, 12, 0, 0,
0, 0, 0, 0, 13, 0, 0, 14, 0, 0,
0, 0, 0, 0, 15, -8, 0, 16, 0, 0,
0, 0, 17, 1, 18, 2, 3, 0, 4, 5,
6, 0, 0, 0, 7, 8, 126, 9, 0, 10,
11, 12, 0, 0, 0, 0, 0, 0, 13, 0,
0, 14, 0, 0, 0, 0, 0, 0, 15, -8,
0, 16, 0, 0, 0, 0, 17, 1, 18, 2,
3, 0, 4, 5, 6, 0, 0, 137, 7, 8,
0, 9, 0, 10, 11, 12, 0, 0, 0, 0,
0, 0, 13, 0, 0, 14, 0, 0, 0, 0,
0, 0, 15, -8, 0, 16, 0, 0, 0, 0,
17, 1, 18, 2, 3, 0, 4, 5, 6, 0,
0, 0, 7, 8, 138, 9, 0, 10, 11, 12,
0, 0, 0, 0, 0, 0, 13, 0, 0, 14,
0, 0, 0, 0, 0, 0, 15, -8, 0, 16,
0, 0, 0, 0, 17, 1, 18, 2, 3, 0,
4, 5, 6, 0, 0, 0, 7, 8, 0, 9,
0, 10, 11, 12, 0, 0, 0, 0, 0, 0,
13, 0, 0, 14, 0, 0, 0, 0, 0, 0,
15, -8, 0, 16, 0, 0, 0, 0, 17, 1,
18, 2, 3, 0, 4, 5, 6, 0, 0, 0,
77, 8, 0, 9, 0, 10, 11, 12, 0, 0,
0, 0, 0, 0, 13, 0, 0, 14, 0, 0,
0, 0, 0, 0, 15, -8, 0, 16, 0, 0,
0, 0, 17, 46, 18, 2, 3, 0, 0, 5,
6, 0, 0, 0, 7, 8, 0, 9, 0, 10,
11, 12, 0, 0, 0, 0, 33, 3, 13, 0,
5, 14, 0, 0, 0, 0, 0, 0, 15, 0,
0, 16, 0, 0, 0, 0, 17, -8, 18, 13,
0, 0, 14, 0, 0, 0, 0, 0, 0, 15,
73, 0, 16, 0, 0, 0, 0, 17, 0, 18,
0, 55, 56, 57, 58, 59, 60, 0, 0, 0,
61, 62, 63, 64, 76, 65, 66, 0, 0, 0,
0, 55, 56, 57, 58, 59, 60, 0, 0, 0,
61, 62, 63, 64, 127, 65, 66, 0, 0, 0,
0, 55, 56, 57, 58, 59, 60, 0, 0, 0,
61, 62, 63, 64, 0, 65, 66, 55, 56, 57,
58, 59, 60, 0, 0, 0, 61, 62, 63, 64,
0, 65, 66, 0, 0, 0, 0, 119, 55, 56,
57, 58, 59, 60, 0, 0, 0, 61, 62, 63,
64, 0, 65, 66, 0, 0, 0, 0, 125, 55,
56, 57, 58, 59, 60, 0, 0, 0, 61, 62,
63, 64, 0, 65, 66, 0, 0, 0, 0, 128,
55, 56, 57, 58, 59, 60, 0, 0, 80, 61,
62, 63, 64, 0, 65, 66, 55, 56, 57, 58,
59, 60, 0, 0, 0, 61, 62, 63, 64, 0,
65, 66, 55, 56, 57, 58, 59, 60, 0, 0,
0, 0, 0, 63, 64, 0, 65, 66, 55, 56,
57, 58, 59, 60, 0, 0, 0, 0, 0, 0,
0, 0, 65, 66
};
static const yysigned_char yycheck[] =
static const short int yycheck[] =
{
0, 40, 7, 39, 38, 41, 19, 7, 44, 48,
47, 48, 12, 13, 14, 3, 16, 3, 4, 19,
3, 7, 35, 33, 0, 24, 25, 5, 6, 39,
33, 41, 42, 11, 44, 35, 39, 15, 41, 42,
26, 44, 39, 29, 41, 37, 43, 44, 16, 45,
36, 45, 30, 39, 48, 3, 38, 3, 44, 24,
46, 38, 62, 68, 38, 65, 71, 16, 68, 80,
8, 71, 50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 60, 61, -1, 63, 99, 66, 66, 102,
-1, 69, -1, -1, 72, 73, 74, -1, 76, 99,
78, -1, 102, -1, -1, -1, -1, -1, 113, 122,
123, 111, 117, 113, 3, 4, -1, 117, 7, -1,
-1, -1, 122, 123, -1, -1, -1, -1, -1, -1,
3, 4, 110, 6, 7, 8, -1, 10, 11, 12,
13, 119, 15, -1, 17, 18, 19, -1, -1, -1,
39, -1, -1, 26, -1, 44, 29, 46, -1, -1,
-1, -1, -1, 36, -1, -1, 39, -1, -1, -1,
-1, 44, -1, 46, 3, 4, -1, 6, 7, 8,
-1, -1, -1, 12, 13, -1, 15, -1, 17, 18,
19, -1, -1, -1, -1, -1, -1, 26, -1, -1,
29, -1, -1, -1, -1, -1, -1, 36, 37, -1,
39, -1, -1, -1, -1, 44, -1, 46, 3, 4,
-1, 6, 7, 8, -1, -1, -1, 12, 13, 14,
15, -1, 17, 18, 19, -1, -1, -1, -1, -1,
-1, 26, -1, -1, 29, -1, -1, -1, -1, -1,
-1, 36, -1, -1, 39, -1, -1, -1, -1, 44,
-1, 46, 3, 4, -1, 6, 7, 8, -1, -1,
11, 12, 13, -1, 15, -1, 17, 18, 19, -1,
-1, -1, -1, -1, -1, 26, -1, -1, 29, -1,
-1, -1, -1, -1, -1, 36, -1, -1, 39, -1,
-1, -1, -1, 44, -1, 46, 3, 4, -1, 6,
7, 8, -1, -1, -1, 12, 13, 14, 15, -1,
17, 18, 19, -1, -1, -1, -1, -1, -1, 26,
0, 8, 37, 1, 20, 3, 4, 38, 8, 7,
1, 0, 3, 13, 14, 15, 40, 17, 3, 4,
20, 37, 7, 45, 48, 3, 48, 37, 26, 6,
7, 29, 47, 48, 16, 12, 40, 37, 36, 16,
45, 39, 40, 45, 24, 25, 44, 39, 46, 41,
48, 43, 44, 47, 39, 32, 47, 48, 39, 44,
41, 46, 38, 44, 3, 3, 73, 67, 3, 76,
70, 24, 40, 73, 38, 38, 76, 38, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
17, 68, 108, 88, 71, 111, 71, 74, 9, -1,
77, 78, -1, 80, 1, 82, 3, 4, 108, 86,
7, 111, -1, -1, -1, -1, 123, 133, 134, -1,
127, 121, -1, 123, -1, -1, -1, 127, -1, 26,
-1, -1, 29, 133, 134, -1, -1, -1, -1, 36,
-1, -1, 39, 120, -1, -1, -1, 44, -1, 46,
-1, -1, 129, 130, 0, 1, -1, 3, 4, -1,
6, 7, 8, -1, -1, -1, 12, 13, 33, 15,
-1, 17, 18, 19, 39, -1, 41, 42, 33, 44,
26, -1, -1, 29, 39, -1, 41, 42, -1, 44,
36, 37, -1, 39, -1, -1, -1, -1, 44, 1,
46, 3, 4, -1, 6, 7, 8, -1, 10, 11,
12, 13, -1, 15, -1, 17, 18, 19, -1, -1,
-1, -1, -1, -1, 26, -1, -1, 29, -1, -1,
-1, -1, -1, -1, 36, 37, -1, 39, -1, -1,
-1, -1, 44, 1, 46, 3, 4, -1, 6, 7,
8, -1, -1, -1, 12, 13, 14, 15, -1, 17,
18, 19, -1, -1, -1, -1, -1, -1, 26, -1,
-1, 29, -1, -1, -1, -1, -1, -1, 36, 37,
-1, 39, -1, -1, -1, -1, 44, 1, 46, 3,
4, -1, 6, 7, 8, -1, -1, 11, 12, 13,
-1, 15, -1, 17, 18, 19, -1, -1, -1, -1,
-1, -1, 26, -1, -1, 29, -1, -1, -1, -1,
-1, -1, 36, 37, -1, 39, -1, -1, -1, -1,
44, 1, 46, 3, 4, -1, 6, 7, 8, -1,
-1, -1, 12, 13, 14, 15, -1, 17, 18, 19,
-1, -1, -1, -1, -1, -1, 26, -1, -1, 29,
-1, -1, -1, -1, -1, -1, 36, 37, -1, 39,
-1, -1, -1, -1, 44, 1, 46, 3, 4, -1,
6, 7, 8, -1, -1, -1, 12, 13, -1, 15,
-1, 17, 18, 19, -1, -1, -1, -1, -1, -1,
26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
36, 37, -1, 39, -1, -1, -1, -1, 44, 1,
46, 3, 4, -1, 6, 7, 8, -1, -1, -1,
12, 13, -1, 15, -1, 17, 18, 19, -1, -1,
-1, -1, -1, -1, 26, -1, -1, 29, -1, -1,
-1, -1, -1, -1, 36, 37, -1, 39, -1, -1,
-1, -1, 44, 1, 46, 3, 4, -1, -1, 7,
8, -1, -1, -1, 12, 13, -1, 15, -1, 17,
18, 19, -1, -1, -1, -1, 3, 4, 26, -1,
7, 29, -1, -1, -1, -1, -1, -1, 36, -1,
-1, 39, -1, -1, -1, -1, 44, 45, 46, 26,
-1, -1, 29, -1, -1, -1, -1, -1, -1, 36,
-1, -1, 39, -1, -1, -1, -1, 44, -1, 46,
3, 4, -1, 6, 7, 8, -1, -1, -1, 12,
13, -1, 15, -1, 17, 18, 19, -1, -1, -1,
-1, -1, -1, 26, -1, -1, 29, -1, -1, -1,
-1, -1, -1, 36, -1, -1, 39, -1, -1, -1,
-1, 44, -1, 46, 3, 4, -1, 6, 7, 8,
-1, -1, -1, 12, 13, -1, 15, -1, 17, 18,
19, -1, -1, -1, -1, -1, -1, 26, -1, -1,
29, -1, -1, -1, 3, 4, -1, 36, 7, 8,
39, -1, -1, 12, 13, 44, 15, 46, 17, 18,
19, -1, -1, -1, -1, -1, -1, 26, -1, -1,
29, -1, -1, -1, -1, -1, -1, 36, 9, -1,
39, -1, -1, -1, -1, 44, -1, 46, -1, 20,
21, 22, 23, 24, 25, -1, -1, -1, 29, 30,
31, 32, 13, 34, 35, -1, -1, -1, -1, 20,
21, 22, 23, 24, 25, -1, -1, -1, 29, 30,
31, 32, 13, 34, 35, -1, -1, -1, -1, 20,
21, 22, 23, 24, 25, -1, -1, -1, 29, 30,
31, 32, -1, 34, 35, 20, 21, 22, 23, 24,
25, -1, -1, -1, 29, 30, 31, 32, -1, 34,
35, -1, -1, -1, -1, 40, 20, 21, 22, 23,
24, 25, -1, -1, -1, 29, 30, 31, 32, -1,
34, 35, -1, -1, -1, -1, 40, 20, 21, 22,
9, -1, 39, -1, -1, -1, -1, 44, -1, 46,
-1, 20, 21, 22, 23, 24, 25, -1, -1, -1,
29, 30, 31, 32, 13, 34, 35, -1, -1, -1,
-1, 20, 21, 22, 23, 24, 25, -1, -1, -1,
29, 30, 31, 32, 13, 34, 35, -1, -1, -1,
-1, 20, 21, 22, 23, 24, 25, -1, -1, -1,
29, 30, 31, 32, -1, 34, 35, 20, 21, 22,
23, 24, 25, -1, -1, -1, 29, 30, 31, 32,
-1, 34, 35, -1, -1, -1, -1, 40, 20, 21,
22, 23, 24, 25, -1, -1, 28, 29, 30, 31,
32, -1, 34, 35, 20, 21, 22, 23, 24, 25,
-1, -1, -1, 29, 30, 31, 32, -1, 34, 35,
20, 21, 22, 23, 24, 25, -1, -1, -1, -1,
-1, 31, 32, -1, 34, 35, 20, 21, 22, 23,
24, 25, -1, -1, -1, -1, -1, -1, -1, -1,
34, 35
22, 23, 24, 25, -1, -1, -1, 29, 30, 31,
32, -1, 34, 35, -1, -1, -1, -1, 40, 20,
21, 22, 23, 24, 25, -1, -1, -1, 29, 30,
31, 32, -1, 34, 35, -1, -1, -1, -1, 40,
20, 21, 22, 23, 24, 25, -1, -1, 28, 29,
30, 31, 32, -1, 34, 35, 20, 21, 22, 23,
24, 25, -1, -1, -1, 29, 30, 31, 32, -1,
34, 35, 20, 21, 22, 23, 24, 25, -1, -1,
-1, -1, -1, 31, 32, -1, 34, 35, 20, 21,
22, 23, 24, 25, -1, -1, -1, -1, -1, -1,
-1, -1, 34, 35
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const unsigned char yystos[] =
{
0, 3, 4, 6, 7, 8, 12, 13, 15, 17,
18, 19, 26, 29, 36, 39, 44, 46, 50, 51,
52, 53, 54, 55, 56, 57, 58, 59, 60, 64,
38, 3, 56, 60, 56, 51, 64, 56, 60, 60,
60, 56, 61, 53, 3, 62, 63, 0, 52, 37,
20, 21, 22, 23, 24, 25, 29, 30, 31, 32,
34, 35, 33, 39, 41, 42, 44, 56, 9, 39,
41, 13, 12, 16, 28, 40, 48, 45, 38, 47,
48, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 60, 56, 3, 60, 56, 61, 51,
56, 3, 51, 56, 56, 56, 56, 56, 63, 40,
0, 1, 3, 4, 6, 7, 8, 12, 13, 15,
17, 18, 19, 26, 29, 36, 39, 44, 46, 50,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
64, 37, 38, 3, 56, 60, 56, 51, 64, 56,
60, 60, 60, 1, 56, 61, 1, 53, 1, 3,
62, 63, 0, 52, 37, 20, 21, 22, 23, 24,
25, 29, 30, 31, 32, 34, 35, 33, 39, 41,
42, 44, 56, 9, 39, 41, 13, 12, 16, 40,
28, 40, 48, 45, 45, 47, 38, 47, 48, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 60, 1, 56, 3, 60, 56, 61, 51, 56,
3, 51, 56, 56, 56, 56, 56, 63, 40, 40,
38, 43, 45, 10, 11, 40, 14, 13, 40, 38,
56, 60, 51, 51, 56, 11, 14
38, 56, 60, 51, 51, 56, 56, 11, 14
};
#define yyerrok (yyerrstatus = 0)
@ -1732,246 +1749,271 @@ yyreduce:
case 5:
#line 409 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = (yyvsp[-1].node); ;}
{ (yyval.node) = NULL; ;}
break;
case 6:
#line 410 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_python (parser, (yyvsp[0].str)); ;}
{ (yyval.node) = (yyvsp[-1].node); ;}
break;
case 7:
#line 413 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = NULL; ;}
#line 411 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_python (parser, (yyvsp[0].str)); ;}
break;
case 12:
#line 418 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_continue (parser); ;}
case 8:
#line 414 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = NULL; ;}
break;
case 13:
#line 419 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_break (parser); ;}
{ (yyval.node) = node_continue (parser); ;}
break;
case 14:
#line 420 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_return (parser, NULL); ;}
{ (yyval.node) = node_break (parser); ;}
break;
case 15:
#line 421 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_return (parser, (yyvsp[0].node)); ;}
{ (yyval.node) = node_return (parser, NULL); ;}
break;
case 16:
#line 424 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_while (parser, MS_COND_BEFORE, (yyvsp[-3].node), (yyvsp[-1].node)); ;}
#line 422 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_return (parser, (yyvsp[0].node)); ;}
break;
case 17:
#line 425 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_while (parser, MS_COND_AFTER, (yyvsp[0].node), (yyvsp[-2].node)); ;}
{ (yyval.node) = node_while (parser, MS_COND_BEFORE, (yyvsp[-3].node), (yyvsp[-1].node)); ;}
break;
case 18:
#line 426 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_for (parser, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].node)); ;}
{ (yyval.node) = node_while (parser, MS_COND_AFTER, (yyvsp[0].node), (yyvsp[-2].node)); ;}
break;
case 19:
#line 430 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_if_else (parser, (yyvsp[-3].node), (yyvsp[-1].node), NULL); ;}
#line 427 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_for (parser, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].node)); ;}
break;
case 20:
#line 431 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_if_else (parser, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].node)); ;}
{ (yyval.node) = node_if_else (parser, (yyvsp[-3].node), (yyvsp[-1].node), NULL); ;}
break;
case 24:
#line 440 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_assignment (parser, (yyvsp[-2].str), (yyvsp[0].node)); ;}
case 21:
#line 432 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_if_else (parser, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].node)); ;}
break;
case 25:
#line 441 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_list_assign (parser, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[0].node)); ;}
{ (yyval.node) = node_assignment (parser, (yyvsp[-2].str), (yyvsp[0].node)); ;}
break;
case 26:
#line 442 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_dict_assign (parser, (yyvsp[-4].node), (yyvsp[-2].str), (yyvsp[0].node)); ;}
{ (yyval.node) = node_list_assign (parser, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[0].node)); ;}
break;
case 27:
#line 445 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_if_else (parser, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); ;}
#line 443 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = NULL; ;}
break;
case 28:
#line 449 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_PLUS, (yyvsp[-2].node), (yyvsp[0].node)); ;}
#line 444 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_dict_assign (parser, (yyvsp[-4].node), (yyvsp[-2].str), (yyvsp[0].node)); ;}
break;
case 29:
#line 450 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_MINUS, (yyvsp[-2].node), (yyvsp[0].node)); ;}
#line 447 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_if_else (parser, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 30:
#line 451 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_DIV, (yyvsp[-2].node), (yyvsp[0].node)); ;}
{ (yyval.node) = node_binary_op (parser, MS_OP_PLUS, (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 31:
#line 452 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_MULT, (yyvsp[-2].node), (yyvsp[0].node)); ;}
{ (yyval.node) = node_binary_op (parser, MS_OP_MINUS, (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 32:
#line 454 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_AND, (yyvsp[-2].node), (yyvsp[0].node)); ;}
#line 453 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_DIV, (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 33:
#line 455 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_OR, (yyvsp[-2].node), (yyvsp[0].node)); ;}
#line 454 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_MULT, (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 34:
#line 457 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_EQ, (yyvsp[-2].node), (yyvsp[0].node)); ;}
#line 456 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_AND, (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 35:
#line 458 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_NEQ, (yyvsp[-2].node), (yyvsp[0].node)); ;}
#line 457 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_OR, (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 36:
#line 459 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_LT, (yyvsp[-2].node), (yyvsp[0].node)); ;}
{ (yyval.node) = node_binary_op (parser, MS_OP_EQ, (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 37:
#line 460 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_GT, (yyvsp[-2].node), (yyvsp[0].node)); ;}
{ (yyval.node) = node_binary_op (parser, MS_OP_NEQ, (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 38:
#line 461 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_LE, (yyvsp[-2].node), (yyvsp[0].node)); ;}
{ (yyval.node) = node_binary_op (parser, MS_OP_LT, (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 39:
#line 462 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_GE, (yyvsp[-2].node), (yyvsp[0].node)); ;}
{ (yyval.node) = node_binary_op (parser, MS_OP_GT, (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 40:
#line 463 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_unary_op (parser, MS_OP_UMINUS, (yyvsp[0].node)); ;}
{ (yyval.node) = node_binary_op (parser, MS_OP_LE, (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 41:
#line 464 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_unary_op (parser, MS_OP_NOT, (yyvsp[0].node)); ;}
{ (yyval.node) = node_binary_op (parser, MS_OP_GE, (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 42:
#line 465 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_unary_op (parser, MS_OP_LEN, (yyvsp[0].node)); ;}
{ (yyval.node) = node_unary_op (parser, MS_OP_UMINUS, (yyvsp[0].node)); ;}
break;
case 43:
#line 466 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_FORMAT, (yyvsp[-2].node), (yyvsp[0].node)); ;}
{ (yyval.node) = node_unary_op (parser, MS_OP_NOT, (yyvsp[0].node)); ;}
break;
case 44:
#line 470 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_int (parser, (yyvsp[0].ival)); ;}
#line 467 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_unary_op (parser, MS_OP_LEN, (yyvsp[0].node)); ;}
break;
case 45:
#line 471 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_string (parser, (yyvsp[0].str)); ;}
#line 468 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_binary_op (parser, MS_OP_FORMAT, (yyvsp[-2].node), (yyvsp[0].node)); ;}
break;
case 46:
#line 472 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_int (parser, (yyvsp[0].ival)); ;}
break;
case 47:
#line 473 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = (yyvsp[-1].node); ;}
break;
case 48:
#line 474 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_value_list (parser, MS_NODE_LIST ((yyvsp[-1].node))); ;}
{ (yyval.node) = node_string (parser, (yyvsp[0].str)); ;}
break;
case 49:
#line 475 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_dict (parser, (yyvsp[-1].node) ? MS_NODE_LIST ((yyvsp[-1].node)) : NULL); ;}
{ (yyval.node) = (yyvsp[-1].node); ;}
break;
case 50:
#line 476 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_value_range (parser, (yyvsp[-3].node), (yyvsp[-1].node)); ;}
{ (yyval.node) = NULL; ;}
break;
case 51:
#line 477 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_function (parser, (yyvsp[-3].node), (yyvsp[-1].node) ? MS_NODE_LIST ((yyvsp[-1].node)) : NULL); ;}
{ (yyval.node) = node_value_list (parser, MS_NODE_LIST ((yyvsp[-1].node))); ;}
break;
case 52:
#line 478 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_list_elm (parser, (yyvsp[-3].node), (yyvsp[-1].node)); ;}
{ (yyval.node) = NULL; ;}
break;
case 53:
#line 479 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_dict_elm (parser, (yyvsp[-2].node), (yyvsp[0].str)); ;}
{ (yyval.node) = node_dict (parser, (yyvsp[-1].node) ? MS_NODE_LIST ((yyvsp[-1].node)) : NULL); ;}
break;
case 54:
#line 482 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
#line 480 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = NULL; ;}
break;
case 55:
#line 483 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_list_add (parser, NULL, (yyvsp[0].node)); ;}
#line 481 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_value_range (parser, (yyvsp[-3].node), (yyvsp[-1].node)); ;}
break;
case 56:
#line 484 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_list_add (parser, MS_NODE_LIST ((yyvsp[-2].node)), (yyvsp[0].node)); ;}
#line 482 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_function (parser, (yyvsp[-3].node), (yyvsp[-1].node) ? MS_NODE_LIST ((yyvsp[-1].node)) : NULL); ;}
break;
case 57:
#line 483 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_list_elm (parser, (yyvsp[-3].node), (yyvsp[-1].node)); ;}
break;
case 58:
#line 484 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_dict_elm (parser, (yyvsp[-2].node), (yyvsp[0].str)); ;}
break;
case 59:
#line 487 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = NULL; ;}
break;
case 58:
case 60:
#line 488 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_list_add (parser, NULL, (yyvsp[0].node)); ;}
break;
case 59:
case 61:
#line 489 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_list_add (parser, MS_NODE_LIST ((yyvsp[-2].node)), (yyvsp[0].node)); ;}
break;
case 60:
case 62:
#line 492 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = NULL; ;}
break;
case 63:
#line 493 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_list_add (parser, NULL, (yyvsp[0].node)); ;}
break;
case 64:
#line 494 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_list_add (parser, MS_NODE_LIST ((yyvsp[-2].node)), (yyvsp[0].node)); ;}
break;
case 65:
#line 497 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_dict_entry (parser, (yyvsp[-2].str), (yyvsp[0].node)); ;}
break;
case 61:
#line 495 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
case 66:
#line 500 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
{ (yyval.node) = node_var (parser, (yyvsp[0].str)); ;}
break;
@ -1980,7 +2022,7 @@ yyreduce:
}
/* Line 1126 of yacc.c. */
#line 1984 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.c"
#line 2026 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.c"
yyvsp -= yylen;
yyssp -= yylen;
@ -2248,6 +2290,6 @@ yyreturn:
}
#line 498 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"
#line 503 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y"

View File

@ -406,7 +406,8 @@ program: stmt_or_python { $$ = node_list_add (parser, NULL, $1); }
;
stmt_or_python:
stmt ';' { $$ = $1; }
error ';' { $$ = NULL; }
| stmt ';' { $$ = $1; }
| PYTHON { $$ = node_python (parser, $1); }
;
@ -439,6 +440,7 @@ expr: simple_expr
assignment:
IDENTIFIER '=' expr { $$ = node_assignment (parser, $1, $3); }
| simple_expr '[' expr ']' '=' expr { $$ = node_list_assign (parser, $1, $3, $6); }
| simple_expr '[' error ']' '=' expr { $$ = NULL; }
| simple_expr '.' IDENTIFIER '=' expr { $$ = node_dict_assign (parser, $1, $3, $5); }
;
@ -471,8 +473,11 @@ simple_expr:
| LITERAL { $$ = node_string (parser, $1); }
| variable
| '(' stmt ')' { $$ = $2; }
| '(' error ')' { $$ = NULL; }
| '[' list_elms ']' { $$ = node_value_list (parser, MS_NODE_LIST ($2)); }
| '[' error ']' { $$ = NULL; }
| '{' dict_elms '}' { $$ = node_dict (parser, $2 ? MS_NODE_LIST ($2) : NULL); }
| '{' error '}' { $$ = NULL; }
| '[' expr TWODOTS expr ']' { $$ = node_value_range (parser, $2, $4); }
| simple_expr '(' list_elms ')' { $$ = node_function (parser, $1, $3 ? MS_NODE_LIST ($3) : NULL); }
| simple_expr '[' expr ']' { $$ = node_list_elm (parser, $1, $3); }