line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSONY::Grammar; |
2
|
3
|
|
|
3
|
|
23
|
use base 'Pegex::Grammar'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1513
|
|
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
8399
|
use constant file => './share/jsony.pgx'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
3809
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub make_tree { # Generated/Inlined by Pegex::Grammar (0.74) |
7
|
|
|
|
|
|
|
{ |
8
|
2
|
|
|
2
|
1
|
1092
|
'+grammar' => 'jsony', |
9
|
|
|
|
|
|
|
'+toprule' => 'jsony', |
10
|
|
|
|
|
|
|
'+version' => '0.0.1', |
11
|
|
|
|
|
|
|
'EOL' => { |
12
|
|
|
|
|
|
|
'.rgx' => qr/\G\r?\n/ |
13
|
|
|
|
|
|
|
}, |
14
|
|
|
|
|
|
|
'_' => { |
15
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/ |
16
|
|
|
|
|
|
|
}, |
17
|
|
|
|
|
|
|
'bare' => { |
18
|
|
|
|
|
|
|
'.rgx' => qr/\G([^\s\{\}\[\]'",]*[^\s\{\}\[\]'",:])/ |
19
|
|
|
|
|
|
|
}, |
20
|
|
|
|
|
|
|
'comment' => { |
21
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\#\ .*|\#|\ *)(?:\r?\n|\z)/ |
22
|
|
|
|
|
|
|
}, |
23
|
|
|
|
|
|
|
'double' => { |
24
|
|
|
|
|
|
|
'.rgx' => qr/\G"((?:\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})|[^"\x00-\x1f])*)"/ |
25
|
|
|
|
|
|
|
}, |
26
|
|
|
|
|
|
|
'jsony' => { |
27
|
|
|
|
|
|
|
'.all' => [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'-skip' => 1, |
30
|
|
|
|
|
|
|
'.ref' => 'leading_whitespace' |
31
|
|
|
|
|
|
|
}, |
32
|
|
|
|
|
|
|
{ |
33
|
|
|
|
|
|
|
'.any' => [ |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'.ref' => 'top_seq' |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
{ |
38
|
|
|
|
|
|
|
'.ref' => 'top_map' |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
'.ref' => 'list' |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
] |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
] |
46
|
|
|
|
|
|
|
}, |
47
|
|
|
|
|
|
|
'leading_whitespace' => { |
48
|
|
|
|
|
|
|
'+max' => 1, |
49
|
|
|
|
|
|
|
'.ref' => 'ws' |
50
|
|
|
|
|
|
|
}, |
51
|
|
|
|
|
|
|
'list' => { |
52
|
|
|
|
|
|
|
'+max' => 1, |
53
|
|
|
|
|
|
|
'.all' => [ |
54
|
|
|
|
|
|
|
{ |
55
|
|
|
|
|
|
|
'.ref' => 'node' |
56
|
|
|
|
|
|
|
}, |
57
|
|
|
|
|
|
|
{ |
58
|
|
|
|
|
|
|
'+min' => 0, |
59
|
|
|
|
|
|
|
'-flat' => 1, |
60
|
|
|
|
|
|
|
'.all' => [ |
61
|
|
|
|
|
|
|
{ |
62
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*,?(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/ |
63
|
|
|
|
|
|
|
}, |
64
|
|
|
|
|
|
|
{ |
65
|
|
|
|
|
|
|
'.ref' => 'node' |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
] |
68
|
|
|
|
|
|
|
}, |
69
|
|
|
|
|
|
|
{ |
70
|
|
|
|
|
|
|
'+max' => 1, |
71
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*,?(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/ |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
] |
74
|
|
|
|
|
|
|
}, |
75
|
|
|
|
|
|
|
'map' => { |
76
|
|
|
|
|
|
|
'.all' => [ |
77
|
|
|
|
|
|
|
{ |
78
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*\{(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/ |
79
|
|
|
|
|
|
|
}, |
80
|
|
|
|
|
|
|
{ |
81
|
|
|
|
|
|
|
'+min' => 0, |
82
|
|
|
|
|
|
|
'.ref' => 'pair' |
83
|
|
|
|
|
|
|
}, |
84
|
|
|
|
|
|
|
{ |
85
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*\}(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/ |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
] |
88
|
|
|
|
|
|
|
}, |
89
|
|
|
|
|
|
|
'node' => { |
90
|
|
|
|
|
|
|
'.any' => [ |
91
|
|
|
|
|
|
|
{ |
92
|
|
|
|
|
|
|
'.ref' => 'map' |
93
|
|
|
|
|
|
|
}, |
94
|
|
|
|
|
|
|
{ |
95
|
|
|
|
|
|
|
'.ref' => 'seq' |
96
|
|
|
|
|
|
|
}, |
97
|
|
|
|
|
|
|
{ |
98
|
|
|
|
|
|
|
'.ref' => 'scalar' |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
] |
101
|
|
|
|
|
|
|
}, |
102
|
|
|
|
|
|
|
'pair' => { |
103
|
|
|
|
|
|
|
'.all' => [ |
104
|
|
|
|
|
|
|
{ |
105
|
|
|
|
|
|
|
'.ref' => 'string' |
106
|
|
|
|
|
|
|
}, |
107
|
|
|
|
|
|
|
{ |
108
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*:?(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/ |
109
|
|
|
|
|
|
|
}, |
110
|
|
|
|
|
|
|
{ |
111
|
|
|
|
|
|
|
'.ref' => 'node' |
112
|
|
|
|
|
|
|
}, |
113
|
|
|
|
|
|
|
{ |
114
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*,?(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/ |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
] |
117
|
|
|
|
|
|
|
}, |
118
|
|
|
|
|
|
|
'scalar' => { |
119
|
|
|
|
|
|
|
'.any' => [ |
120
|
|
|
|
|
|
|
{ |
121
|
|
|
|
|
|
|
'.ref' => 'double' |
122
|
|
|
|
|
|
|
}, |
123
|
|
|
|
|
|
|
{ |
124
|
|
|
|
|
|
|
'.ref' => 'single' |
125
|
|
|
|
|
|
|
}, |
126
|
|
|
|
|
|
|
{ |
127
|
|
|
|
|
|
|
'.ref' => 'bare' |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
] |
130
|
|
|
|
|
|
|
}, |
131
|
|
|
|
|
|
|
'seq' => { |
132
|
|
|
|
|
|
|
'.all' => [ |
133
|
|
|
|
|
|
|
{ |
134
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*\[(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/ |
135
|
|
|
|
|
|
|
}, |
136
|
|
|
|
|
|
|
{ |
137
|
|
|
|
|
|
|
'+max' => 1, |
138
|
|
|
|
|
|
|
'.all' => [ |
139
|
|
|
|
|
|
|
{ |
140
|
|
|
|
|
|
|
'.ref' => 'node' |
141
|
|
|
|
|
|
|
}, |
142
|
|
|
|
|
|
|
{ |
143
|
|
|
|
|
|
|
'+min' => 0, |
144
|
|
|
|
|
|
|
'-flat' => 1, |
145
|
|
|
|
|
|
|
'.all' => [ |
146
|
|
|
|
|
|
|
{ |
147
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*,?(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/ |
148
|
|
|
|
|
|
|
}, |
149
|
|
|
|
|
|
|
{ |
150
|
|
|
|
|
|
|
'.ref' => 'node' |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
] |
153
|
|
|
|
|
|
|
}, |
154
|
|
|
|
|
|
|
{ |
155
|
|
|
|
|
|
|
'+max' => 1, |
156
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*,?(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/ |
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
] |
159
|
|
|
|
|
|
|
}, |
160
|
|
|
|
|
|
|
{ |
161
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*\](?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/ |
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
] |
164
|
|
|
|
|
|
|
}, |
165
|
|
|
|
|
|
|
'single' => { |
166
|
|
|
|
|
|
|
'.rgx' => qr/\G'([^']*)'/ |
167
|
|
|
|
|
|
|
}, |
168
|
|
|
|
|
|
|
'string' => { |
169
|
|
|
|
|
|
|
'.ref' => 'scalar' |
170
|
|
|
|
|
|
|
}, |
171
|
|
|
|
|
|
|
'top_map' => { |
172
|
|
|
|
|
|
|
'+min' => 1, |
173
|
|
|
|
|
|
|
'.all' => [ |
174
|
|
|
|
|
|
|
{ |
175
|
|
|
|
|
|
|
'.ref' => 'string' |
176
|
|
|
|
|
|
|
}, |
177
|
|
|
|
|
|
|
{ |
178
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*:(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/ |
179
|
|
|
|
|
|
|
}, |
180
|
|
|
|
|
|
|
{ |
181
|
|
|
|
|
|
|
'.ref' => 'node' |
182
|
|
|
|
|
|
|
}, |
183
|
|
|
|
|
|
|
{ |
184
|
|
|
|
|
|
|
'.ref' => '_' |
185
|
|
|
|
|
|
|
} |
186
|
|
|
|
|
|
|
] |
187
|
|
|
|
|
|
|
}, |
188
|
|
|
|
|
|
|
'top_seq' => { |
189
|
|
|
|
|
|
|
'+min' => 1, |
190
|
|
|
|
|
|
|
'.ref' => 'top_seq_entry' |
191
|
|
|
|
|
|
|
}, |
192
|
|
|
|
|
|
|
'top_seq_entry' => { |
193
|
|
|
|
|
|
|
'.all' => [ |
194
|
|
|
|
|
|
|
{ |
195
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*\-\ +/ |
196
|
|
|
|
|
|
|
}, |
197
|
|
|
|
|
|
|
{ |
198
|
|
|
|
|
|
|
'.all' => [ |
199
|
|
|
|
|
|
|
{ |
200
|
|
|
|
|
|
|
'+max' => 1, |
201
|
|
|
|
|
|
|
'.all' => [ |
202
|
|
|
|
|
|
|
{ |
203
|
|
|
|
|
|
|
'.ref' => 'node' |
204
|
|
|
|
|
|
|
}, |
205
|
|
|
|
|
|
|
{ |
206
|
|
|
|
|
|
|
'+min' => 0, |
207
|
|
|
|
|
|
|
'-flat' => 1, |
208
|
|
|
|
|
|
|
'.all' => [ |
209
|
|
|
|
|
|
|
{ |
210
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\ *,\ *\r?\n(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*|\ +)/ |
211
|
|
|
|
|
|
|
}, |
212
|
|
|
|
|
|
|
{ |
213
|
|
|
|
|
|
|
'.ref' => 'node' |
214
|
|
|
|
|
|
|
} |
215
|
|
|
|
|
|
|
] |
216
|
|
|
|
|
|
|
}, |
217
|
|
|
|
|
|
|
{ |
218
|
|
|
|
|
|
|
'+max' => 1, |
219
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\ *,\ *\r?\n(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*|\ +)/ |
220
|
|
|
|
|
|
|
} |
221
|
|
|
|
|
|
|
] |
222
|
|
|
|
|
|
|
}, |
223
|
|
|
|
|
|
|
{ |
224
|
|
|
|
|
|
|
'.any' => [ |
225
|
|
|
|
|
|
|
{ |
226
|
|
|
|
|
|
|
'.ref' => 'comment' |
227
|
|
|
|
|
|
|
}, |
228
|
|
|
|
|
|
|
{ |
229
|
|
|
|
|
|
|
'.ref' => 'EOL' |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
] |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
] |
234
|
|
|
|
|
|
|
} |
235
|
|
|
|
|
|
|
] |
236
|
|
|
|
|
|
|
}, |
237
|
|
|
|
|
|
|
'ws' => { |
238
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))/ |
239
|
|
|
|
|
|
|
} |
240
|
|
|
|
|
|
|
} |
241
|
|
|
|
|
|
|
} |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
1; |