modifiers list
This commit is contained in:
parent
d235a58abc
commit
ba71b6e7fa
@ -34,9 +34,9 @@ func (n ClassMethod) Print(out io.Writer, indent string) {
|
|||||||
fmt.Fprintf(out, "\n%v%v [%d %d] %q", indent, n.Name, n.token.StartLine, n.token.EndLine, n.token.Value)
|
fmt.Fprintf(out, "\n%v%v [%d %d] %q", indent, n.Name, n.token.StartLine, n.token.EndLine, n.token.Value)
|
||||||
|
|
||||||
if n.modifiers != nil {
|
if n.modifiers != nil {
|
||||||
fmt.Fprintf(out, "\n%vmotifiers:", indent+" ")
|
fmt.Fprintf(out, "\n%vmodifiers:", indent+" ")
|
||||||
for _, nn := range n.modifiers {
|
for _, nn := range n.modifiers {
|
||||||
fmt.Fprintf(out, "\n%v%q", indent+" ", nn)
|
nn.Print(out, indent+" ")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,11 +9,11 @@ import (
|
|||||||
|
|
||||||
type PropertyList struct {
|
type PropertyList struct {
|
||||||
node.SimpleNode
|
node.SimpleNode
|
||||||
modifiers node.Node
|
modifiers []node.Node
|
||||||
properties []node.Node
|
properties []node.Node
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPropertyList(modifiers node.Node, properties []node.Node) node.Node {
|
func NewPropertyList(modifiers []node.Node, properties []node.Node) node.Node {
|
||||||
return PropertyList{
|
return PropertyList{
|
||||||
node.SimpleNode{Name: "PropertyList", Attributes: make(map[string]string)},
|
node.SimpleNode{Name: "PropertyList", Attributes: make(map[string]string)},
|
||||||
modifiers,
|
modifiers,
|
||||||
@ -26,7 +26,9 @@ func (n PropertyList) Print(out io.Writer, indent string) {
|
|||||||
|
|
||||||
if n.modifiers != nil {
|
if n.modifiers != nil {
|
||||||
fmt.Fprintf(out, "\n%vmodifiers:", indent+" ")
|
fmt.Fprintf(out, "\n%vmodifiers:", indent+" ")
|
||||||
n.modifiers.Print(out, indent+" ")
|
for _, nn := range n.modifiers {
|
||||||
|
nn.Print(out, indent+" ")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if n.properties != nil {
|
if n.properties != nil {
|
||||||
|
212
parser/parser.go
212
parser/parser.go
@ -604,13 +604,13 @@ var yyAct = [...]int{
|
|||||||
807, 197, 199, 198, 332, 607, 795, 610, 608, 308,
|
807, 197, 199, 198, 332, 607, 795, 610, 608, 308,
|
||||||
766, 718, 669, 279, 280, 642, 817, 633, 628, 785,
|
766, 718, 669, 279, 280, 642, 817, 633, 628, 785,
|
||||||
229, 564, 812, 824, 810, 825, 554, 118, 231, 409,
|
229, 564, 812, 824, 810, 825, 554, 118, 231, 409,
|
||||||
1, 831, 379, 912, 659, 544, 255, 256, 570, 803,
|
1, 831, 681, 678, 659, 544, 255, 256, 679, 803,
|
||||||
842, 529, 221, 830, 519, 813, 578, 846, 833, 835,
|
842, 379, 912, 830, 570, 813, 578, 846, 833, 529,
|
||||||
855, 365, 841, 687, 688, 689, 686, 685, 684, 804,
|
855, 221, 841, 687, 688, 689, 686, 685, 684, 519,
|
||||||
864, 854, 167, 168, 161, 162, 160, 163, 165, 166,
|
864, 854, 167, 168, 161, 162, 160, 163, 165, 166,
|
||||||
863, 178, 848, 651, 872, 144, 873, 748, 868, 141,
|
863, 178, 835, 365, 872, 804, 873, 848, 868, 651,
|
||||||
877, 321, 148, 164, 861, 800, 879, 666, 829, 250,
|
877, 144, 748, 164, 861, 141, 879, 321, 148, 800,
|
||||||
37, 681, 855, 679, 782, 878, 678, 223, 882, 42,
|
666, 829, 855, 250, 782, 878, 37, 223, 882, 42,
|
||||||
41, 15, 14, 854, 888, 889, 606, 266, 890, 87,
|
41, 15, 14, 854, 888, 889, 606, 266, 890, 87,
|
||||||
88, 89, 90, 91, 48, 47, 107, 49, 73, 74,
|
88, 89, 90, 91, 48, 47, 107, 49, 73, 74,
|
||||||
82, 75, 80, 71, 896, 893, 247, 61, 897, 264,
|
82, 75, 80, 71, 896, 893, 247, 61, 897, 264,
|
||||||
@ -1372,11 +1372,11 @@ var yyPgo = [...]int{
|
|||||||
98, 197, 887, 886, 883, 8, 882, 81, 43, 880,
|
98, 197, 887, 886, 883, 8, 882, 81, 43, 880,
|
||||||
55, 47, 877, 876, 875, 874, 867, 97, 866, 862,
|
55, 47, 877, 876, 875, 874, 867, 97, 866, 862,
|
||||||
861, 860, 10, 4, 859, 857, 42, 32, 41, 2,
|
861, 860, 10, 4, 859, 857, 42, 32, 41, 2,
|
||||||
16, 856, 853, 851, 5, 775, 850, 670, 849, 28,
|
16, 5, 775, 856, 670, 853, 28, 851, 850, 849,
|
||||||
848, 847, 845, 90, 842, 31, 841, 839, 25, 29,
|
90, 848, 31, 847, 845, 25, 29, 842, 841, 839,
|
||||||
837, 835, 833, 24, 832, 819, 811, 549, 809, 18,
|
24, 837, 835, 833, 549, 832, 18, 819, 811, 44,
|
||||||
804, 802, 44, 86, 83, 801, 103, 1, 7, 798,
|
86, 83, 809, 103, 1, 7, 804, 19, 802, 801,
|
||||||
19, 793, 792, 38, 790, 37, 12,
|
38, 798, 793, 792, 790, 37, 12,
|
||||||
}
|
}
|
||||||
var yyR1 = [...]int{
|
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, 5,
|
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
||||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 6,
|
5, 5, 5, 5, 5, 5, 5, 5, 5, 6,
|
||||||
6, 6, 6, 6, 6, 6, 7, 7, 116, 116,
|
6, 6, 6, 6, 6, 6, 7, 7, 113, 113,
|
||||||
89, 89, 9, 9, 9, 8, 8, 8, 8, 8,
|
86, 86, 9, 9, 9, 8, 8, 8, 8, 8,
|
||||||
8, 8, 8, 8, 8, 8, 8, 8, 8, 85,
|
8, 8, 8, 8, 8, 8, 8, 8, 8, 82,
|
||||||
85, 15, 15, 17, 17, 125, 125, 99, 99, 98,
|
82, 15, 15, 17, 17, 125, 125, 96, 96, 95,
|
||||||
98, 107, 107, 16, 16, 19, 19, 18, 18, 93,
|
95, 104, 104, 16, 16, 19, 19, 18, 18, 90,
|
||||||
93, 117, 117, 21, 21, 21, 21, 21, 21, 10,
|
90, 114, 114, 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, 10, 10, 10, 10, 10, 10, 10,
|
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
|
||||||
10, 10, 10, 91, 91, 90, 90, 29, 29, 106,
|
10, 10, 10, 88, 88, 87, 87, 29, 29, 103,
|
||||||
106, 30, 11, 1, 1, 2, 2, 12, 12, 86,
|
103, 30, 11, 1, 1, 2, 2, 12, 12, 83,
|
||||||
86, 4, 4, 13, 14, 32, 32, 122, 122, 123,
|
83, 4, 4, 13, 14, 32, 32, 119, 119, 120,
|
||||||
123, 26, 26, 26, 26, 25, 25, 27, 27, 28,
|
120, 26, 26, 26, 26, 25, 25, 27, 27, 28,
|
||||||
28, 102, 102, 102, 102, 103, 103, 103, 126, 126,
|
28, 99, 99, 99, 99, 100, 100, 100, 126, 126,
|
||||||
24, 24, 71, 71, 69, 69, 74, 74, 70, 70,
|
24, 24, 71, 71, 69, 69, 74, 74, 70, 70,
|
||||||
118, 118, 119, 119, 33, 33, 34, 34, 80, 80,
|
115, 115, 116, 116, 33, 33, 34, 34, 80, 80,
|
||||||
78, 78, 78, 79, 79, 114, 114, 115, 115, 35,
|
78, 78, 78, 79, 79, 111, 111, 112, 112, 35,
|
||||||
35, 97, 97, 37, 101, 101, 38, 38, 120, 120,
|
35, 94, 94, 37, 98, 98, 38, 38, 117, 117,
|
||||||
39, 39, 39, 39, 73, 73, 105, 105, 105, 104,
|
39, 39, 39, 39, 73, 73, 102, 102, 102, 101,
|
||||||
104, 40, 40, 41, 42, 42, 42, 42, 44, 44,
|
101, 40, 40, 41, 42, 42, 42, 42, 44, 44,
|
||||||
43, 121, 121, 81, 81, 82, 82, 83, 83, 84,
|
43, 118, 118, 122, 122, 121, 121, 123, 123, 81,
|
||||||
84, 84, 84, 84, 84, 100, 100, 45, 45, 92,
|
81, 81, 81, 81, 81, 97, 97, 45, 45, 89,
|
||||||
92, 72, 20, 94, 94, 46, 95, 95, 96, 96,
|
89, 72, 20, 91, 91, 46, 92, 92, 93, 93,
|
||||||
48, 47, 47, 36, 36, 36, 36, 36, 36, 36,
|
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,
|
||||||
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, 36,
|
36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
|
||||||
36, 36, 36, 36, 36, 36, 36, 36, 36, 3,
|
36, 36, 36, 36, 36, 36, 36, 36, 36, 3,
|
||||||
3, 109, 109, 108, 108, 55, 55, 56, 56, 56,
|
3, 106, 106, 105, 105, 55, 55, 56, 56, 56,
|
||||||
56, 49, 49, 50, 50, 53, 53, 88, 88, 88,
|
56, 49, 49, 50, 50, 53, 53, 85, 85, 85,
|
||||||
113, 113, 60, 60, 60, 54, 54, 54, 54, 54,
|
110, 110, 60, 60, 60, 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, 61, 61, 61, 22, 22, 23, 23, 59, 62,
|
54, 61, 61, 61, 22, 22, 23, 23, 59, 62,
|
||||||
62, 62, 63, 63, 63, 64, 64, 64, 64, 64,
|
62, 62, 63, 63, 63, 64, 64, 64, 64, 64,
|
||||||
64, 31, 31, 31, 51, 51, 51, 65, 65, 66,
|
64, 31, 31, 31, 51, 51, 51, 65, 65, 66,
|
||||||
66, 66, 66, 66, 66, 57, 57, 57, 58, 58,
|
66, 66, 66, 66, 66, 57, 57, 57, 58, 58,
|
||||||
58, 112, 76, 76, 111, 111, 75, 75, 75, 75,
|
58, 109, 76, 76, 108, 108, 75, 75, 75, 75,
|
||||||
75, 75, 87, 87, 87, 87, 67, 67, 67, 67,
|
75, 75, 84, 84, 84, 84, 67, 67, 67, 67,
|
||||||
67, 67, 67, 68, 68, 68, 68, 52, 52, 52,
|
67, 67, 67, 68, 68, 68, 68, 52, 52, 52,
|
||||||
52, 52, 52, 52, 110, 110, 77,
|
52, 52, 52, 52, 107, 107, 77,
|
||||||
}
|
}
|
||||||
var yyR2 = [...]int{
|
var yyR2 = [...]int{
|
||||||
|
|
||||||
@ -1484,10 +1484,10 @@ var yyR2 = [...]int{
|
|||||||
}
|
}
|
||||||
var yyChk = [...]int{
|
var yyChk = [...]int{
|
||||||
|
|
||||||
-1000, -124, -116, -8, -10, -11, -12, -13, -14, 127,
|
-1000, -124, -113, -8, -10, -11, -12, -13, -14, 127,
|
||||||
154, 120, 114, 161, -69, -70, 97, 96, 99, 106,
|
154, 120, 114, 161, -69, -70, 97, 96, 99, 106,
|
||||||
110, 111, 115, 122, 76, 95, 90, -22, 124, 101,
|
110, 111, 115, 122, 76, 95, 90, -22, 124, 101,
|
||||||
103, 163, 116, 119, 112, 86, 113, -86, 128, 129,
|
103, 163, 116, 119, 112, 86, 113, -83, 128, 129,
|
||||||
130, -71, -74, -31, -36, -4, 83, -64, -65, -62,
|
130, -71, -74, -31, -36, -4, 83, -64, -65, -62,
|
||||||
134, 69, 71, 58, 59, 49, 50, 55, 57, 164,
|
134, 69, 71, 58, 59, 49, 50, 55, 57, 164,
|
||||||
-47, -52, 60, 61, 62, 63, 64, 65, 66, 82,
|
-47, -52, 60, 61, 62, 63, 64, 65, 66, 82,
|
||||||
@ -1495,10 +1495,10 @@ var yyChk = [...]int{
|
|||||||
-56, -49, -59, -60, 70, 125, 126, 4, 5, 6,
|
-56, -49, -59, -60, 70, 125, 126, 4, 5, 6,
|
||||||
7, 8, 84, 85, 141, 142, 156, 138, 139, 140,
|
7, 8, 84, 85, 141, 142, 156, 138, 139, 140,
|
||||||
155, 137, 149, 159, 88, 167, -9, -63, 135, 94,
|
155, 137, 149, 159, 88, 167, -9, -63, 135, 94,
|
||||||
-89, 157, 164, 157, -89, 161, 86, -17, -85, -107,
|
-86, 157, 164, 157, -86, 161, 86, -17, -82, -104,
|
||||||
-89, 157, 113, 114, -18, -19, -93, -20, 86, -117,
|
-86, 157, 113, 114, -18, -19, -90, -20, 86, -114,
|
||||||
164, -10, 113, 154, 164, 164, -23, -22, 76, -23,
|
164, -10, 113, 154, 164, 164, -23, -22, 76, -23,
|
||||||
-23, -97, -37, -51, -101, 113, -38, 88, -94, -46,
|
-23, -94, -37, -51, -98, 113, -38, 88, -91, -46,
|
||||||
-22, 163, 33, 34, 10, 12, 11, 35, 37, 36,
|
-22, 163, 33, 34, 10, 12, 11, 35, 37, 36,
|
||||||
51, 49, 50, 52, 68, 53, 54, 47, 48, 40,
|
51, 49, 50, 52, 68, 53, 54, 47, 48, 40,
|
||||||
41, 38, 39, 43, 44, 45, 46, 42, 56, 30,
|
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,
|
128, -4, 86, 86, 86, 73, 74, 73, 75, 74,
|
||||||
17, 18, 19, 20, 29, 21, 22, 23, 24, 25,
|
17, 18, 19, 20, 29, 21, 22, 23, 24, 25,
|
||||||
26, 27, 28, 58, 59, 164, 69, 161, 133, 164,
|
26, 27, 28, 58, 59, 164, 69, 161, 133, 164,
|
||||||
-112, -111, -76, -75, -22, 37, 134, -22, -31, -61,
|
-109, -108, -76, -75, -22, 37, 134, -22, -31, -61,
|
||||||
164, -60, 76, 69, -31, -22, -22, -22, -22, -22,
|
164, -60, 76, 69, -31, -22, -22, -22, -22, -22,
|
||||||
-22, -22, -22, -22, -22, -22, -22, -53, 164, -22,
|
-22, -22, -22, -22, -22, -22, -22, -53, 164, -22,
|
||||||
-88, 93, -87, -67, 88, 151, 152, -22, -22, -22,
|
-85, 93, -84, -67, 88, 151, 152, -22, -22, -22,
|
||||||
69, 153, 153, -50, -48, -49, -66, 128, -9, -51,
|
69, 153, 153, -50, -48, -49, -66, 128, -9, -51,
|
||||||
164, 164, -22, -22, 164, -22, -22, 93, 150, -87,
|
164, 164, -22, -22, 164, -22, -22, 93, 150, -84,
|
||||||
-87, 93, 161, -51, -114, 164, -114, 164, 157, -89,
|
-84, 93, 161, -51, -111, 164, -111, 164, 157, -86,
|
||||||
165, -89, 163, 161, -116, 163, -15, -107, -89, 157,
|
165, -86, 163, 161, -113, 163, -15, -104, -86, 157,
|
||||||
163, 9, 157, 105, -89, -19, 163, 9, 17, -21,
|
163, 9, 157, 105, -86, -19, 163, 9, 17, -21,
|
||||||
162, -10, -11, -12, -13, -14, 127, -22, 97, -3,
|
162, -10, -11, -12, -13, -14, 127, -22, 97, -3,
|
||||||
-95, -96, -22, -22, 163, 163, 163, 163, 9, 163,
|
-92, -93, -22, -22, 163, 163, 163, 163, 9, 163,
|
||||||
9, -3, 17, 163, 9, -22, -22, -22, -22, -22,
|
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, -22, -22, -22, -22, -22, -22, -22, -22, -22,
|
-22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
|
||||||
-22, -50, -22, 31, -22, -106, -30, -31, -22, -93,
|
-22, -50, -22, 31, -22, -103, -30, -31, -22, -90,
|
||||||
-117, 163, 163, 86, 164, 86, -32, 131, 161, -122,
|
-114, 163, 163, 86, 164, 86, -32, 131, 161, -119,
|
||||||
131, 164, -10, 164, 163, 31, -22, 37, -22, -22,
|
131, 164, -10, 164, 163, 31, -22, 37, -22, -22,
|
||||||
-22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
|
-22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
|
||||||
-22, -23, -22, -58, 86, 161, -51, -112, 166, 9,
|
-22, -23, -22, -58, 86, 161, -51, -109, 166, 9,
|
||||||
15, -31, 164, -22, -112, 165, -23, 160, -67, -67,
|
15, -31, 164, -22, -109, 165, -23, 160, -67, -67,
|
||||||
93, 69, 133, -22, 87, -31, 15, -23, -57, -7,
|
93, 69, 133, -22, 87, -31, 15, -23, -57, -7,
|
||||||
-51, 161, 86, -6, -5, 76, 77, 78, 79, 80,
|
-51, 161, 86, -6, -5, 76, 77, 78, 79, 80,
|
||||||
81, 4, 5, 6, 7, 8, 10, 11, 12, 56,
|
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,
|
112, 113, 114, 115, 13, 14, 134, 106, 107, 108,
|
||||||
109, 110, 135, 136, 131, 132, 154, 129, 130, 128,
|
109, 110, 135, 136, 131, 132, 154, 129, 130, 128,
|
||||||
137, 138, 140, 139, 141, 142, 156, 155, -57, -7,
|
137, 138, 140, 139, 141, 142, 156, 155, -57, -7,
|
||||||
-51, -113, -114, 153, 69, 161, 133, 153, -113, -110,
|
-51, -110, -111, 153, 69, 161, 133, 153, -110, -107,
|
||||||
-77, -22, -22, -22, 150, 150, 159, -22, 165, -115,
|
-77, -22, -22, -22, 150, 150, 159, -22, 165, -112,
|
||||||
-35, -22, 158, -112, 86, 163, -116, 162, 163, 163,
|
-35, -22, 158, -109, 86, 163, -113, 162, 163, 163,
|
||||||
157, -89, -18, 157, -89, 161, 86, 157, -20, -22,
|
157, -86, -18, 157, -86, 161, 86, 157, -20, -22,
|
||||||
164, 165, 164, 163, 9, 165, -37, -38, 164, -22,
|
164, 165, 164, 163, 9, 165, -37, -38, 164, -22,
|
||||||
-46, 31, -22, -125, 9, 105, 165, 162, 164, -118,
|
-46, 31, -22, -125, 9, 105, 165, 162, 164, -115,
|
||||||
-119, -33, -34, -80, -78, 30, 135, 136, -9, -32,
|
-116, -33, -34, -80, -78, 30, 135, 136, -9, -32,
|
||||||
-123, 132, -9, -120, 161, -73, -9, -22, -22, -117,
|
-120, 132, -9, -117, 161, -73, -9, -22, -22, -114,
|
||||||
-22, 165, 166, 162, -114, -22, 165, 17, -76, -22,
|
-22, 165, 166, 162, -111, -22, 165, 17, -76, -22,
|
||||||
37, 134, -112, 165, 166, 165, -68, 86, 89, 50,
|
37, 134, -109, 165, 166, 165, -68, 86, 89, 50,
|
||||||
88, 86, 162, 162, 69, 162, -22, 166, -114, -22,
|
88, 86, 162, 162, 69, 162, -22, 166, -111, -22,
|
||||||
-114, -51, -23, -22, -58, -51, -32, -125, 9, 165,
|
-111, -51, -23, -22, -58, -51, -32, -125, 9, 165,
|
||||||
165, 162, -125, 9, -22, 165, 162, 161, 157, -99,
|
165, 162, -125, 9, -22, 165, 162, 161, 157, -96,
|
||||||
-16, -19, -85, 161, 165, -24, -10, 31, -22, -95,
|
-16, -19, -82, 161, 165, -24, -10, 31, -22, -92,
|
||||||
-22, -102, 161, 31, -118, -22, 165, -30, -26, -31,
|
-22, -99, 161, 31, -115, -22, 165, -30, -26, -31,
|
||||||
37, 134, 69, -28, -10, 31, -91, -118, 165, 9,
|
37, 134, 69, -28, -10, 31, -88, -115, 165, 9,
|
||||||
-1, 37, -78, -123, 161, -73, 162, -39, -81, -82,
|
-1, 37, -78, -120, 161, -73, 162, -39, -122, -121,
|
||||||
120, -83, 123, -84, 81, 80, 79, 76, 77, 78,
|
120, -123, 123, -81, 81, 80, 79, 76, 77, 78,
|
||||||
-120, 9, 165, 165, 75, -10, 31, 162, 17, -22,
|
-117, 9, 165, 165, 75, -10, 31, 162, 17, -22,
|
||||||
-31, 164, 165, 166, 89, -22, 162, 166, 162, -123,
|
-31, 164, 165, 166, 89, -22, 162, 166, 162, -120,
|
||||||
165, -77, 165, -35, -98, -19, 161, -125, 9, -19,
|
165, -77, 165, -35, -95, -19, 161, -125, 9, -19,
|
||||||
-99, 163, -117, 165, 163, -103, 163, -103, 163, 165,
|
-96, 163, -114, 165, 163, -100, 163, -100, 163, 165,
|
||||||
163, 165, 15, -31, 164, -112, -117, -29, 117, 118,
|
163, 165, 15, -31, 164, -109, -114, -29, 117, 118,
|
||||||
165, -109, 120, -33, -2, 158, 161, -120, -100, -45,
|
165, -106, 120, -33, -2, 158, 161, -117, -97, -45,
|
||||||
88, 114, 113, -73, -84, 162, -9, -10, 31, 163,
|
88, 114, 113, -73, -81, 162, -9, -10, 31, 163,
|
||||||
-117, -22, -112, 166, 161, -125, 9, -98, 162, -16,
|
-114, -22, -109, 166, 161, -125, 9, -95, 162, -16,
|
||||||
-125, 98, 163, -95, 162, 108, 109, -103, 107, -103,
|
-125, 98, 163, -92, 162, 108, 109, -100, 107, -100,
|
||||||
-109, -27, -10, 31, -26, -112, 166, 104, 164, 161,
|
-106, -27, -10, 31, -26, -109, 166, 104, 164, 161,
|
||||||
-79, 31, -79, 164, 88, -120, 162, 163, 9, 17,
|
-79, 31, -79, 164, 88, -117, 162, 163, 9, 17,
|
||||||
-92, -72, -7, -3, -105, 163, 161, -117, 165, 162,
|
-89, -72, -7, -3, -102, 163, 161, -114, 165, 162,
|
||||||
-120, 162, -19, -125, 162, 163, 165, -22, -126, 31,
|
-117, 162, -19, -125, 162, 163, 165, -22, -126, 31,
|
||||||
163, 162, 163, 107, -79, -117, 165, 165, 163, -90,
|
163, 162, 163, 107, -79, -114, 165, 165, 163, -87,
|
||||||
-9, -117, 161, -80, 161, -108, -55, 88, 37, 17,
|
-9, -114, 161, -80, 161, -105, -55, 88, 37, 17,
|
||||||
162, -45, -22, 163, 9, 17, -7, 162, -104, -40,
|
162, -45, -22, 163, 9, 17, -7, 162, -101, -40,
|
||||||
-41, -42, -43, -44, -9, -7, 154, 86, 162, 162,
|
-41, -42, -43, -44, -9, -7, 154, 86, 162, 162,
|
||||||
-25, -10, 31, -126, -117, 163, 161, 102, -27, 88,
|
-25, -10, 31, -126, -114, 163, 161, 102, -27, 88,
|
||||||
35, 162, -117, -117, 165, 9, 88, -22, -72, -22,
|
35, 162, -114, -114, 165, 9, 88, -22, -72, -22,
|
||||||
164, 162, -40, 163, 163, 121, 105, 153, -117, -117,
|
164, 162, -40, 163, 163, 121, 105, 153, -114, -114,
|
||||||
-117, 163, 165, -9, 162, 162, -55, -118, -73, 86,
|
-114, 163, 165, -9, 162, 162, -55, -115, -73, 86,
|
||||||
-5, -84, -7, 100, 162, 161, 165, -7, 163, -117,
|
-5, -81, -7, 100, 162, 161, 165, -7, 163, -114,
|
||||||
-79, 162, -121, 163, 161, -117, 162,
|
-79, 162, -118, 163, 161, -114, 162,
|
||||||
}
|
}
|
||||||
var yyDef = [...]int{
|
var yyDef = [...]int{
|
||||||
|
|
||||||
@ -3476,13 +3476,13 @@ yydefault:
|
|||||||
yyDollar = yyS[yypt-3 : yypt+1]
|
yyDollar = yyS[yypt-3 : yypt+1]
|
||||||
//line parser/parser.y:675
|
//line parser/parser.y:675
|
||||||
{
|
{
|
||||||
yyVAL.node = stmt.NewPropertyList(yyDollar[1].node, yyDollar[2].list)
|
yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list)
|
||||||
}
|
}
|
||||||
case 241:
|
case 241:
|
||||||
yyDollar = yyS[yypt-4 : yypt+1]
|
yyDollar = yyS[yypt-4 : yypt+1]
|
||||||
//line parser/parser.y:676
|
//line parser/parser.y:676
|
||||||
{
|
{
|
||||||
yyVAL.node = stmt.NewClassConst(yyDollar[2].token, yyDollar[1].node.(node.SimpleNode).Children, yyDollar[3].list)
|
yyVAL.node = stmt.NewClassConst(yyDollar[2].token, yyDollar[1].list, yyDollar[3].list)
|
||||||
}
|
}
|
||||||
case 242:
|
case 242:
|
||||||
yyDollar = yyS[yypt-3 : yypt+1]
|
yyDollar = yyS[yypt-3 : yypt+1]
|
||||||
@ -3494,7 +3494,7 @@ yydefault:
|
|||||||
yyDollar = yyS[yypt-9 : yypt+1]
|
yyDollar = yyS[yypt-9 : yypt+1]
|
||||||
//line parser/parser.y:679
|
//line parser/parser.y:679
|
||||||
{
|
{
|
||||||
yyVAL.node = stmt.NewClassMethod(yyDollar[4].token, yyDollar[1].node.(node.SimpleNode).Children, yyDollar[3].value == "true", yyDollar[6].list, yyDollar[8].node, yyDollar[9].list)
|
yyVAL.node = stmt.NewClassMethod(yyDollar[4].token, yyDollar[1].list, yyDollar[3].value == "true", yyDollar[6].list, yyDollar[8].node, yyDollar[9].list)
|
||||||
}
|
}
|
||||||
case 244:
|
case 244:
|
||||||
yyDollar = yyS[yypt-1 : yypt+1]
|
yyDollar = yyS[yypt-1 : yypt+1]
|
||||||
@ -3615,73 +3615,73 @@ yydefault:
|
|||||||
yyDollar = yyS[yypt-1 : yypt+1]
|
yyDollar = yyS[yypt-1 : yypt+1]
|
||||||
//line parser/parser.y:737
|
//line parser/parser.y:737
|
||||||
{
|
{
|
||||||
yyVAL.node = yyDollar[1].node
|
yyVAL.list = yyDollar[1].list
|
||||||
}
|
}
|
||||||
case 264:
|
case 264:
|
||||||
yyDollar = yyS[yypt-1 : yypt+1]
|
yyDollar = yyS[yypt-1 : yypt+1]
|
||||||
//line parser/parser.y:738
|
//line parser/parser.y:738
|
||||||
{
|
{
|
||||||
yyVAL.node = node.NewSimpleNode("VarMemberModifier")
|
yyVAL.list = []node.Node{node.NewIdentifier(yyDollar[1].token)}
|
||||||
}
|
}
|
||||||
case 265:
|
case 265:
|
||||||
yyDollar = yyS[yypt-0 : yypt+1]
|
yyDollar = yyS[yypt-0 : yypt+1]
|
||||||
//line parser/parser.y:742
|
//line parser/parser.y:742
|
||||||
{
|
{
|
||||||
yyVAL.node = node.NewSimpleNode("MemberModifiers").Append(node.NewSimpleNode("PublicMemberModifier"))
|
yyVAL.list = nil
|
||||||
}
|
}
|
||||||
case 266:
|
case 266:
|
||||||
yyDollar = yyS[yypt-1 : yypt+1]
|
yyDollar = yyS[yypt-1 : yypt+1]
|
||||||
//line parser/parser.y:743
|
//line parser/parser.y:743
|
||||||
{
|
{
|
||||||
yyVAL.node = yyDollar[1].node
|
yyVAL.list = yyDollar[1].list
|
||||||
}
|
}
|
||||||
case 267:
|
case 267:
|
||||||
yyDollar = yyS[yypt-1 : yypt+1]
|
yyDollar = yyS[yypt-1 : yypt+1]
|
||||||
//line parser/parser.y:747
|
//line parser/parser.y:747
|
||||||
{
|
{
|
||||||
yyVAL.node = node.NewSimpleNode("MemberModifiers").Append(yyDollar[1].node)
|
yyVAL.list = []node.Node{yyDollar[1].node}
|
||||||
}
|
}
|
||||||
case 268:
|
case 268:
|
||||||
yyDollar = yyS[yypt-2 : yypt+1]
|
yyDollar = yyS[yypt-2 : yypt+1]
|
||||||
//line parser/parser.y:748
|
//line parser/parser.y:748
|
||||||
{
|
{
|
||||||
yyVAL.node = yyDollar[1].node.Append(yyDollar[2].node)
|
yyVAL.list = append(yyDollar[1].list, yyDollar[2].node)
|
||||||
}
|
}
|
||||||
case 269:
|
case 269:
|
||||||
yyDollar = yyS[yypt-1 : yypt+1]
|
yyDollar = yyS[yypt-1 : yypt+1]
|
||||||
//line parser/parser.y:752
|
//line parser/parser.y:752
|
||||||
{
|
{
|
||||||
yyVAL.node = node.NewSimpleNode("PublicMemberModifier")
|
yyVAL.node = node.NewIdentifier(yyDollar[1].token)
|
||||||
}
|
}
|
||||||
case 270:
|
case 270:
|
||||||
yyDollar = yyS[yypt-1 : yypt+1]
|
yyDollar = yyS[yypt-1 : yypt+1]
|
||||||
//line parser/parser.y:753
|
//line parser/parser.y:753
|
||||||
{
|
{
|
||||||
yyVAL.node = node.NewSimpleNode("ProtectedMemberModifier")
|
yyVAL.node = node.NewIdentifier(yyDollar[1].token)
|
||||||
}
|
}
|
||||||
case 271:
|
case 271:
|
||||||
yyDollar = yyS[yypt-1 : yypt+1]
|
yyDollar = yyS[yypt-1 : yypt+1]
|
||||||
//line parser/parser.y:754
|
//line parser/parser.y:754
|
||||||
{
|
{
|
||||||
yyVAL.node = node.NewSimpleNode("PrivateMemberModifier")
|
yyVAL.node = node.NewIdentifier(yyDollar[1].token)
|
||||||
}
|
}
|
||||||
case 272:
|
case 272:
|
||||||
yyDollar = yyS[yypt-1 : yypt+1]
|
yyDollar = yyS[yypt-1 : yypt+1]
|
||||||
//line parser/parser.y:755
|
//line parser/parser.y:755
|
||||||
{
|
{
|
||||||
yyVAL.node = node.NewSimpleNode("StaticMemberModifier")
|
yyVAL.node = node.NewIdentifier(yyDollar[1].token)
|
||||||
}
|
}
|
||||||
case 273:
|
case 273:
|
||||||
yyDollar = yyS[yypt-1 : yypt+1]
|
yyDollar = yyS[yypt-1 : yypt+1]
|
||||||
//line parser/parser.y:756
|
//line parser/parser.y:756
|
||||||
{
|
{
|
||||||
yyVAL.node = node.NewSimpleNode("AbstractMemberModifier")
|
yyVAL.node = node.NewIdentifier(yyDollar[1].token)
|
||||||
}
|
}
|
||||||
case 274:
|
case 274:
|
||||||
yyDollar = yyS[yypt-1 : yypt+1]
|
yyDollar = yyS[yypt-1 : yypt+1]
|
||||||
//line parser/parser.y:757
|
//line parser/parser.y:757
|
||||||
{
|
{
|
||||||
yyVAL.node = node.NewSimpleNode("FinalMemberModifier")
|
yyVAL.node = node.NewIdentifier(yyDollar[1].token)
|
||||||
}
|
}
|
||||||
case 275:
|
case 275:
|
||||||
yyDollar = yyS[yypt-3 : yypt+1]
|
yyDollar = yyS[yypt-3 : yypt+1]
|
||||||
|
@ -215,8 +215,7 @@ func Parse(src io.Reader, fName string) node.Node {
|
|||||||
%type <node> array_pair possible_array_pair
|
%type <node> array_pair possible_array_pair
|
||||||
%type <node> isset_variable type return_type type_expr
|
%type <node> isset_variable type return_type type_expr
|
||||||
|
|
||||||
%type <node> variable_modifiers
|
%type <node> member_modifier
|
||||||
%type <node> method_modifiers non_empty_member_modifiers member_modifier
|
|
||||||
%type <node> use_type
|
%type <node> use_type
|
||||||
|
|
||||||
%type <strings> class_modifiers
|
%type <strings> class_modifiers
|
||||||
@ -227,7 +226,8 @@ 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> 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> 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> inner_statement_list parameter_list non_empty_parameter_list class_statement_list
|
||||||
%type <list> method_body interface_extends_list implements_list
|
%type <list> method_body interface_extends_list implements_list method_modifiers variable_modifiers
|
||||||
|
%type <list> non_empty_member_modifiers
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
@ -673,11 +673,11 @@ class_statement_list:
|
|||||||
|
|
||||||
class_statement:
|
class_statement:
|
||||||
variable_modifiers property_list ';' { $$ = stmt.NewPropertyList($1, $2) }
|
variable_modifiers property_list ';' { $$ = stmt.NewPropertyList($1, $2) }
|
||||||
| method_modifiers T_CONST class_const_list ';' { $$ = stmt.NewClassConst($2, $1.(node.SimpleNode).Children, $3); }
|
| method_modifiers T_CONST class_const_list ';' { $$ = stmt.NewClassConst($2, $1, $3); }
|
||||||
| T_USE name_list trait_adaptations { $$ = stmt.NewTraitUse($1, $2.(node.SimpleNode).Children, $3) }
|
| T_USE name_list trait_adaptations { $$ = stmt.NewTraitUse($1, $2.(node.SimpleNode).Children, $3) }
|
||||||
| method_modifiers T_FUNCTION returns_ref identifier '(' parameter_list ')' return_type method_body
|
| method_modifiers T_FUNCTION returns_ref identifier '(' parameter_list ')' return_type method_body
|
||||||
{
|
{
|
||||||
$$ = stmt.NewClassMethod($4, $1.(node.SimpleNode).Children, $3 == "true", $6, $8, $9)
|
$$ = stmt.NewClassMethod($4, $1, $3 == "true", $6, $8, $9)
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -735,26 +735,26 @@ method_body:
|
|||||||
|
|
||||||
variable_modifiers:
|
variable_modifiers:
|
||||||
non_empty_member_modifiers { $$ = $1; }
|
non_empty_member_modifiers { $$ = $1; }
|
||||||
| T_VAR { $$ = node.NewSimpleNode("VarMemberModifier") }
|
| T_VAR { $$ = []node.Node{node.NewIdentifier($1)} }
|
||||||
;
|
;
|
||||||
|
|
||||||
method_modifiers:
|
method_modifiers:
|
||||||
/* empty */ { $$ = node.NewSimpleNode("MemberModifiers").Append(node.NewSimpleNode("PublicMemberModifier")); }
|
/* empty */ { $$ = nil }
|
||||||
| non_empty_member_modifiers { $$ = $1; }
|
| non_empty_member_modifiers { $$ = $1 }
|
||||||
;
|
;
|
||||||
|
|
||||||
non_empty_member_modifiers:
|
non_empty_member_modifiers:
|
||||||
member_modifier { $$ = node.NewSimpleNode("MemberModifiers").Append($1); }
|
member_modifier { $$ = []node.Node{$1} }
|
||||||
| non_empty_member_modifiers member_modifier { $$ = $1.Append($2) }
|
| non_empty_member_modifiers member_modifier { $$ = append($1, $2) }
|
||||||
;
|
;
|
||||||
|
|
||||||
member_modifier:
|
member_modifier:
|
||||||
T_PUBLIC { $$ = node.NewSimpleNode("PublicMemberModifier"); }
|
T_PUBLIC { $$ = node.NewIdentifier($1) }
|
||||||
| T_PROTECTED { $$ = node.NewSimpleNode("ProtectedMemberModifier"); }
|
| T_PROTECTED { $$ = node.NewIdentifier($1) }
|
||||||
| T_PRIVATE { $$ = node.NewSimpleNode("PrivateMemberModifier"); }
|
| T_PRIVATE { $$ = node.NewIdentifier($1) }
|
||||||
| T_STATIC { $$ = node.NewSimpleNode("StaticMemberModifier"); }
|
| T_STATIC { $$ = node.NewIdentifier($1) }
|
||||||
| T_ABSTRACT { $$ = node.NewSimpleNode("AbstractMemberModifier"); }
|
| T_ABSTRACT { $$ = node.NewIdentifier($1) }
|
||||||
| T_FINAL { $$ = node.NewSimpleNode("FinalMemberModifier"); }
|
| T_FINAL { $$ = node.NewIdentifier($1) }
|
||||||
;
|
;
|
||||||
|
|
||||||
property_list:
|
property_list:
|
||||||
|
Loading…
Reference in New Issue
Block a user