class implements list

This commit is contained in:
vadim 2017-12-22 12:58:37 +02:00
parent 940e551b0e
commit d235a58abc
2 changed files with 100 additions and 100 deletions

View File

@ -1371,12 +1371,12 @@ var yyPgo = [...]int{
9, 904, 903, 902, 896, 13, 48, 894, 889, 111,
98, 197, 887, 886, 883, 8, 882, 81, 43, 880,
55, 47, 877, 876, 875, 874, 867, 97, 866, 862,
861, 38, 860, 10, 4, 859, 857, 42, 32, 41,
2, 16, 856, 853, 851, 5, 775, 850, 670, 849,
28, 848, 847, 845, 90, 842, 31, 841, 839, 25,
29, 837, 835, 833, 24, 832, 819, 811, 549, 809,
18, 804, 802, 44, 86, 83, 801, 103, 1, 7,
798, 19, 793, 792, 790, 37, 12,
861, 860, 10, 4, 859, 857, 42, 32, 41, 2,
16, 856, 853, 851, 5, 775, 850, 670, 849, 28,
848, 847, 845, 90, 842, 31, 841, 839, 25, 29,
837, 835, 833, 24, 832, 819, 811, 549, 809, 18,
804, 802, 44, 86, 83, 801, 103, 1, 7, 798,
19, 793, 792, 38, 790, 37, 12,
}
var yyR1 = [...]int{
@ -1387,28 +1387,28 @@ var yyR1 = [...]int{
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 6,
6, 6, 6, 6, 6, 6, 7, 7, 117, 117,
90, 90, 9, 9, 9, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 86,
86, 15, 15, 17, 17, 125, 125, 100, 100, 99,
99, 108, 108, 16, 16, 19, 19, 18, 18, 94,
94, 118, 118, 21, 21, 21, 21, 21, 21, 10,
6, 6, 6, 6, 6, 6, 7, 7, 116, 116,
89, 89, 9, 9, 9, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 85,
85, 15, 15, 17, 17, 125, 125, 99, 99, 98,
98, 107, 107, 16, 16, 19, 19, 18, 18, 93,
93, 117, 117, 21, 21, 21, 21, 21, 21, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 92, 92, 91, 91, 29, 29, 107,
107, 30, 11, 1, 1, 2, 2, 12, 12, 87,
87, 4, 4, 13, 14, 32, 32, 123, 123, 71,
71, 26, 26, 26, 26, 25, 25, 27, 27, 28,
28, 103, 103, 103, 103, 104, 104, 104, 126, 126,
24, 24, 72, 72, 69, 69, 75, 75, 70, 70,
119, 119, 120, 120, 33, 33, 34, 34, 81, 81,
79, 79, 79, 80, 80, 115, 115, 116, 116, 35,
35, 98, 98, 37, 102, 102, 38, 38, 121, 121,
39, 39, 39, 39, 74, 74, 106, 106, 106, 105,
105, 40, 40, 41, 42, 42, 42, 42, 44, 44,
43, 122, 122, 82, 82, 83, 83, 84, 84, 85,
85, 85, 85, 85, 85, 101, 101, 45, 45, 93,
93, 73, 20, 95, 95, 46, 96, 96, 97, 97,
10, 10, 10, 91, 91, 90, 90, 29, 29, 106,
106, 30, 11, 1, 1, 2, 2, 12, 12, 86,
86, 4, 4, 13, 14, 32, 32, 122, 122, 123,
123, 26, 26, 26, 26, 25, 25, 27, 27, 28,
28, 102, 102, 102, 102, 103, 103, 103, 126, 126,
24, 24, 71, 71, 69, 69, 74, 74, 70, 70,
118, 118, 119, 119, 33, 33, 34, 34, 80, 80,
78, 78, 78, 79, 79, 114, 114, 115, 115, 35,
35, 97, 97, 37, 101, 101, 38, 38, 120, 120,
39, 39, 39, 39, 73, 73, 105, 105, 105, 104,
104, 40, 40, 41, 42, 42, 42, 42, 44, 44,
43, 121, 121, 81, 81, 82, 82, 83, 83, 84,
84, 84, 84, 84, 84, 100, 100, 45, 45, 92,
92, 72, 20, 94, 94, 46, 95, 95, 96, 96,
48, 47, 47, 36, 36, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
@ -1417,18 +1417,18 @@ var yyR1 = [...]int{
36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36, 36, 3,
3, 110, 110, 109, 109, 55, 55, 56, 56, 56,
56, 49, 49, 50, 50, 53, 53, 89, 89, 89,
114, 114, 60, 60, 60, 54, 54, 54, 54, 54,
3, 109, 109, 108, 108, 55, 55, 56, 56, 56,
56, 49, 49, 50, 50, 53, 53, 88, 88, 88,
113, 113, 60, 60, 60, 54, 54, 54, 54, 54,
54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
54, 61, 61, 61, 22, 22, 23, 23, 59, 62,
62, 62, 63, 63, 63, 64, 64, 64, 64, 64,
64, 31, 31, 31, 51, 51, 51, 65, 65, 66,
66, 66, 66, 66, 66, 57, 57, 57, 58, 58,
58, 113, 77, 77, 112, 112, 76, 76, 76, 76,
76, 76, 88, 88, 88, 88, 67, 67, 67, 67,
58, 112, 76, 76, 111, 111, 75, 75, 75, 75,
75, 75, 87, 87, 87, 87, 67, 67, 67, 67,
67, 67, 67, 68, 68, 68, 68, 52, 52, 52,
52, 52, 52, 52, 111, 111, 78,
52, 52, 52, 52, 110, 110, 77,
}
var yyR2 = [...]int{
@ -1484,21 +1484,21 @@ var yyR2 = [...]int{
}
var yyChk = [...]int{
-1000, -124, -117, -8, -10, -11, -12, -13, -14, 127,
-1000, -124, -116, -8, -10, -11, -12, -13, -14, 127,
154, 120, 114, 161, -69, -70, 97, 96, 99, 106,
110, 111, 115, 122, 76, 95, 90, -22, 124, 101,
103, 163, 116, 119, 112, 86, 113, -87, 128, 129,
130, -72, -75, -31, -36, -4, 83, -64, -65, -62,
103, 163, 116, 119, 112, 86, 113, -86, 128, 129,
130, -71, -74, -31, -36, -4, 83, -64, -65, -62,
134, 69, 71, 58, 59, 49, 50, 55, 57, 164,
-47, -52, 60, 61, 62, 63, 64, 65, 66, 82,
67, -54, 160, 13, 14, 16, 77, 78, -51, -61,
-56, -49, -59, -60, 70, 125, 126, 4, 5, 6,
7, 8, 84, 85, 141, 142, 156, 138, 139, 140,
155, 137, 149, 159, 88, 167, -9, -63, 135, 94,
-90, 157, 164, 157, -90, 161, 86, -17, -86, -108,
-90, 157, 113, 114, -18, -19, -94, -20, 86, -118,
-89, 157, 164, 157, -89, 161, 86, -17, -85, -107,
-89, 157, 113, 114, -18, -19, -93, -20, 86, -117,
164, -10, 113, 154, 164, 164, -23, -22, 76, -23,
-23, -98, -37, -51, -102, 113, -38, 88, -95, -46,
-23, -97, -37, -51, -101, 113, -38, 88, -94, -46,
-22, 163, 33, 34, 10, 12, 11, 35, 37, 36,
51, 49, 50, 52, 68, 53, 54, 47, 48, 40,
41, 38, 39, 43, 44, 45, 46, 42, 56, 30,
@ -1506,26 +1506,26 @@ var yyChk = [...]int{
128, -4, 86, 86, 86, 73, 74, 73, 75, 74,
17, 18, 19, 20, 29, 21, 22, 23, 24, 25,
26, 27, 28, 58, 59, 164, 69, 161, 133, 164,
-113, -112, -77, -76, -22, 37, 134, -22, -31, -61,
-112, -111, -76, -75, -22, 37, 134, -22, -31, -61,
164, -60, 76, 69, -31, -22, -22, -22, -22, -22,
-22, -22, -22, -22, -22, -22, -22, -53, 164, -22,
-89, 93, -88, -67, 88, 151, 152, -22, -22, -22,
-88, 93, -87, -67, 88, 151, 152, -22, -22, -22,
69, 153, 153, -50, -48, -49, -66, 128, -9, -51,
164, 164, -22, -22, 164, -22, -22, 93, 150, -88,
-88, 93, 161, -51, -115, 164, -115, 164, 157, -90,
165, -90, 163, 161, -117, 163, -15, -108, -90, 157,
163, 9, 157, 105, -90, -19, 163, 9, 17, -21,
164, 164, -22, -22, 164, -22, -22, 93, 150, -87,
-87, 93, 161, -51, -114, 164, -114, 164, 157, -89,
165, -89, 163, 161, -116, 163, -15, -107, -89, 157,
163, 9, 157, 105, -89, -19, 163, 9, 17, -21,
162, -10, -11, -12, -13, -14, 127, -22, 97, -3,
-96, -97, -22, -22, 163, 163, 163, 163, 9, 163,
-95, -96, -22, -22, 163, 163, 163, 163, 9, 163,
9, -3, 17, 163, 9, -22, -22, -22, -22, -22,
-22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
-22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
-22, -50, -22, 31, -22, -107, -30, -31, -22, -94,
-118, 163, 163, 86, 164, 86, -32, 131, 161, -123,
-22, -50, -22, 31, -22, -106, -30, -31, -22, -93,
-117, 163, 163, 86, 164, 86, -32, 131, 161, -122,
131, 164, -10, 164, 163, 31, -22, 37, -22, -22,
-22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
-22, -23, -22, -58, 86, 161, -51, -113, 166, 9,
15, -31, 164, -22, -113, 165, -23, 160, -67, -67,
-22, -23, -22, -58, 86, 161, -51, -112, 166, 9,
15, -31, 164, -22, -112, 165, -23, 160, -67, -67,
93, 69, 133, -22, 87, -31, 15, -23, -57, -7,
-51, 161, 86, -6, -5, 76, 77, 78, 79, 80,
81, 4, 5, 6, 7, 8, 10, 11, 12, 56,
@ -1535,47 +1535,47 @@ var yyChk = [...]int{
112, 113, 114, 115, 13, 14, 134, 106, 107, 108,
109, 110, 135, 136, 131, 132, 154, 129, 130, 128,
137, 138, 140, 139, 141, 142, 156, 155, -57, -7,
-51, -114, -115, 153, 69, 161, 133, 153, -114, -111,
-78, -22, -22, -22, 150, 150, 159, -22, 165, -116,
-35, -22, 158, -113, 86, 163, -117, 162, 163, 163,
157, -90, -18, 157, -90, 161, 86, 157, -20, -22,
-51, -113, -114, 153, 69, 161, 133, 153, -113, -110,
-77, -22, -22, -22, 150, 150, 159, -22, 165, -115,
-35, -22, 158, -112, 86, 163, -116, 162, 163, 163,
157, -89, -18, 157, -89, 161, 86, 157, -20, -22,
164, 165, 164, 163, 9, 165, -37, -38, 164, -22,
-46, 31, -22, -125, 9, 105, 165, 162, 164, -119,
-120, -33, -34, -81, -79, 30, 135, 136, -9, -32,
-71, 132, -9, -121, 161, -74, -9, -22, -22, -118,
-22, 165, 166, 162, -115, -22, 165, 17, -77, -22,
37, 134, -113, 165, 166, 165, -68, 86, 89, 50,
88, 86, 162, 162, 69, 162, -22, 166, -115, -22,
-115, -51, -23, -22, -58, -51, -32, -125, 9, 165,
165, 162, -125, 9, -22, 165, 162, 161, 157, -100,
-16, -19, -86, 161, 165, -24, -10, 31, -22, -96,
-22, -103, 161, 31, -119, -22, 165, -30, -26, -31,
37, 134, 69, -28, -10, 31, -92, -119, 165, 9,
-1, 37, -79, -71, 161, -74, 162, -39, -82, -83,
120, -84, 123, -85, 81, 80, 79, 76, 77, 78,
-121, 9, 165, 165, 75, -10, 31, 162, 17, -22,
-31, 164, 165, 166, 89, -22, 162, 166, 162, -71,
165, -78, 165, -35, -99, -19, 161, -125, 9, -19,
-100, 163, -118, 165, 163, -104, 163, -104, 163, 165,
163, 165, 15, -31, 164, -113, -118, -29, 117, 118,
165, -110, 120, -33, -2, 158, 161, -121, -101, -45,
88, 114, 113, -74, -85, 162, -9, -10, 31, 163,
-118, -22, -113, 166, 161, -125, 9, -99, 162, -16,
-125, 98, 163, -96, 162, 108, 109, -104, 107, -104,
-110, -27, -10, 31, -26, -113, 166, 104, 164, 161,
-80, 31, -80, 164, 88, -121, 162, 163, 9, 17,
-93, -73, -7, -3, -106, 163, 161, -118, 165, 162,
-121, 162, -19, -125, 162, 163, 165, -22, -126, 31,
163, 162, 163, 107, -80, -118, 165, 165, 163, -91,
-9, -118, 161, -81, 161, -109, -55, 88, 37, 17,
162, -45, -22, 163, 9, 17, -7, 162, -105, -40,
-46, 31, -22, -125, 9, 105, 165, 162, 164, -118,
-119, -33, -34, -80, -78, 30, 135, 136, -9, -32,
-123, 132, -9, -120, 161, -73, -9, -22, -22, -117,
-22, 165, 166, 162, -114, -22, 165, 17, -76, -22,
37, 134, -112, 165, 166, 165, -68, 86, 89, 50,
88, 86, 162, 162, 69, 162, -22, 166, -114, -22,
-114, -51, -23, -22, -58, -51, -32, -125, 9, 165,
165, 162, -125, 9, -22, 165, 162, 161, 157, -99,
-16, -19, -85, 161, 165, -24, -10, 31, -22, -95,
-22, -102, 161, 31, -118, -22, 165, -30, -26, -31,
37, 134, 69, -28, -10, 31, -91, -118, 165, 9,
-1, 37, -78, -123, 161, -73, 162, -39, -81, -82,
120, -83, 123, -84, 81, 80, 79, 76, 77, 78,
-120, 9, 165, 165, 75, -10, 31, 162, 17, -22,
-31, 164, 165, 166, 89, -22, 162, 166, 162, -123,
165, -77, 165, -35, -98, -19, 161, -125, 9, -19,
-99, 163, -117, 165, 163, -103, 163, -103, 163, 165,
163, 165, 15, -31, 164, -112, -117, -29, 117, 118,
165, -109, 120, -33, -2, 158, 161, -120, -100, -45,
88, 114, 113, -73, -84, 162, -9, -10, 31, 163,
-117, -22, -112, 166, 161, -125, 9, -98, 162, -16,
-125, 98, 163, -95, 162, 108, 109, -103, 107, -103,
-109, -27, -10, 31, -26, -112, 166, 104, 164, 161,
-79, 31, -79, 164, 88, -120, 162, 163, 9, 17,
-92, -72, -7, -3, -105, 163, 161, -117, 165, 162,
-120, 162, -19, -125, 162, 163, 165, -22, -126, 31,
163, 162, 163, 107, -79, -117, 165, 165, 163, -90,
-9, -117, 161, -80, 161, -108, -55, 88, 37, 17,
162, -45, -22, 163, 9, 17, -7, 162, -104, -40,
-41, -42, -43, -44, -9, -7, 154, 86, 162, 162,
-25, -10, 31, -126, -118, 163, 161, 102, -27, 88,
35, 162, -118, -118, 165, 9, 88, -22, -73, -22,
164, 162, -40, 163, 163, 121, 105, 153, -118, -118,
-118, 163, 165, -9, 162, 162, -55, -119, -74, 86,
-5, -85, -7, 100, 162, 161, 165, -7, 163, -118,
-80, 162, -122, 163, 161, -118, 162,
-25, -10, 31, -126, -117, 163, 161, 102, -27, 88,
35, 162, -117, -117, 165, 9, 88, -22, -72, -22,
164, 162, -40, 163, 163, 121, 105, 153, -117, -117,
-117, 163, 165, -9, 162, 162, -55, -118, -73, 86,
-5, -84, -7, 100, 162, 161, 165, -7, 163, -117,
-79, 162, -121, 163, 161, -117, 162,
}
var yyDef = [...]int{
@ -3036,13 +3036,13 @@ yydefault:
yyDollar = yyS[yypt-8 : yypt+1]
//line parser/parser.y:455
{
yyVAL.node = stmt.NewClass(yyDollar[3].token, yyDollar[1].strings, nil, yyDollar[4].node, yyDollar[5].node.(node.SimpleNode).Children, yyDollar[7].list)
yyVAL.node = stmt.NewClass(yyDollar[3].token, yyDollar[1].strings, nil, yyDollar[4].node, yyDollar[5].list, yyDollar[7].list)
}
case 168:
yyDollar = yyS[yypt-7 : yypt+1]
//line parser/parser.y:457
{
yyVAL.node = stmt.NewClass(yyDollar[2].token, nil, nil, yyDollar[3].node, yyDollar[4].node.(node.SimpleNode).Children, yyDollar[6].list)
yyVAL.node = stmt.NewClass(yyDollar[2].token, nil, nil, yyDollar[3].node, yyDollar[4].list, yyDollar[6].list)
}
case 169:
yyDollar = yyS[yypt-1 : yypt+1]
@ -3108,13 +3108,13 @@ yydefault:
yyDollar = yyS[yypt-0 : yypt+1]
//line parser/parser.y:490
{
yyVAL.node = node.NewSimpleNode("TODO: must be nil")
yyVAL.list = nil
}
case 180:
yyDollar = yyS[yypt-2 : yypt+1]
//line parser/parser.y:491
{
yyVAL.node = yyDollar[2].node
yyVAL.list = yyDollar[2].node.(node.SimpleNode).Children
}
case 181:
yyDollar = yyS[yypt-1 : yypt+1]
@ -3778,7 +3778,7 @@ yydefault:
//line parser/parser.y:803
{
{
yyVAL.node = stmt.NewClass(yyDollar[1].token, nil, yyDollar[2].list, yyDollar[3].node, yyDollar[4].node.(node.SimpleNode).Children, yyDollar[6].list)
yyVAL.node = stmt.NewClass(yyDollar[1].token, nil, yyDollar[2].list, yyDollar[3].node, yyDollar[4].list, yyDollar[6].list)
}
}
case 291:

View File

@ -209,7 +209,7 @@ func Parse(src io.Reader, fName string) node.Node {
%type <node> encaps_var encaps_var_offset
%type <node> if_stmt
%type <node> alt_if_stmt
%type <node> implements_list if_stmt_without_else
%type <node> if_stmt_without_else
%type <node> class_const_decl name_list
%type <node> alt_if_stmt_without_else
%type <node> array_pair possible_array_pair
@ -227,7 +227,7 @@ func Parse(src io.Reader, fName string) node.Node {
%type <list> use_declarations lexical_var_list lexical_vars isset_variables non_empty_array_pair_list
%type <list> array_pair_list ctor_arguments argument_list non_empty_argument_list top_statement_list
%type <list> inner_statement_list parameter_list non_empty_parameter_list class_statement_list
%type <list> method_body interface_extends_list
%type <list> method_body interface_extends_list implements_list
%%
@ -452,9 +452,9 @@ is_variadic:
class_declaration_statement:
class_modifiers T_CLASS T_STRING extends_from implements_list '{' class_statement_list '}'
{ $$ = stmt.NewClass($3, $1, nil, $4, $5.(node.SimpleNode).Children, $7) }
{ $$ = stmt.NewClass($3, $1, nil, $4, $5, $7) }
| T_CLASS T_STRING extends_from implements_list '{' class_statement_list '}'
{ $$ = stmt.NewClass($2, nil, nil, $3, $4.(node.SimpleNode).Children, $6) }
{ $$ = stmt.NewClass($2, nil, nil, $3, $4, $6) }
;
class_modifiers:
@ -487,8 +487,8 @@ interface_extends_list:
;
implements_list:
/* empty */ { $$ = node.NewSimpleNode("TODO: must be nil"); }
| T_IMPLEMENTS name_list { $$ = $2; }
/* empty */ { $$ = nil }
| T_IMPLEMENTS name_list { $$ = $2.(node.SimpleNode).Children }
;
foreach_variable:
@ -801,7 +801,7 @@ non_empty_for_exprs:
anonymous_class:
T_CLASS ctor_arguments extends_from implements_list '{' class_statement_list '}'
{
{ $$ = stmt.NewClass($1, nil, $2, $3, $4.(node.SimpleNode).Children, $6) }
{ $$ = stmt.NewClass($1, nil, $2, $3, $4, $6) }
}
;