line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# GENERATE RECURSIVE DESCENT PARSER OBJECTS FROM A GRAMMAR |
2
|
|
|
|
|
|
|
|
3
|
13
|
|
|
13
|
|
63420
|
use 5.006; |
|
13
|
|
|
|
|
29
|
|
4
|
13
|
|
|
13
|
|
95
|
use strict; |
|
13
|
|
|
|
|
15
|
|
|
13
|
|
|
|
|
345
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Parse::RecDescent; |
7
|
|
|
|
|
|
|
|
8
|
13
|
|
|
13
|
|
6450
|
use Text::Balanced qw ( extract_codeblock extract_bracketed extract_quotelike extract_delimited ); |
|
13
|
|
|
|
|
165760
|
|
|
13
|
|
|
|
|
878
|
|
9
|
|
|
|
|
|
|
|
10
|
13
|
|
|
13
|
|
119
|
use vars qw ( $skip ); |
|
13
|
|
|
|
|
18
|
|
|
13
|
|
|
|
|
88802
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
*defskip = \ '\s*'; # DEFAULT SEPARATOR IS OPTIONAL WHITESPACE |
13
|
|
|
|
|
|
|
$skip = '\s*'; # UNIVERSAL SEPARATOR IS OPTIONAL WHITESPACE |
14
|
|
|
|
|
|
|
my $MAXREP = 100_000_000; # REPETITIONS MATCH AT MOST 100,000,000 TIMES |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#ifndef RUNTIME |
18
|
|
|
|
|
|
|
sub import # IMPLEMENT PRECOMPILER BEHAVIOUR UNDER: |
19
|
|
|
|
|
|
|
# perl -MParse::RecDescent - [runtimeclassname] |
20
|
|
|
|
|
|
|
{ |
21
|
1
|
|
|
1
|
|
75
|
local *_die = sub { print @_, "\n"; exit }; |
|
1
|
|
|
14
|
|
4
|
|
|
14
|
|
|
|
|
128
|
|
22
|
|
|
|
|
|
|
|
23
|
14
|
|
|
|
|
108
|
my ($package, $file, $line) = caller; |
24
|
|
|
|
|
|
|
|
25
|
14
|
50
|
33
|
|
|
5333
|
if ($file eq '-' && $line == 0) |
26
|
|
|
|
|
|
|
{ |
27
|
1
|
0
|
0
|
|
|
1
|
_die("Usage: perl -MLocalTest - ") |
28
|
|
|
|
|
|
|
unless @ARGV >= 2 and $ARGV <= 3; |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
122
|
my ($sourcefile, $class, $runtime_class) = @ARGV; |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
10
|
local *IN; |
33
|
1
|
0
|
|
|
|
2
|
open IN, $sourcefile |
34
|
|
|
|
|
|
|
or _die(qq{Can't open grammar file "$sourcefile"}); |
35
|
1
|
|
|
|
|
105
|
local $/; # |
36
|
1
|
|
|
|
|
7
|
my $grammar = ; |
37
|
1
|
|
|
|
|
2
|
close IN; |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
76
|
Parse::RecDescent->Precompile({ -runtime_class => $runtime_class }, |
40
|
|
|
|
|
|
|
$grammar, $class, $sourcefile); |
41
|
1
|
|
|
|
|
11
|
exit; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub Save |
46
|
|
|
|
|
|
|
{ |
47
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
48
|
1
|
|
|
|
|
98
|
my %opt; |
49
|
1
|
0
|
|
|
|
6
|
if ('HASH' eq ref $_[0]) { |
50
|
1
|
|
|
|
|
2
|
%opt = (%opt, %{$_[0]}); |
|
1
|
|
|
|
|
56
|
|
51
|
1
|
|
|
|
|
5
|
shift; |
52
|
|
|
|
|
|
|
} |
53
|
1
|
|
|
|
|
2
|
my ($class) = @_; |
54
|
1
|
|
|
|
|
49
|
$self->{saving} = 1; |
55
|
1
|
|
|
|
|
5
|
$self->Precompile(undef,$class); |
56
|
1
|
|
|
|
|
1
|
$self->{saving} = 0; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub PrecompiledRuntime |
60
|
|
|
|
|
|
|
{ |
61
|
1
|
|
|
1
|
0
|
47
|
my ($self, $class) = @_; |
62
|
1
|
|
|
|
|
6
|
my $opt = { |
63
|
|
|
|
|
|
|
-standalone => 1, |
64
|
|
|
|
|
|
|
-runtime_class => $class, |
65
|
|
|
|
|
|
|
}; |
66
|
1
|
|
|
|
|
2
|
$self->Precompile($opt, '', $class); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub Precompile |
70
|
|
|
|
|
|
|
{ |
71
|
10
|
|
|
10
|
0
|
21637
|
my $self = shift; |
72
|
10
|
|
|
|
|
41
|
my %opt = ( -standalone => 0, |
73
|
|
|
|
|
|
|
); |
74
|
10
|
50
|
|
|
|
48
|
if ('HASH' eq ref $_[0]) { |
75
|
10
|
|
|
|
|
69
|
%opt = (%opt, %{$_[0]}); |
|
10
|
|
|
|
|
37
|
|
76
|
10
|
|
|
|
|
17
|
shift; |
77
|
|
|
|
|
|
|
} |
78
|
10
|
|
|
|
|
62
|
my ($grammar, $class, $sourcefile) = @_; |
79
|
|
|
|
|
|
|
|
80
|
10
|
50
|
|
|
|
68
|
$class =~ /^(\w+::)*\w+$/ or croak("Bad class name: $class"); |
81
|
|
|
|
|
|
|
|
82
|
10
|
|
|
|
|
19
|
my $modulefile = $class; |
83
|
10
|
|
|
|
|
66
|
$modulefile =~ s/.*:://; |
84
|
10
|
|
|
|
|
17
|
$modulefile .= ".pm"; |
85
|
|
|
|
|
|
|
|
86
|
10
|
|
|
|
|
19
|
my $code = ''; |
87
|
|
|
|
|
|
|
|
88
|
10
|
|
|
|
|
66
|
local *OUT; |
89
|
10
|
50
|
|
|
|
687
|
open OUT, ">", $modulefile |
90
|
|
|
|
|
|
|
or croak("Can't write to new module file '$modulefile'"); |
91
|
|
|
|
|
|
|
|
92
|
10
|
|
|
|
|
163
|
print OUT "#\n", |
93
|
|
|
|
|
|
|
"# This parser was generated with\n", |
94
|
|
|
|
|
|
|
"# Parse::RecDescent version $Parse::RecDescent::VERSION\n", |
95
|
|
|
|
|
|
|
"#\n\n"; |
96
|
|
|
|
|
|
|
|
97
|
10
|
50
|
33
|
|
|
113
|
print STDERR "precompiling grammar from file '$sourcefile'\n", |
98
|
|
|
|
|
|
|
"to class $class in module file '$modulefile'\n" |
99
|
|
|
|
|
|
|
if $grammar && $sourcefile; |
100
|
|
|
|
|
|
|
|
101
|
10
|
50
|
|
|
|
30
|
if ($grammar) { |
102
|
10
|
50
|
33
|
|
|
80
|
$self = Parse::RecDescent->new($grammar, # $grammar |
103
|
|
|
|
|
|
|
1, # $compiling |
104
|
|
|
|
|
|
|
$class # $namespace |
105
|
|
|
|
|
|
|
) |
106
|
|
|
|
|
|
|
|| croak("Can't compile bad grammar") |
107
|
|
|
|
|
|
|
if $grammar; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
# Do not allow &DESTROY to remove the precompiled namespace |
110
|
10
|
|
|
|
|
87
|
delete $self->{_not_precompiled}; |
111
|
|
|
|
|
|
|
|
112
|
10
|
|
|
|
|
18
|
foreach ( keys %{$self->{rules}} ) { |
|
10
|
|
|
|
|
145
|
|
113
|
565
|
|
|
|
|
592
|
$self->{rules}{$_}{changed} = 1; |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
10
|
|
|
|
|
71
|
$code = $self->_code(); |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
# If a name for the runtime package was not provided, |
120
|
|
|
|
|
|
|
# generate one based on the module output name and the generated |
121
|
|
|
|
|
|
|
# code |
122
|
10
|
50
|
|
|
|
52
|
if (not defined($opt{-runtime_class})) { |
123
|
10
|
100
|
|
|
|
78
|
if ($opt{-standalone}) { |
124
|
9
|
|
|
|
|
23
|
my $basename = $class . '::_Runtime'; |
125
|
|
|
|
|
|
|
|
126
|
9
|
|
|
|
|
11
|
my $name = $basename; |
127
|
|
|
|
|
|
|
|
128
|
9
|
|
|
|
|
3838
|
for (my $i = 0; $code =~ /$basename/; ++$i) { |
129
|
1
|
|
|
|
|
4
|
$name = sprintf("%s%06d", $basename, $i); |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
9
|
|
|
|
|
35
|
$opt{-runtime_class} = $name; |
133
|
|
|
|
|
|
|
} else { |
134
|
2
|
|
|
|
|
56
|
my $package = ref $self; |
135
|
2
|
50
|
|
|
|
8
|
local $::RD_HINT = defined $::RD_HINT ? $::RD_HINT : 1; |
136
|
2
|
|
|
|
|
9
|
_hint(<
|
137
|
|
|
|
|
|
|
The precompiled grammar did not specify the -runtime_class |
138
|
|
|
|
|
|
|
option. The resulting parser will "use $package". Future changes to |
139
|
|
|
|
|
|
|
$package may cause $class to stop working. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Consider building a -standalone parser, or providing the |
142
|
|
|
|
|
|
|
-runtime_class option as described in Parse::RecDescent's POD. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Use \$::RD_HINT = 0 to disable this message. |
145
|
|
|
|
|
|
|
EOWARNING |
146
|
2
|
|
|
|
|
60
|
$opt{-runtime_class} = $package; |
147
|
|
|
|
|
|
|
} |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
|
150
|
10
|
|
|
|
|
16130
|
$code =~ s/Parse::RecDescent/$opt{-runtime_class}/gs; |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
# Make the resulting pre-compiled parser stand-alone by including |
153
|
|
|
|
|
|
|
# the contents of Parse::RecDescent as -runtime_class in the |
154
|
|
|
|
|
|
|
# resulting precompiled parser. |
155
|
10
|
100
|
|
|
|
36
|
if ($opt{-standalone}) { |
156
|
9
|
|
|
|
|
118
|
local *IN; |
157
|
9
|
50
|
|
|
|
711
|
open IN, '<', $Parse::RecDescent::_FILENAME |
158
|
|
|
|
|
|
|
or croak("Can't open $Parse::RecDescent::_FILENAME for standalone pre-compilation: $!\n"); |
159
|
9
|
|
|
|
|
19
|
my $exclude = 0; |
160
|
9
|
|
|
|
|
110
|
print OUT "{\n"; |
161
|
9
|
|
|
|
|
156
|
while () { |
162
|
28273
|
100
|
|
|
|
31914
|
if ($_ =~ /^\s*#\s*ifndef\s+RUNTIME\s*$/) { |
163
|
9
|
|
|
|
|
93
|
++$exclude; |
164
|
|
|
|
|
|
|
} |
165
|
28273
|
100
|
|
|
|
23505
|
if ($exclude) { |
166
|
1593
|
100
|
|
|
|
2886
|
if ($_ =~ /^\s*#\s*endif\s$/) { |
167
|
9
|
|
|
|
|
94
|
--$exclude; |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
} else { |
170
|
26681
|
100
|
|
|
|
27913
|
if ($_ =~ m/^__END__/) { |
171
|
9
|
|
|
|
|
24
|
last; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
# Standalone parsers shouldn't trigger the CPAN |
175
|
|
|
|
|
|
|
# indexer to index the runtime, as it shouldn't be |
176
|
|
|
|
|
|
|
# exposed as a user-consumable package. |
177
|
|
|
|
|
|
|
# |
178
|
|
|
|
|
|
|
# Trick the indexer by including a newline in the package declarations |
179
|
26673
|
|
|
|
|
16828
|
s/^package /package # this should not be indexed by CPAN\n/gs; |
180
|
26673
|
|
|
|
|
19761
|
s/Parse::RecDescent/$opt{-runtime_class}/gs; |
181
|
26673
|
|
|
|
|
43792
|
print OUT $_; |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
} |
184
|
9
|
|
|
|
|
386
|
close IN; |
185
|
9
|
|
|
|
|
68
|
print OUT "}\n"; |
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
|
188
|
10
|
50
|
|
|
|
33
|
if ($grammar) { |
189
|
10
|
|
|
|
|
84
|
print OUT "package $class;\n"; |
190
|
|
|
|
|
|
|
} |
191
|
|
|
|
|
|
|
|
192
|
10
|
100
|
|
|
|
43
|
if (not $opt{-standalone}) { |
193
|
2
|
|
|
|
|
4
|
print OUT "use $opt{-runtime_class};\n"; |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
10
|
50
|
|
|
|
102
|
if ($grammar) { |
197
|
10
|
|
|
|
|
22
|
print OUT "{ my \$ERRORS;\n\n"; |
198
|
|
|
|
|
|
|
|
199
|
10
|
|
|
|
|
10525
|
print OUT $code; |
200
|
|
|
|
|
|
|
|
201
|
10
|
|
|
|
|
89
|
print OUT "}\npackage $class; sub new { "; |
202
|
10
|
|
|
|
|
23
|
print OUT "my "; |
203
|
|
|
|
|
|
|
|
204
|
10
|
|
|
|
|
100
|
$code = $self->_dump([$self], [qw(self)]); |
205
|
10
|
|
|
|
|
151222
|
$code =~ s/Parse::RecDescent/$opt{-runtime_class}/gs; |
206
|
|
|
|
|
|
|
|
207
|
10
|
|
|
|
|
9136
|
print OUT $code; |
208
|
|
|
|
|
|
|
|
209
|
10
|
|
|
|
|
25
|
print OUT "}"; |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
10
|
50
|
|
|
|
427
|
close OUT |
213
|
|
|
|
|
|
|
or croak("Can't write to new module file '$modulefile'"); |
214
|
|
|
|
|
|
|
} |
215
|
|
|
|
|
|
|
#endif |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
package Parse::RecDescent::LineCounter; |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
sub TIESCALAR # ($classname, \$text, $thisparser, $prevflag) |
221
|
|
|
|
|
|
|
{ |
222
|
575
|
100
|
|
575
|
|
9676
|
bless { |
223
|
|
|
|
|
|
|
text => $_[1], |
224
|
|
|
|
|
|
|
parser => $_[2], |
225
|
|
|
|
|
|
|
prev => $_[3]?1:0, |
226
|
|
|
|
|
|
|
}, $_[0]; |
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
sub FETCH |
230
|
|
|
|
|
|
|
{ |
231
|
616
|
|
|
616
|
|
572
|
my $parser = $_[0]->{parser}; |
232
|
616
|
|
|
|
|
535
|
my $cache = $parser->{linecounter_cache}; |
233
|
616
|
|
|
|
|
646
|
my $from = $parser->{fulltextlen}-length(${$_[0]->{text}})-$_[0]->{prev} |
234
|
616
|
|
|
|
|
473
|
; |
235
|
|
|
|
|
|
|
|
236
|
616
|
100
|
|
|
|
1336
|
unless (exists $cache->{$from}) |
237
|
|
|
|
|
|
|
{ |
238
|
|
|
|
|
|
|
$parser->{lastlinenum} = $parser->{offsetlinenum} |
239
|
292
|
|
|
|
|
554
|
- Parse::RecDescent::_linecount(substr($parser->{fulltext},$from)) |
240
|
|
|
|
|
|
|
+ 1; |
241
|
292
|
|
|
|
|
469
|
$cache->{$from} = $parser->{lastlinenum}; |
242
|
|
|
|
|
|
|
} |
243
|
616
|
|
|
|
|
6755
|
return $cache->{$from}; |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
sub STORE |
247
|
|
|
|
|
|
|
{ |
248
|
1
|
|
|
1
|
|
4
|
my $parser = $_[0]->{parser}; |
249
|
1
|
|
|
|
|
1
|
$parser->{offsetlinenum} -= $parser->{lastlinenum} - $_[1]; |
250
|
1
|
|
|
|
|
47
|
return undef; |
251
|
|
|
|
|
|
|
} |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
sub resync # ($linecounter) |
254
|
|
|
|
|
|
|
{ |
255
|
1
|
|
|
1
|
|
4
|
my $self = tied($_[0]); |
256
|
1
|
0
|
|
|
|
2
|
die "Tried to alter something other than a LineCounter\n" |
257
|
|
|
|
|
|
|
unless $self =~ /Parse::RecDescent::LineCounter/; |
258
|
|
|
|
|
|
|
|
259
|
1
|
|
|
|
|
46
|
my $parser = $self->{parser}; |
260
|
|
|
|
|
|
|
my $apparently = $parser->{offsetlinenum} |
261
|
1
|
|
|
|
|
4
|
- Parse::RecDescent::_linecount(${$self->{text}}) |
|
1
|
|
|
|
|
2
|
|
262
|
|
|
|
|
|
|
+ 1; |
263
|
|
|
|
|
|
|
|
264
|
1
|
|
|
|
|
44
|
$parser->{offsetlinenum} += $parser->{lastlinenum} - $apparently; |
265
|
1
|
|
|
|
|
5
|
return 1; |
266
|
|
|
|
|
|
|
} |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
package Parse::RecDescent::ColCounter; |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
sub TIESCALAR # ($classname, \$text, $thisparser, $prevflag) |
271
|
|
|
|
|
|
|
{ |
272
|
239
|
100
|
|
239
|
|
4040
|
bless { |
273
|
|
|
|
|
|
|
text => $_[1], |
274
|
|
|
|
|
|
|
parser => $_[2], |
275
|
|
|
|
|
|
|
prev => $_[3]?1:0, |
276
|
|
|
|
|
|
|
}, $_[0]; |
277
|
|
|
|
|
|
|
} |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
sub FETCH |
280
|
|
|
|
|
|
|
{ |
281
|
616
|
|
|
616
|
|
618
|
my $parser = $_[0]->{parser}; |
282
|
616
|
|
|
|
|
455
|
my $missing = $parser->{fulltextlen}-length(${$_[0]->{text}})-$_[0]->{prev}+1; |
|
616
|
|
|
|
|
646
|
|
283
|
616
|
|
|
|
|
1600
|
substr($parser->{fulltext},0,$missing) =~ m/^(.*)\Z/m; |
284
|
616
|
|
|
|
|
10332
|
return length($1); |
285
|
|
|
|
|
|
|
} |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
sub STORE |
288
|
|
|
|
|
|
|
{ |
289
|
1
|
|
|
1
|
|
2
|
die "Can't set column number via \$thiscolumn\n"; |
290
|
|
|
|
|
|
|
} |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
package Parse::RecDescent::OffsetCounter; |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
sub TIESCALAR # ($classname, \$text, $thisparser, $prev) |
296
|
|
|
|
|
|
|
{ |
297
|
239
|
100
|
|
239
|
|
4099
|
bless { |
298
|
|
|
|
|
|
|
text => $_[1], |
299
|
|
|
|
|
|
|
parser => $_[2], |
300
|
|
|
|
|
|
|
prev => $_[3]?-1:0, |
301
|
|
|
|
|
|
|
}, $_[0]; |
302
|
|
|
|
|
|
|
} |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
sub FETCH |
305
|
|
|
|
|
|
|
{ |
306
|
444
|
|
|
444
|
|
421
|
my $parser = $_[0]->{parser}; |
307
|
444
|
|
|
|
|
399
|
return $parser->{fulltextlen}-length(${$_[0]->{text}})+$_[0]->{prev}; |
|
444
|
|
|
|
|
4259
|
|
308
|
|
|
|
|
|
|
} |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
sub STORE |
311
|
|
|
|
|
|
|
{ |
312
|
1
|
|
|
1
|
|
4
|
die "Can't set current offset via \$thisoffset or \$prevoffset\n"; |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
package Parse::RecDescent::Rule; |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
sub new ($$$$$) |
320
|
|
|
|
|
|
|
{ |
321
|
663
|
|
33
|
663
|
|
1095
|
my $class = ref($_[0]) || $_[0]; |
322
|
663
|
|
|
|
|
688
|
my $name = $_[1]; |
323
|
663
|
|
|
|
|
549
|
my $owner = $_[2]; |
324
|
663
|
|
|
|
|
537
|
my $line = $_[3]; |
325
|
663
|
|
|
|
|
549
|
my $replace = $_[4]; |
326
|
|
|
|
|
|
|
|
327
|
663
|
100
|
|
|
|
1218
|
if (defined $owner->{"rules"}{$name}) |
328
|
|
|
|
|
|
|
{ |
329
|
5
|
|
|
|
|
7
|
my $self = $owner->{"rules"}{$name}; |
330
|
5
|
50
|
66
|
|
|
106
|
if ($replace && !$self->{"changed"}) |
331
|
|
|
|
|
|
|
{ |
332
|
1
|
|
|
|
|
4
|
$self->reset; |
333
|
|
|
|
|
|
|
} |
334
|
5
|
|
|
|
|
9
|
return $self; |
335
|
|
|
|
|
|
|
} |
336
|
|
|
|
|
|
|
else |
337
|
|
|
|
|
|
|
{ |
338
|
659
|
|
|
|
|
4496
|
return $owner->{"rules"}{$name} = |
339
|
|
|
|
|
|
|
bless |
340
|
|
|
|
|
|
|
{ |
341
|
|
|
|
|
|
|
"name" => $name, |
342
|
|
|
|
|
|
|
"prods" => [], |
343
|
|
|
|
|
|
|
"calls" => [], |
344
|
|
|
|
|
|
|
"changed" => 0, |
345
|
|
|
|
|
|
|
"line" => $line, |
346
|
|
|
|
|
|
|
"impcount" => 0, |
347
|
|
|
|
|
|
|
"opcount" => 0, |
348
|
|
|
|
|
|
|
"vars" => "", |
349
|
|
|
|
|
|
|
}, $class; |
350
|
|
|
|
|
|
|
} |
351
|
|
|
|
|
|
|
} |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
sub reset($) |
354
|
|
|
|
|
|
|
{ |
355
|
1
|
|
|
1
|
|
3
|
@{$_[0]->{"prods"}} = (); |
|
1
|
|
|
|
|
2
|
|
356
|
1
|
|
|
|
|
81
|
@{$_[0]->{"calls"}} = (); |
|
1
|
|
|
|
|
5
|
|
357
|
1
|
|
|
|
|
1
|
$_[0]->{"changed"} = 0; |
358
|
1
|
|
|
|
|
68
|
$_[0]->{"impcount"} = 0; |
359
|
1
|
|
|
|
|
4
|
$_[0]->{"opcount"} = 0; |
360
|
1
|
|
|
|
|
2
|
$_[0]->{"vars"} = ""; |
361
|
|
|
|
|
|
|
} |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
1
|
|
|
sub DESTROY {} |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
sub hasleftmost($$) |
366
|
|
|
|
|
|
|
{ |
367
|
2624
|
|
|
2624
|
|
2046
|
my ($self, $ref) = @_; |
368
|
|
|
|
|
|
|
|
369
|
2624
|
|
|
|
|
1739
|
my $prod; |
370
|
2624
|
|
|
|
|
1564
|
foreach $prod ( @{$self->{"prods"}} ) |
|
2624
|
|
|
|
|
2802
|
|
371
|
|
|
|
|
|
|
{ |
372
|
5825
|
100
|
|
|
|
5850
|
return 1 if $prod->hasleftmost($ref); |
373
|
|
|
|
|
|
|
} |
374
|
|
|
|
|
|
|
|
375
|
1389
|
|
|
|
|
2625
|
return 0; |
376
|
|
|
|
|
|
|
} |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
sub leftmostsubrules($) |
379
|
|
|
|
|
|
|
{ |
380
|
2220
|
|
|
2220
|
|
1422
|
my $self = shift; |
381
|
2220
|
|
|
|
|
1570
|
my @subrules = (); |
382
|
|
|
|
|
|
|
|
383
|
2220
|
|
|
|
|
1208
|
my $prod; |
384
|
2220
|
|
|
|
|
1336
|
foreach $prod ( @{$self->{"prods"}} ) |
|
2220
|
|
|
|
|
2417
|
|
385
|
|
|
|
|
|
|
{ |
386
|
4994
|
|
|
|
|
4514
|
push @subrules, $prod->leftmostsubrule(); |
387
|
|
|
|
|
|
|
} |
388
|
|
|
|
|
|
|
|
389
|
2220
|
|
|
|
|
2561
|
return @subrules; |
390
|
|
|
|
|
|
|
} |
391
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
sub expected($) |
393
|
|
|
|
|
|
|
{ |
394
|
699
|
|
|
699
|
|
784
|
my $self = shift; |
395
|
699
|
|
|
|
|
742
|
my @expected = (); |
396
|
|
|
|
|
|
|
|
397
|
699
|
|
|
|
|
523
|
my $prod; |
398
|
699
|
|
|
|
|
553
|
foreach $prod ( @{$self->{"prods"}} ) |
|
699
|
|
|
|
|
1169
|
|
399
|
|
|
|
|
|
|
{ |
400
|
1297
|
|
|
|
|
1649
|
my $next = $prod->expected(); |
401
|
1297
|
100
|
100
|
|
|
2534
|
unless (! $next or _contains($next,@expected) ) |
402
|
|
|
|
|
|
|
{ |
403
|
1217
|
|
|
|
|
1494
|
push @expected, $next; |
404
|
|
|
|
|
|
|
} |
405
|
|
|
|
|
|
|
} |
406
|
|
|
|
|
|
|
|
407
|
699
|
|
|
|
|
4407
|
return join ', or ', @expected; |
408
|
|
|
|
|
|
|
} |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
sub _contains($@) |
411
|
|
|
|
|
|
|
{ |
412
|
3955
|
|
|
3955
|
|
3009
|
my $target = shift; |
413
|
3955
|
|
|
|
|
2531
|
my $item; |
414
|
3955
|
100
|
|
|
|
3747
|
foreach $item ( @_ ) { return 1 if $target eq $item; } |
|
10134
|
|
|
|
|
13033
|
|
415
|
3402
|
|
|
|
|
6744
|
return 0; |
416
|
|
|
|
|
|
|
} |
417
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
sub addcall($$) |
419
|
|
|
|
|
|
|
{ |
420
|
1348
|
|
|
1348
|
|
1336
|
my ( $self, $subrule ) = @_; |
421
|
1348
|
100
|
|
|
|
1058
|
unless ( _contains($subrule, @{$self->{"calls"}}) ) |
|
1348
|
|
|
|
|
1984
|
|
422
|
|
|
|
|
|
|
{ |
423
|
1035
|
|
|
|
|
755
|
push @{$self->{"calls"}}, $subrule; |
|
1035
|
|
|
|
|
1768
|
|
424
|
|
|
|
|
|
|
} |
425
|
|
|
|
|
|
|
} |
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
sub addprod($$) |
428
|
|
|
|
|
|
|
{ |
429
|
1253
|
|
|
1253
|
|
1077
|
my ( $self, $prod ) = @_; |
430
|
1253
|
|
|
|
|
979
|
push @{$self->{"prods"}}, $prod; |
|
1253
|
|
|
|
|
1817
|
|
431
|
1253
|
|
|
|
|
1151
|
$self->{"changed"} = 1; |
432
|
1253
|
|
|
|
|
1045
|
$self->{"impcount"} = 0; |
433
|
1253
|
|
|
|
|
882
|
$self->{"opcount"} = 0; |
434
|
1253
|
|
|
|
|
792
|
$prod->{"number"} = $#{$self->{"prods"}}; |
|
1253
|
|
|
|
|
1547
|
|
435
|
1253
|
|
|
|
|
2267
|
return $prod; |
436
|
|
|
|
|
|
|
} |
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
sub addvar |
439
|
|
|
|
|
|
|
{ |
440
|
2
|
|
|
2
|
|
4
|
my ( $self, $var, $parser ) = @_; |
441
|
2
|
50
|
|
|
|
59
|
if ($var =~ /\A\s*local\s+([%@\$]\w+)/) |
442
|
|
|
|
|
|
|
{ |
443
|
1
|
|
|
|
|
4
|
$parser->{localvars} .= " $1"; |
444
|
1
|
|
|
|
|
1
|
$self->{"vars"} .= "$var;\n" } |
445
|
|
|
|
|
|
|
else |
446
|
2
|
|
|
|
|
58
|
{ $self->{"vars"} .= "my $var;\n" } |
447
|
2
|
|
|
|
|
7
|
$self->{"changed"} = 1; |
448
|
2
|
|
|
|
|
4
|
return 1; |
449
|
|
|
|
|
|
|
} |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
sub addautoscore |
452
|
|
|
|
|
|
|
{ |
453
|
1
|
|
|
1
|
|
54
|
my ( $self, $code ) = @_; |
454
|
1
|
|
|
|
|
4
|
$self->{"autoscore"} = $code; |
455
|
1
|
|
|
|
|
2
|
$self->{"changed"} = 1; |
456
|
1
|
|
|
|
|
81
|
return 1; |
457
|
|
|
|
|
|
|
} |
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
sub nextoperator($) |
460
|
|
|
|
|
|
|
{ |
461
|
1
|
|
|
1
|
|
4
|
my $self = shift; |
462
|
1
|
|
|
|
|
1
|
my $prodcount = scalar @{$self->{"prods"}}; |
|
1
|
|
|
|
|
49
|
|
463
|
1
|
|
|
|
|
5
|
my $opcount = ++$self->{"opcount"}; |
464
|
1
|
|
|
|
|
1
|
return "_operator_${opcount}_of_production_${prodcount}_of_rule_$self->{name}"; |
465
|
|
|
|
|
|
|
} |
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
sub nextimplicit($) |
468
|
|
|
|
|
|
|
{ |
469
|
38
|
|
|
38
|
|
131
|
my $self = shift; |
470
|
38
|
|
|
|
|
29
|
my $prodcount = scalar @{$self->{"prods"}}; |
|
38
|
|
|
|
|
75
|
|
471
|
38
|
|
|
|
|
121
|
my $impcount = ++$self->{"impcount"}; |
472
|
38
|
|
|
|
|
118
|
return "_alternation_${impcount}_of_production_${prodcount}_of_rule_$self->{name}"; |
473
|
|
|
|
|
|
|
} |
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
sub code |
477
|
|
|
|
|
|
|
{ |
478
|
662
|
|
|
662
|
|
696
|
my ($self, $namespace, $parser, $check) = @_; |
479
|
|
|
|
|
|
|
|
480
|
662
|
50
|
|
|
|
30827
|
eval 'undef &' . $namespace . '::' . $self->{"name"} unless $parser->{saving}; |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
my $code = |
483
|
|
|
|
|
|
|
' |
484
|
|
|
|
|
|
|
# ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos) |
485
|
|
|
|
|
|
|
sub ' . $namespace . '::' . $self->{"name"} . ' |
486
|
|
|
|
|
|
|
{ |
487
|
|
|
|
|
|
|
my $thisparser = $_[0]; |
488
|
|
|
|
|
|
|
use vars q{$tracelevel}; |
489
|
|
|
|
|
|
|
local $tracelevel = ($tracelevel||0)+1; |
490
|
|
|
|
|
|
|
$ERRORS = 0; |
491
|
|
|
|
|
|
|
my $thisrule = $thisparser->{"rules"}{"' . $self->{"name"} . '"}; |
492
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{Trying rule: [' . $self->{"name"} . ']}, |
494
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($_[1]), |
495
|
|
|
|
|
|
|
q{' . $self->{"name"} . '}, |
496
|
|
|
|
|
|
|
$tracelevel) |
497
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
498
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
' . ($parser->{deferrable} |
500
|
|
|
|
|
|
|
? 'my $def_at = @{$thisparser->{deferred}};' |
501
|
|
|
|
|
|
|
: '') . |
502
|
|
|
|
|
|
|
' |
503
|
|
|
|
|
|
|
my $err_at = @{$thisparser->{errors}}; |
504
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
my $score; |
506
|
|
|
|
|
|
|
my $score_return; |
507
|
|
|
|
|
|
|
my $_tok; |
508
|
|
|
|
|
|
|
my $return = undef; |
509
|
|
|
|
|
|
|
my $_matched=0; |
510
|
|
|
|
|
|
|
my $commit=0; |
511
|
|
|
|
|
|
|
my @item = (); |
512
|
|
|
|
|
|
|
my %item = (); |
513
|
|
|
|
|
|
|
my $repeating = $_[2]; |
514
|
|
|
|
|
|
|
my $_noactions = $_[3]; |
515
|
|
|
|
|
|
|
my @arg = defined $_[4] ? @{ &{$_[4]} } : (); |
516
|
|
|
|
|
|
|
my $_itempos = $_[5]; |
517
|
|
|
|
|
|
|
my %arg = ($#arg & 01) ? @arg : (@arg, undef); |
518
|
|
|
|
|
|
|
my $text; |
519
|
|
|
|
|
|
|
my $lastsep; |
520
|
|
|
|
|
|
|
my $current_match; |
521
|
|
|
|
|
|
|
my $expectation = new Parse::RecDescent::Expectation(q{' . $self->expected() . '}); |
522
|
|
|
|
|
|
|
$expectation->at($_[1]); |
523
|
|
|
|
|
|
|
'. ($parser->{_check}{thisoffset}?' |
524
|
|
|
|
|
|
|
my $thisoffset; |
525
|
|
|
|
|
|
|
tie $thisoffset, q{Parse::RecDescent::OffsetCounter}, \$text, $thisparser; |
526
|
|
|
|
|
|
|
':'') . ($parser->{_check}{prevoffset}?' |
527
|
|
|
|
|
|
|
my $prevoffset; |
528
|
|
|
|
|
|
|
tie $prevoffset, q{Parse::RecDescent::OffsetCounter}, \$text, $thisparser, 1; |
529
|
|
|
|
|
|
|
':'') . ($parser->{_check}{thiscolumn}?' |
530
|
|
|
|
|
|
|
my $thiscolumn; |
531
|
|
|
|
|
|
|
tie $thiscolumn, q{Parse::RecDescent::ColCounter}, \$text, $thisparser; |
532
|
|
|
|
|
|
|
':'') . ($parser->{_check}{prevcolumn}?' |
533
|
|
|
|
|
|
|
my $prevcolumn; |
534
|
|
|
|
|
|
|
tie $prevcolumn, q{Parse::RecDescent::ColCounter}, \$text, $thisparser, 1; |
535
|
|
|
|
|
|
|
':'') . ($parser->{_check}{prevline}?' |
536
|
|
|
|
|
|
|
my $prevline; |
537
|
|
|
|
|
|
|
tie $prevline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser, 1; |
538
|
|
|
|
|
|
|
':'') . ' |
539
|
|
|
|
|
|
|
my $thisline; |
540
|
|
|
|
|
|
|
tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; |
541
|
|
|
|
|
|
|
|
542
|
662
|
50
|
|
|
|
3345
|
'. $self->{vars} .' |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
543
|
|
|
|
|
|
|
'; |
544
|
|
|
|
|
|
|
|
545
|
662
|
|
|
|
|
662
|
my $prod; |
546
|
662
|
|
|
|
|
507
|
foreach $prod ( @{$self->{"prods"}} ) |
|
662
|
|
|
|
|
746
|
|
547
|
|
|
|
|
|
|
{ |
548
|
1258
|
50
|
|
|
|
1874
|
$prod->addscore($self->{autoscore},0,0) if $self->{autoscore}; |
549
|
1258
|
50
|
|
|
|
1906
|
next unless $prod->checkleftmost(); |
550
|
1258
|
|
|
|
|
1832
|
$code .= $prod->code($namespace,$self,$parser); |
551
|
|
|
|
|
|
|
|
552
|
|
|
|
|
|
|
$code .= $parser->{deferrable} |
553
|
1258
|
50
|
|
|
|
2113
|
? ' splice |
554
|
|
|
|
|
|
|
@{$thisparser->{deferred}}, $def_at unless $_matched; |
555
|
|
|
|
|
|
|
' |
556
|
|
|
|
|
|
|
: ''; |
557
|
|
|
|
|
|
|
} |
558
|
|
|
|
|
|
|
|
559
|
|
|
|
|
|
|
$code .= |
560
|
|
|
|
|
|
|
' |
561
|
|
|
|
|
|
|
unless ( $_matched || defined($score) ) |
562
|
|
|
|
|
|
|
{ |
563
|
|
|
|
|
|
|
' .($parser->{deferrable} |
564
|
|
|
|
|
|
|
? ' splice @{$thisparser->{deferred}}, $def_at; |
565
|
|
|
|
|
|
|
' |
566
|
|
|
|
|
|
|
: '') . ' |
567
|
|
|
|
|
|
|
|
568
|
|
|
|
|
|
|
$_[1] = $text; # NOT SURE THIS IS NEEDED |
569
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{<<'.Parse::RecDescent::_matchtracemessage($self,1).' rule>>}, |
570
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($_[1]), |
571
|
|
|
|
|
|
|
q{' . $self->{"name"} .'}, |
572
|
|
|
|
|
|
|
$tracelevel) |
573
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
574
|
|
|
|
|
|
|
return undef; |
575
|
|
|
|
|
|
|
} |
576
|
|
|
|
|
|
|
if (!defined($return) && defined($score)) |
577
|
|
|
|
|
|
|
{ |
578
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", |
579
|
|
|
|
|
|
|
q{' . $self->{"name"} .'}, |
580
|
|
|
|
|
|
|
$tracelevel) |
581
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
582
|
|
|
|
|
|
|
$return = $score_return; |
583
|
|
|
|
|
|
|
} |
584
|
|
|
|
|
|
|
splice @{$thisparser->{errors}}, $err_at; |
585
|
|
|
|
|
|
|
$return = $item[$#item] unless defined $return; |
586
|
|
|
|
|
|
|
if (defined $::RD_TRACE) |
587
|
|
|
|
|
|
|
{ |
588
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{>>'.Parse::RecDescent::_matchtracemessage($self).' rule<< (return value: [} . |
589
|
|
|
|
|
|
|
$return . q{])}, "", |
590
|
|
|
|
|
|
|
q{' . $self->{"name"} .'}, |
591
|
|
|
|
|
|
|
$tracelevel); |
592
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{(consumed: [} . |
593
|
|
|
|
|
|
|
Parse::RecDescent::_tracemax(substr($_[1],0,-length($text))) . q{])}, |
594
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
595
|
662
|
50
|
|
|
|
1387
|
, q{' . $self->{"name"} .'}, |
596
|
|
|
|
|
|
|
$tracelevel) |
597
|
|
|
|
|
|
|
} |
598
|
|
|
|
|
|
|
$_[1] = $text; |
599
|
|
|
|
|
|
|
return $return; |
600
|
|
|
|
|
|
|
} |
601
|
|
|
|
|
|
|
'; |
602
|
|
|
|
|
|
|
|
603
|
662
|
|
|
|
|
4684
|
return $code; |
604
|
|
|
|
|
|
|
} |
605
|
|
|
|
|
|
|
|
606
|
|
|
|
|
|
|
my @left; |
607
|
|
|
|
|
|
|
sub isleftrec($$) |
608
|
|
|
|
|
|
|
{ |
609
|
662
|
|
|
662
|
|
516
|
my ($self, $rules) = @_; |
610
|
662
|
|
|
|
|
683
|
my $root = $self->{"name"}; |
611
|
662
|
|
|
|
|
668
|
@left = $self->leftmostsubrules(); |
612
|
662
|
|
|
|
|
434
|
my $next; |
613
|
662
|
|
|
|
|
604
|
foreach $next ( @left ) |
614
|
|
|
|
|
|
|
{ |
615
|
1748
|
100
|
|
|
|
2352
|
next unless defined $rules->{$next}; # SKIP NON-EXISTENT RULES |
616
|
1559
|
50
|
|
|
|
1784
|
return 1 if $next eq $root; |
617
|
1559
|
|
|
|
|
939
|
my $child; |
618
|
1559
|
|
|
|
|
1760
|
foreach $child ( $rules->{$next}->leftmostsubrules() ) |
619
|
|
|
|
|
|
|
{ |
620
|
1334
|
100
|
|
|
|
1318
|
push(@left, $child) |
621
|
|
|
|
|
|
|
if ! _contains($child, @left) ; |
622
|
|
|
|
|
|
|
} |
623
|
|
|
|
|
|
|
} |
624
|
662
|
|
|
|
|
929
|
return 0; |
625
|
|
|
|
|
|
|
} |
626
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
package Parse::RecDescent::Production; |
628
|
|
|
|
|
|
|
|
629
|
|
|
|
|
|
|
sub describe ($;$) |
630
|
|
|
|
|
|
|
{ |
631
|
2515
|
100
|
|
2515
|
|
1818
|
return join ' ', map { $_->describe($_[1]) or () } @{$_[0]->{items}}; |
|
4645
|
|
|
|
|
6357
|
|
|
2515
|
|
|
|
|
3046
|
|
632
|
|
|
|
|
|
|
} |
633
|
|
|
|
|
|
|
|
634
|
|
|
|
|
|
|
sub new ($$;$$) |
635
|
|
|
|
|
|
|
{ |
636
|
1253
|
|
|
1253
|
|
1288
|
my ($self, $line, $uncommit, $error) = @_; |
637
|
1253
|
|
33
|
|
|
2886
|
my $class = ref($self) || $self; |
638
|
|
|
|
|
|
|
|
639
|
1253
|
|
|
|
|
6903
|
bless |
640
|
|
|
|
|
|
|
{ |
641
|
|
|
|
|
|
|
"items" => [], |
642
|
|
|
|
|
|
|
"uncommit" => $uncommit, |
643
|
|
|
|
|
|
|
"error" => $error, |
644
|
|
|
|
|
|
|
"line" => $line, |
645
|
|
|
|
|
|
|
strcount => 0, |
646
|
|
|
|
|
|
|
patcount => 0, |
647
|
|
|
|
|
|
|
dircount => 0, |
648
|
|
|
|
|
|
|
actcount => 0, |
649
|
|
|
|
|
|
|
}, $class; |
650
|
|
|
|
|
|
|
} |
651
|
|
|
|
|
|
|
|
652
|
|
|
|
|
|
|
sub expected ($) |
653
|
|
|
|
|
|
|
{ |
654
|
1297
|
|
|
1297
|
|
812
|
my $itemcount = scalar @{$_[0]->{"items"}}; |
|
1297
|
|
|
|
|
1593
|
|
655
|
1297
|
50
|
|
|
|
2964
|
return ($itemcount) ? $_[0]->{"items"}[0]->describe(1) : ''; |
656
|
|
|
|
|
|
|
} |
657
|
|
|
|
|
|
|
|
658
|
|
|
|
|
|
|
sub hasleftmost ($$) |
659
|
|
|
|
|
|
|
{ |
660
|
5825
|
|
|
5825
|
|
3803
|
my ($self, $ref) = @_; |
661
|
5825
|
50
|
|
|
|
3260
|
return ${$self->{"items"}}[0] eq $ref if scalar @{$self->{"items"}}; |
|
5825
|
|
|
|
|
19839
|
|
|
5825
|
|
|
|
|
7283
|
|
662
|
1
|
|
|
|
|
2
|
return 0; |
663
|
|
|
|
|
|
|
} |
664
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
sub isempty($) |
666
|
|
|
|
|
|
|
{ |
667
|
1258
|
|
|
1258
|
|
840
|
my $self = shift; |
668
|
1258
|
|
|
|
|
686
|
return 0 == @{$self->{"items"}}; |
|
1258
|
|
|
|
|
2835
|
|
669
|
|
|
|
|
|
|
} |
670
|
|
|
|
|
|
|
|
671
|
|
|
|
|
|
|
sub leftmostsubrule($) |
672
|
|
|
|
|
|
|
{ |
673
|
4994
|
|
|
4994
|
|
3130
|
my $self = shift; |
674
|
|
|
|
|
|
|
|
675
|
4994
|
50
|
|
|
|
2646
|
if ( $#{$self->{"items"}} >= 0 ) |
|
4994
|
|
|
|
|
6789
|
|
676
|
|
|
|
|
|
|
{ |
677
|
4994
|
|
|
|
|
5509
|
my $subrule = $self->{"items"}[0]->issubrule(); |
678
|
4994
|
100
|
|
|
|
7054
|
return $subrule if defined $subrule; |
679
|
|
|
|
|
|
|
} |
680
|
|
|
|
|
|
|
|
681
|
3065
|
|
|
|
|
2619
|
return (); |
682
|
|
|
|
|
|
|
} |
683
|
|
|
|
|
|
|
|
684
|
|
|
|
|
|
|
sub checkleftmost($) |
685
|
|
|
|
|
|
|
{ |
686
|
1258
|
|
|
1258
|
|
895
|
my @items = @{$_[0]->{"items"}}; |
|
1258
|
|
|
|
|
1803
|
|
687
|
1258
|
50
|
100
|
|
|
7225
|
if (@items==1 && ref($items[0]) =~ /\AParse::RecDescent::Error/ |
|
|
100
|
66
|
|
|
|
|
|
|
50
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
33
|
|
|
|
|
688
|
|
|
|
|
|
|
&& $items[0]->{commitonly} ) |
689
|
|
|
|
|
|
|
{ |
690
|
1
|
|
|
|
|
59
|
Parse::RecDescent::_warn(2,"Lone in production treated |
691
|
|
|
|
|
|
|
as "); |
692
|
1
|
|
|
|
|
4
|
Parse::RecDescent::_hint("A production consisting of a single |
693
|
|
|
|
|
|
|
conditional directive would |
694
|
|
|
|
|
|
|
normally succeed (with the value zero) if the |
695
|
|
|
|
|
|
|
rule is not 'commited' when it is |
696
|
|
|
|
|
|
|
tried. Since you almost certainly wanted |
697
|
|
|
|
|
|
|
' ' Parse::RecDescent |
698
|
|
|
|
|
|
|
supplied it for you."); |
699
|
1
|
|
|
|
|
1
|
push @{$_[0]->{items}}, |
|
1
|
|
|
|
|
55
|
|
700
|
|
|
|
|
|
|
Parse::RecDescent::UncondReject->new(0,0,''); |
701
|
|
|
|
|
|
|
} |
702
|
|
|
|
|
|
|
elsif (@items==1 && ($items[0]->describe||"") =~ /
|
703
|
|
|
|
|
|
|
{ |
704
|
|
|
|
|
|
|
# Do nothing |
705
|
|
|
|
|
|
|
} |
706
|
|
|
|
|
|
|
elsif (@items && |
707
|
|
|
|
|
|
|
( ref($items[0]) =~ /\AParse::RecDescent::UncondReject/ |
708
|
|
|
|
|
|
|
|| ($items[0]->describe||"") =~ /
|
709
|
|
|
|
|
|
|
)) |
710
|
|
|
|
|
|
|
{ |
711
|
1
|
|
|
|
|
4
|
Parse::RecDescent::_warn(1,"Optimizing away production: [". $_[0]->describe ."]"); |
712
|
1
|
0
|
|
|
|
1
|
my $what = $items[0]->describe =~ /
|
|
|
0
|
|
|
|
|
|
713
|
|
|
|
|
|
|
? "a (which acts like an unconditional during parsing)" |
714
|
|
|
|
|
|
|
: $items[0]->describe =~ /
|
715
|
|
|
|
|
|
|
? "an (which acts like an unconditional during parsing)" |
716
|
|
|
|
|
|
|
: "an unconditional "; |
717
|
1
|
0
|
|
|
|
55
|
my $caveat = $items[0]->describe =~ /
|
718
|
|
|
|
|
|
|
? " after the specified variable was set up" |
719
|
|
|
|
|
|
|
: ""; |
720
|
1
|
0
|
|
|
|
4
|
my $advice = @items > 1 |
721
|
|
|
|
|
|
|
? "However, there were also other (useless) items after the leading " |
722
|
|
|
|
|
|
|
. $items[0]->describe |
723
|
|
|
|
|
|
|
. ", so you may have been expecting some other behaviour." |
724
|
|
|
|
|
|
|
: "You can safely ignore this message."; |
725
|
1
|
|
|
|
|
2
|
Parse::RecDescent::_hint("The production starts with $what. That means that the |
726
|
|
|
|
|
|
|
production can never successfully match, so it was |
727
|
|
|
|
|
|
|
optimized out of the final parser$caveat. $advice"); |
728
|
1
|
|
|
|
|
56
|
return 0; |
729
|
|
|
|
|
|
|
} |
730
|
1258
|
|
|
|
|
2217
|
return 1; |
731
|
|
|
|
|
|
|
} |
732
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
sub changesskip($) |
734
|
|
|
|
|
|
|
{ |
735
|
1258
|
|
|
1258
|
|
802
|
my $item; |
736
|
1258
|
|
|
|
|
925
|
foreach $item (@{$_[0]->{"items"}}) |
|
1258
|
|
|
|
|
1674
|
|
737
|
|
|
|
|
|
|
{ |
738
|
2314
|
100
|
|
|
|
5563
|
if (ref($item) =~ /Parse::RecDescent::(Action|Directive)/) |
739
|
|
|
|
|
|
|
{ |
740
|
99
|
100
|
|
|
|
350
|
return 1 if $item->{code} =~ /\$skip\s*=/; |
741
|
|
|
|
|
|
|
} |
742
|
|
|
|
|
|
|
} |
743
|
1255
|
|
|
|
|
2554
|
return 0; |
744
|
|
|
|
|
|
|
} |
745
|
|
|
|
|
|
|
|
746
|
|
|
|
|
|
|
sub adddirective |
747
|
|
|
|
|
|
|
{ |
748
|
138
|
|
|
138
|
|
314
|
my ( $self, $whichop, $line, $name ) = @_; |
749
|
138
|
|
|
|
|
312
|
push @{$self->{op}}, |
750
|
|
|
|
|
|
|
{ type=>$whichop, line=>$line, name=>$name, |
751
|
138
|
|
|
|
|
232
|
offset=> scalar(@{$self->{items}}) }; |
|
138
|
|
|
|
|
507
|
|
752
|
|
|
|
|
|
|
} |
753
|
|
|
|
|
|
|
|
754
|
|
|
|
|
|
|
sub addscore |
755
|
|
|
|
|
|
|
{ |
756
|
1
|
|
|
1
|
|
80
|
my ( $self, $code, $lookahead, $line ) = @_; |
757
|
|
|
|
|
|
|
$self->additem(Parse::RecDescent::Directive->new( |
758
|
|
|
|
|
|
|
"local \$^W; |
759
|
|
|
|
|
|
|
my \$thisscore = do { $code } + 0; |
760
|
|
|
|
|
|
|
if (!defined(\$score) || \$thisscore>\$score) |
761
|
|
|
|
|
|
|
{ \$score=\$thisscore; \$score_return=\$item[-1]; } |
762
|
|
|
|
|
|
|
undef;", $lookahead, $line,"") ) |
763
|
1
|
0
|
|
|
|
4
|
unless $self->{items}[-1]->describe =~ /
|
764
|
1
|
|
|
|
|
1
|
return 1; |
765
|
|
|
|
|
|
|
} |
766
|
|
|
|
|
|
|
|
767
|
|
|
|
|
|
|
sub check_pending |
768
|
|
|
|
|
|
|
{ |
769
|
1187
|
|
|
1187
|
|
1263
|
my ( $self, $line ) = @_; |
770
|
1187
|
100
|
|
|
|
1907
|
if ($self->{op}) |
771
|
|
|
|
|
|
|
{ |
772
|
138
|
|
|
|
|
127
|
while (my $next = pop @{$self->{op}}) |
|
138
|
|
|
|
|
294
|
|
773
|
|
|
|
|
|
|
{ |
774
|
1
|
|
|
|
|
111
|
Parse::RecDescent::_error("Incomplete <$next->{type}op:...>.", $line); |
775
|
1
|
|
|
|
|
7
|
Parse::RecDescent::_hint( |
776
|
|
|
|
|
|
|
"The current production ended without completing the |
777
|
|
|
|
|
|
|
<$next->{type}op:...> directive that started near line |
778
|
|
|
|
|
|
|
$next->{line}. Did you forget the closing '>'?"); |
779
|
|
|
|
|
|
|
} |
780
|
|
|
|
|
|
|
} |
781
|
1187
|
|
|
|
|
2517
|
return 1; |
782
|
|
|
|
|
|
|
} |
783
|
|
|
|
|
|
|
|
784
|
|
|
|
|
|
|
sub enddirective |
785
|
|
|
|
|
|
|
{ |
786
|
138
|
|
|
138
|
|
151
|
my ( $self, $line, $minrep, $maxrep ) = @_; |
787
|
138
|
50
|
|
|
|
262
|
unless ($self->{op}) |
788
|
|
|
|
|
|
|
{ |
789
|
1
|
|
|
|
|
55
|
Parse::RecDescent::_error("Unmatched > found.", $line); |
790
|
1
|
|
|
|
|
7
|
Parse::RecDescent::_hint( |
791
|
|
|
|
|
|
|
"A '>' angle bracket was encountered, which typically |
792
|
|
|
|
|
|
|
indicates the end of a directive. However no suitable |
793
|
|
|
|
|
|
|
preceding directive was encountered. Typically this |
794
|
|
|
|
|
|
|
indicates either a extra '>' in the grammar, or a |
795
|
|
|
|
|
|
|
problem inside the previous directive."); |
796
|
1
|
|
|
|
|
2
|
return; |
797
|
|
|
|
|
|
|
} |
798
|
138
|
|
|
|
|
160
|
my $op = pop @{$self->{op}}; |
|
138
|
|
|
|
|
197
|
|
799
|
138
|
|
|
|
|
108
|
my $span = @{$self->{items}} - $op->{offset}; |
|
138
|
|
|
|
|
262
|
|
800
|
138
|
50
|
|
|
|
562
|
if ($op->{type} =~ /left|right/) |
801
|
|
|
|
|
|
|
{ |
802
|
138
|
50
|
|
|
|
204
|
if ($span != 3) |
803
|
|
|
|
|
|
|
{ |
804
|
1
|
|
|
|
|
71
|
Parse::RecDescent::_error( |
805
|
|
|
|
|
|
|
"Incorrect <$op->{type}op:...> specification: |
806
|
|
|
|
|
|
|
expected 3 args, but found $span instead", $line); |
807
|
1
|
|
|
|
|
5
|
Parse::RecDescent::_hint( |
808
|
|
|
|
|
|
|
"The <$op->{type}op:...> directive requires a |
809
|
|
|
|
|
|
|
sequence of exactly three elements. For example: |
810
|
|
|
|
|
|
|
<$op->{type}op:leftarg /op/ rightarg>"); |
811
|
|
|
|
|
|
|
} |
812
|
|
|
|
|
|
|
else |
813
|
|
|
|
|
|
|
{ |
814
|
138
|
|
|
|
|
262
|
push @{$self->{items}}, |
815
|
|
|
|
|
|
|
Parse::RecDescent::Operator->new( |
816
|
138
|
|
|
|
|
103
|
$op->{type}, $minrep, $maxrep, splice(@{$self->{"items"}}, -3)); |
|
138
|
|
|
|
|
376
|
|
817
|
138
|
|
|
|
|
312
|
$self->{items}[-1]->sethashname($self); |
818
|
138
|
|
|
|
|
433
|
$self->{items}[-1]{name} = $op->{name}; |
819
|
|
|
|
|
|
|
} |
820
|
|
|
|
|
|
|
} |
821
|
|
|
|
|
|
|
} |
822
|
|
|
|
|
|
|
|
823
|
|
|
|
|
|
|
sub prevwasreturn |
824
|
|
|
|
|
|
|
{ |
825
|
1
|
|
|
1
|
|
5
|
my ( $self, $line ) = @_; |
826
|
1
|
0
|
|
|
|
2
|
unless (@{$self->{items}}) |
|
1
|
|
|
|
|
82
|
|
827
|
|
|
|
|
|
|
{ |
828
|
1
|
|
|
|
|
5
|
Parse::RecDescent::_error( |
829
|
|
|
|
|
|
|
"Incorrect specification: |
830
|
|
|
|
|
|
|
expected item missing", $line); |
831
|
1
|
|
|
|
|
2
|
Parse::RecDescent::_hint( |
832
|
|
|
|
|
|
|
"The directive requires a |
833
|
|
|
|
|
|
|
sequence of at least one item. For example: |
834
|
|
|
|
|
|
|
"); |
835
|
1
|
|
|
|
|
48
|
return; |
836
|
|
|
|
|
|
|
} |
837
|
1
|
|
|
|
|
8
|
push @{$self->{items}}, |
|
1
|
|
|
|
|
1
|
|
838
|
|
|
|
|
|
|
Parse::RecDescent::Result->new(); |
839
|
|
|
|
|
|
|
} |
840
|
|
|
|
|
|
|
|
841
|
|
|
|
|
|
|
sub additem |
842
|
|
|
|
|
|
|
{ |
843
|
2591
|
|
|
2591
|
|
2697
|
my ( $self, $item ) = @_; |
844
|
2591
|
|
|
|
|
3466
|
$item->sethashname($self); |
845
|
2591
|
|
|
|
|
2070
|
push @{$self->{"items"}}, $item; |
|
2591
|
|
|
|
|
3832
|
|
846
|
2591
|
|
|
|
|
6717
|
return $item; |
847
|
|
|
|
|
|
|
} |
848
|
|
|
|
|
|
|
|
849
|
|
|
|
|
|
|
sub _duplicate_itempos |
850
|
|
|
|
|
|
|
{ |
851
|
12
|
|
|
12
|
|
14
|
my ($src) = @_; |
852
|
12
|
|
|
|
|
60
|
my $dst = {}; |
853
|
|
|
|
|
|
|
|
854
|
12
|
|
|
|
|
29
|
foreach (keys %$src) |
855
|
|
|
|
|
|
|
{ |
856
|
34
|
|
|
|
|
24
|
%{$dst->{$_}} = %{$src->{$_}}; |
|
34
|
|
|
|
|
130
|
|
|
34
|
|
|
|
|
43
|
|
857
|
|
|
|
|
|
|
} |
858
|
12
|
|
|
|
|
156
|
$dst; |
859
|
|
|
|
|
|
|
} |
860
|
|
|
|
|
|
|
|
861
|
|
|
|
|
|
|
sub _update_itempos |
862
|
|
|
|
|
|
|
{ |
863
|
178
|
|
|
178
|
|
232
|
my ($dst, $src, $typekeys, $poskeys) = @_; |
864
|
|
|
|
|
|
|
|
865
|
178
|
50
|
|
|
|
510
|
my @typekeys = 'ARRAY' eq ref $typekeys ? |
866
|
|
|
|
|
|
|
@$typekeys : |
867
|
|
|
|
|
|
|
keys %$src; |
868
|
|
|
|
|
|
|
|
869
|
178
|
|
|
|
|
265
|
foreach my $k (keys %$src) |
870
|
|
|
|
|
|
|
{ |
871
|
532
|
50
|
|
|
|
893
|
if ('ARRAY' eq ref $poskeys) |
872
|
|
|
|
|
|
|
{ |
873
|
532
|
|
|
|
|
325
|
@{$dst->{$k}}{@$poskeys} = @{$src->{$k}}{@$poskeys}; |
|
532
|
|
|
|
|
3242
|
|
|
532
|
|
|
|
|
536
|
|
874
|
|
|
|
|
|
|
} |
875
|
|
|
|
|
|
|
else |
876
|
|
|
|
|
|
|
{ |
877
|
1
|
|
|
|
|
5
|
%{$dst->{$k}} = %{$src->{$k}}; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
84
|
|
878
|
|
|
|
|
|
|
} |
879
|
|
|
|
|
|
|
} |
880
|
|
|
|
|
|
|
} |
881
|
|
|
|
|
|
|
|
882
|
|
|
|
|
|
|
sub preitempos |
883
|
|
|
|
|
|
|
{ |
884
|
|
|
|
|
|
|
return q |
885
|
113
|
|
|
113
|
|
113
|
{ |
886
|
|
|
|
|
|
|
push @itempos, {'offset' => {'from'=>$thisoffset, 'to'=>undef}, |
887
|
|
|
|
|
|
|
'line' => {'from'=>$thisline, 'to'=>undef}, |
888
|
|
|
|
|
|
|
'column' => {'from'=>$thiscolumn, 'to'=>undef} }; |
889
|
|
|
|
|
|
|
} |
890
|
|
|
|
|
|
|
} |
891
|
|
|
|
|
|
|
|
892
|
|
|
|
|
|
|
sub incitempos |
893
|
|
|
|
|
|
|
{ |
894
|
|
|
|
|
|
|
return q |
895
|
58
|
|
|
58
|
|
210
|
{ |
896
|
|
|
|
|
|
|
$itempos[$#itempos]{'offset'}{'from'} += length($lastsep); |
897
|
|
|
|
|
|
|
$itempos[$#itempos]{'line'}{'from'} = $thisline; |
898
|
|
|
|
|
|
|
$itempos[$#itempos]{'column'}{'from'} = $thiscolumn; |
899
|
|
|
|
|
|
|
} |
900
|
|
|
|
|
|
|
} |
901
|
|
|
|
|
|
|
|
902
|
|
|
|
|
|
|
sub unincitempos |
903
|
|
|
|
|
|
|
{ |
904
|
|
|
|
|
|
|
# the next incitempos will properly set these two fields, but |
905
|
|
|
|
|
|
|
# {'offset'}{'from'} needs to be decreased by length($lastsep) |
906
|
|
|
|
|
|
|
# $itempos[$#itempos]{'line'}{'from'} |
907
|
|
|
|
|
|
|
# $itempos[$#itempos]{'column'}{'from'} |
908
|
|
|
|
|
|
|
return q |
909
|
58
|
|
|
58
|
|
252
|
{ |
910
|
|
|
|
|
|
|
$itempos[$#itempos]{'offset'}{'from'} -= length($lastsep) if defined $lastsep; |
911
|
|
|
|
|
|
|
} |
912
|
|
|
|
|
|
|
} |
913
|
|
|
|
|
|
|
|
914
|
|
|
|
|
|
|
sub postitempos |
915
|
|
|
|
|
|
|
{ |
916
|
|
|
|
|
|
|
return q |
917
|
113
|
|
|
113
|
|
134
|
{ |
918
|
|
|
|
|
|
|
$itempos[$#itempos]{'offset'}{'to'} = $prevoffset; |
919
|
|
|
|
|
|
|
$itempos[$#itempos]{'line'}{'to'} = $prevline; |
920
|
|
|
|
|
|
|
$itempos[$#itempos]{'column'}{'to'} = $prevcolumn; |
921
|
|
|
|
|
|
|
} |
922
|
|
|
|
|
|
|
} |
923
|
|
|
|
|
|
|
|
924
|
|
|
|
|
|
|
sub code($$$$) |
925
|
|
|
|
|
|
|
{ |
926
|
1258
|
|
|
1258
|
|
1196
|
my ($self,$namespace,$rule,$parser) = @_; |
927
|
|
|
|
|
|
|
my $code = |
928
|
|
|
|
|
|
|
' |
929
|
|
|
|
|
|
|
while (!$_matched' |
930
|
|
|
|
|
|
|
. (defined $self->{"uncommit"} ? '' : ' && !$commit') |
931
|
|
|
|
|
|
|
. ') |
932
|
|
|
|
|
|
|
{ |
933
|
|
|
|
|
|
|
' . |
934
|
|
|
|
|
|
|
($self->changesskip() |
935
|
|
|
|
|
|
|
? 'local $skip = defined($skip) ? $skip : $Parse::RecDescent::skip;' |
936
|
|
|
|
|
|
|
: '') .' |
937
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{Trying production: [' |
938
|
|
|
|
|
|
|
. $self->describe . ']}, |
939
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($_[1]), |
940
|
|
|
|
|
|
|
q{' . $rule ->{name}. '}, |
941
|
|
|
|
|
|
|
$tracelevel) |
942
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
943
|
|
|
|
|
|
|
my $thisprod = $thisrule->{"prods"}[' . $self->{"number"} . ']; |
944
|
|
|
|
|
|
|
' . (defined $self->{"error"} ? '' : '$text = $_[1];' ) . ' |
945
|
|
|
|
|
|
|
my $_savetext; |
946
|
|
|
|
|
|
|
@item = (q{' . $rule->{"name"} . '}); |
947
|
1258
|
100
|
|
|
|
2843
|
%item = (__RULE__ => q{' . $rule->{"name"} . '}); |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
948
|
|
|
|
|
|
|
my $repcount = 0; |
949
|
|
|
|
|
|
|
|
950
|
|
|
|
|
|
|
'; |
951
|
|
|
|
|
|
|
$code .= |
952
|
|
|
|
|
|
|
' my @itempos = ({}); |
953
|
1258
|
100
|
|
|
|
2200
|
' if $parser->{_check}{itempos}; |
954
|
|
|
|
|
|
|
|
955
|
1258
|
|
|
|
|
824
|
my $item; |
956
|
|
|
|
|
|
|
my $i; |
957
|
|
|
|
|
|
|
|
958
|
1258
|
|
|
|
|
1186
|
for ($i = 0; $i < @{$self->{"items"}}; $i++) |
|
3580
|
|
|
|
|
5191
|
|
959
|
|
|
|
|
|
|
{ |
960
|
2323
|
|
|
|
|
1455
|
$item = ${$self->{items}}[$i]; |
|
2323
|
|
|
|
|
2067
|
|
961
|
|
|
|
|
|
|
|
962
|
2323
|
100
|
|
|
|
3129
|
$code .= preitempos() if $parser->{_check}{itempos}; |
963
|
|
|
|
|
|
|
|
964
|
2323
|
|
|
|
|
3397
|
$code .= $item->code($namespace,$rule,$parser->{_check}); |
965
|
|
|
|
|
|
|
|
966
|
2323
|
100
|
|
|
|
3941
|
$code .= postitempos() if $parser->{_check}{itempos}; |
967
|
|
|
|
|
|
|
|
968
|
|
|
|
|
|
|
} |
969
|
|
|
|
|
|
|
|
970
|
1258
|
50
|
33
|
|
|
4601
|
if ($parser->{_AUTOACTION} && defined($item) && !$item->isa("Parse::RecDescent::Action")) |
|
|
100
|
33
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
66
|
|
|
|
|
971
|
|
|
|
|
|
|
{ |
972
|
1
|
|
|
|
|
2
|
$code .= $parser->{_AUTOACTION}->code($namespace,$rule); |
973
|
1
|
0
|
|
|
|
109
|
Parse::RecDescent::_warn(1,"Autogenerating action in rule |
974
|
|
|
|
|
|
|
\"$rule->{name}\": |
975
|
|
|
|
|
|
|
$parser->{_AUTOACTION}{code}") |
976
|
|
|
|
|
|
|
and |
977
|
|
|
|
|
|
|
Parse::RecDescent::_hint("The \$::RD_AUTOACTION was defined, |
978
|
|
|
|
|
|
|
so any production not ending in an |
979
|
|
|
|
|
|
|
explicit action has the specified |
980
|
|
|
|
|
|
|
\"auto-action\" automatically |
981
|
|
|
|
|
|
|
appended."); |
982
|
|
|
|
|
|
|
} |
983
|
|
|
|
|
|
|
elsif ($parser->{_AUTOTREE} && defined($item) && !$item->isa("Parse::RecDescent::Action")) |
984
|
|
|
|
|
|
|
{ |
985
|
28
|
100
|
100
|
|
|
60
|
if ($i==1 && $item->isterminal) |
986
|
|
|
|
|
|
|
{ |
987
|
7
|
|
|
|
|
12
|
$code .= $parser->{_AUTOTREE}{TERMINAL}->code($namespace,$rule); |
988
|
|
|
|
|
|
|
} |
989
|
|
|
|
|
|
|
else |
990
|
|
|
|
|
|
|
{ |
991
|
22
|
|
|
|
|
113
|
$code .= $parser->{_AUTOTREE}{NODE}->code($namespace,$rule); |
992
|
|
|
|
|
|
|
} |
993
|
28
|
50
|
|
|
|
62
|
Parse::RecDescent::_warn(1,"Autogenerating tree-building action in rule |
994
|
|
|
|
|
|
|
\"$rule->{name}\"") |
995
|
|
|
|
|
|
|
and |
996
|
|
|
|
|
|
|
Parse::RecDescent::_hint("The directive was specified, |
997
|
|
|
|
|
|
|
so any production not ending |
998
|
|
|
|
|
|
|
in an explicit action has |
999
|
|
|
|
|
|
|
some parse-tree building code |
1000
|
|
|
|
|
|
|
automatically appended."); |
1001
|
|
|
|
|
|
|
} |
1002
|
|
|
|
|
|
|
|
1003
|
|
|
|
|
|
|
$code .= |
1004
|
|
|
|
|
|
|
' |
1005
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{>>'.Parse::RecDescent::_matchtracemessage($self).' production: [' |
1006
|
|
|
|
|
|
|
. $self->describe . ']<<}, |
1007
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1008
|
|
|
|
|
|
|
q{' . $rule->{name} . '}, |
1009
|
|
|
|
|
|
|
$tracelevel) |
1010
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1011
|
|
|
|
|
|
|
|
1012
|
1258
|
100
|
|
|
|
1426
|
' . ( $parser->{_check}{itempos} ? ' |
1013
|
|
|
|
|
|
|
if ( defined($_itempos) ) |
1014
|
|
|
|
|
|
|
{ |
1015
|
|
|
|
|
|
|
Parse::RecDescent::Production::_update_itempos($_itempos, $itempos[ 1], undef, [qw(from)]); |
1016
|
|
|
|
|
|
|
Parse::RecDescent::Production::_update_itempos($_itempos, $itempos[-1], undef, [qw(to)]); |
1017
|
|
|
|
|
|
|
} |
1018
|
|
|
|
|
|
|
' : '' ) . ' |
1019
|
|
|
|
|
|
|
|
1020
|
|
|
|
|
|
|
$_matched = 1; |
1021
|
|
|
|
|
|
|
last; |
1022
|
|
|
|
|
|
|
} |
1023
|
|
|
|
|
|
|
|
1024
|
|
|
|
|
|
|
'; |
1025
|
1258
|
|
|
|
|
3882
|
return $code; |
1026
|
|
|
|
|
|
|
} |
1027
|
|
|
|
|
|
|
|
1028
|
|
|
|
|
|
|
1; |
1029
|
|
|
|
|
|
|
|
1030
|
|
|
|
|
|
|
package Parse::RecDescent::Action; |
1031
|
|
|
|
|
|
|
|
1032
|
177
|
|
|
177
|
|
1126
|
sub describe { undef } |
1033
|
|
|
|
|
|
|
|
1034
|
85
|
|
|
85
|
|
299
|
sub sethashname { $_[0]->{hashname} = '__ACTION' . ++$_[1]->{actcount} .'__'; } |
1035
|
|
|
|
|
|
|
|
1036
|
|
|
|
|
|
|
sub new |
1037
|
|
|
|
|
|
|
{ |
1038
|
92
|
|
33
|
92
|
|
290
|
my $class = ref($_[0]) || $_[0]; |
1039
|
92
|
|
|
|
|
324
|
bless |
1040
|
|
|
|
|
|
|
{ |
1041
|
|
|
|
|
|
|
"code" => $_[1], |
1042
|
|
|
|
|
|
|
"lookahead" => $_[2], |
1043
|
|
|
|
|
|
|
"line" => $_[3], |
1044
|
|
|
|
|
|
|
}, $class; |
1045
|
|
|
|
|
|
|
} |
1046
|
|
|
|
|
|
|
|
1047
|
5
|
|
|
5
|
|
4
|
sub issubrule { undef } |
1048
|
1
|
|
|
1
|
|
75
|
sub isterminal { 0 } |
1049
|
|
|
|
|
|
|
|
1050
|
|
|
|
|
|
|
sub code($$$$) |
1051
|
|
|
|
|
|
|
{ |
1052
|
113
|
|
|
113
|
|
135
|
my ($self, $namespace, $rule) = @_; |
1053
|
|
|
|
|
|
|
|
1054
|
|
|
|
|
|
|
' |
1055
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{Trying action}, |
1056
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1057
|
|
|
|
|
|
|
q{' . $rule->{name} . '}, |
1058
|
|
|
|
|
|
|
$tracelevel) |
1059
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1060
|
|
|
|
|
|
|
' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) .' |
1061
|
|
|
|
|
|
|
|
1062
|
|
|
|
|
|
|
$_tok = ($_noactions) ? 0 : do ' . $self->{"code"} . '; |
1063
|
|
|
|
|
|
|
' . ($self->{"lookahead"}<0?'if':'unless') . ' (defined $_tok) |
1064
|
|
|
|
|
|
|
{ |
1065
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{<<'.Parse::RecDescent::_matchtracemessage($self,1).' action>> (return value: [undef])}) |
1066
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1067
|
|
|
|
|
|
|
last; |
1068
|
|
|
|
|
|
|
} |
1069
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{>>'.Parse::RecDescent::_matchtracemessage($self).' action<< (return value: [} |
1070
|
|
|
|
|
|
|
. $_tok . q{])}, |
1071
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text)) |
1072
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1073
|
|
|
|
|
|
|
push @item, $_tok; |
1074
|
|
|
|
|
|
|
' . ($self->{line}>=0 ? '$item{'. $self->{hashname} .'}=$_tok;' : '' ) .' |
1075
|
113
|
50
|
|
|
|
499
|
' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .' |
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1076
|
|
|
|
|
|
|
' |
1077
|
|
|
|
|
|
|
} |
1078
|
|
|
|
|
|
|
|
1079
|
|
|
|
|
|
|
|
1080
|
|
|
|
|
|
|
1; |
1081
|
|
|
|
|
|
|
|
1082
|
|
|
|
|
|
|
package Parse::RecDescent::Directive; |
1083
|
|
|
|
|
|
|
|
1084
|
17
|
|
|
17
|
|
138
|
sub sethashname { $_[0]->{hashname} = '__DIRECTIVE' . ++$_[1]->{dircount} . '__'; } |
1085
|
|
|
|
|
|
|
|
1086
|
20
|
|
|
20
|
|
22
|
sub issubrule { undef } |
1087
|
1
|
|
|
1
|
|
2
|
sub isterminal { 0 } |
1088
|
80
|
100
|
|
80
|
|
326
|
sub describe { $_[1] ? '' : $_[0]->{name} } |
1089
|
|
|
|
|
|
|
|
1090
|
|
|
|
|
|
|
sub new ($$$$$) |
1091
|
|
|
|
|
|
|
{ |
1092
|
24
|
|
33
|
24
|
|
76
|
my $class = ref($_[0]) || $_[0]; |
1093
|
24
|
|
|
|
|
113
|
bless |
1094
|
|
|
|
|
|
|
{ |
1095
|
|
|
|
|
|
|
"code" => $_[1], |
1096
|
|
|
|
|
|
|
"lookahead" => $_[2], |
1097
|
|
|
|
|
|
|
"line" => $_[3], |
1098
|
|
|
|
|
|
|
"name" => $_[4], |
1099
|
|
|
|
|
|
|
}, $class; |
1100
|
|
|
|
|
|
|
} |
1101
|
|
|
|
|
|
|
|
1102
|
|
|
|
|
|
|
sub code($$$$) |
1103
|
|
|
|
|
|
|
{ |
1104
|
24
|
|
|
24
|
|
111
|
my ($self, $namespace, $rule) = @_; |
1105
|
|
|
|
|
|
|
|
1106
|
|
|
|
|
|
|
' |
1107
|
|
|
|
|
|
|
' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) .' |
1108
|
|
|
|
|
|
|
|
1109
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{Trying directive: [' |
1110
|
|
|
|
|
|
|
. $self->describe . ']}, |
1111
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1112
|
|
|
|
|
|
|
q{' . $rule->{name} . '}, |
1113
|
|
|
|
|
|
|
$tracelevel) |
1114
|
|
|
|
|
|
|
if defined $::RD_TRACE; ' .' |
1115
|
|
|
|
|
|
|
$_tok = do { ' . $self->{"code"} . ' }; |
1116
|
|
|
|
|
|
|
if (defined($_tok)) |
1117
|
|
|
|
|
|
|
{ |
1118
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{>>'.Parse::RecDescent::_matchtracemessage($self).' directive<< (return value: [} |
1119
|
|
|
|
|
|
|
. $_tok . q{])}, |
1120
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text)) |
1121
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1122
|
|
|
|
|
|
|
} |
1123
|
|
|
|
|
|
|
else |
1124
|
|
|
|
|
|
|
{ |
1125
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{<<'.Parse::RecDescent::_matchtracemessage($self,1).' directive>>}, |
1126
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text)) |
1127
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1128
|
|
|
|
|
|
|
} |
1129
|
|
|
|
|
|
|
' . ($self->{"lookahead"} ? '$text = $_savetext and ' : '' ) .' |
1130
|
|
|
|
|
|
|
last ' |
1131
|
|
|
|
|
|
|
. ($self->{"lookahead"}<0?'if':'unless') . ' defined $_tok; |
1132
|
|
|
|
|
|
|
push @item, $item{'.$self->{hashname}.'}=$_tok; |
1133
|
24
|
50
|
|
|
|
101
|
' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .' |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1134
|
|
|
|
|
|
|
' |
1135
|
|
|
|
|
|
|
} |
1136
|
|
|
|
|
|
|
|
1137
|
|
|
|
|
|
|
1; |
1138
|
|
|
|
|
|
|
|
1139
|
|
|
|
|
|
|
package Parse::RecDescent::UncondReject; |
1140
|
|
|
|
|
|
|
|
1141
|
2
|
|
|
2
|
|
3
|
sub issubrule { undef } |
1142
|
1
|
|
|
1
|
|
70
|
sub isterminal { 0 } |
1143
|
9
|
100
|
|
9
|
|
51
|
sub describe { $_[1] ? '' : $_[0]->{name} } |
1144
|
3
|
|
|
3
|
|
16
|
sub sethashname { $_[0]->{hashname} = '__DIRECTIVE' . ++$_[1]->{dircount} . '__'; } |
1145
|
|
|
|
|
|
|
|
1146
|
|
|
|
|
|
|
sub new ($$$;$) |
1147
|
|
|
|
|
|
|
{ |
1148
|
3
|
|
33
|
3
|
|
63
|
my $class = ref($_[0]) || $_[0]; |
1149
|
3
|
|
|
|
|
16
|
bless |
1150
|
|
|
|
|
|
|
{ |
1151
|
|
|
|
|
|
|
"lookahead" => $_[1], |
1152
|
|
|
|
|
|
|
"line" => $_[2], |
1153
|
|
|
|
|
|
|
"name" => $_[3], |
1154
|
|
|
|
|
|
|
}, $class; |
1155
|
|
|
|
|
|
|
} |
1156
|
|
|
|
|
|
|
|
1157
|
|
|
|
|
|
|
# MARK, YOU MAY WANT TO OPTIMIZE THIS. |
1158
|
|
|
|
|
|
|
|
1159
|
|
|
|
|
|
|
|
1160
|
|
|
|
|
|
|
sub code($$$$) |
1161
|
|
|
|
|
|
|
{ |
1162
|
3
|
|
|
3
|
|
5
|
my ($self, $namespace, $rule) = @_; |
1163
|
|
|
|
|
|
|
|
1164
|
|
|
|
|
|
|
' |
1165
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{>>Rejecting production<< (found ' |
1166
|
|
|
|
|
|
|
. $self->describe . ')}, |
1167
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1168
|
|
|
|
|
|
|
q{' . $rule->{name} . '}, |
1169
|
|
|
|
|
|
|
$tracelevel) |
1170
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1171
|
|
|
|
|
|
|
undef $return; |
1172
|
|
|
|
|
|
|
' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) .' |
1173
|
|
|
|
|
|
|
|
1174
|
|
|
|
|
|
|
$_tok = undef; |
1175
|
|
|
|
|
|
|
' . ($self->{"lookahead"} ? '$text = $_savetext and ' : '' ) .' |
1176
|
|
|
|
|
|
|
last ' |
1177
|
3
|
50
|
|
|
|
52
|
. ($self->{"lookahead"}<0?'if':'unless') . ' defined $_tok; |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1178
|
|
|
|
|
|
|
' |
1179
|
|
|
|
|
|
|
} |
1180
|
|
|
|
|
|
|
|
1181
|
|
|
|
|
|
|
1; |
1182
|
|
|
|
|
|
|
|
1183
|
|
|
|
|
|
|
package Parse::RecDescent::Error; |
1184
|
|
|
|
|
|
|
|
1185
|
8
|
|
|
8
|
|
15
|
sub issubrule { undef } |
1186
|
1
|
|
|
1
|
|
1
|
sub isterminal { 0 } |
1187
|
43
|
50
|
|
43
|
|
266
|
sub describe { $_[1] ? '' : $_[0]->{commitonly} ? '' : '' } |
|
|
100
|
|
|
|
|
|
1188
|
8
|
|
|
8
|
|
32
|
sub sethashname { $_[0]->{hashname} = '__DIRECTIVE' . ++$_[1]->{dircount} . '__'; } |
1189
|
|
|
|
|
|
|
|
1190
|
|
|
|
|
|
|
sub new ($$$$$) |
1191
|
|
|
|
|
|
|
{ |
1192
|
8
|
|
33
|
8
|
|
26
|
my $class = ref($_[0]) || $_[0]; |
1193
|
8
|
|
|
|
|
85
|
bless |
1194
|
|
|
|
|
|
|
{ |
1195
|
|
|
|
|
|
|
"msg" => $_[1], |
1196
|
|
|
|
|
|
|
"lookahead" => $_[2], |
1197
|
|
|
|
|
|
|
"commitonly" => $_[3], |
1198
|
|
|
|
|
|
|
"line" => $_[4], |
1199
|
|
|
|
|
|
|
}, $class; |
1200
|
|
|
|
|
|
|
} |
1201
|
|
|
|
|
|
|
|
1202
|
|
|
|
|
|
|
sub code($$$$) |
1203
|
|
|
|
|
|
|
{ |
1204
|
8
|
|
|
8
|
|
19
|
my ($self, $namespace, $rule) = @_; |
1205
|
|
|
|
|
|
|
|
1206
|
8
|
|
|
|
|
9
|
my $action = ''; |
1207
|
|
|
|
|
|
|
|
1208
|
8
|
50
|
|
|
|
78
|
if ($self->{"msg"}) # ERROR MESSAGE SUPPLIED |
1209
|
|
|
|
|
|
|
{ |
1210
|
|
|
|
|
|
|
#WAS: $action .= "Parse::RecDescent::_error(qq{$self->{msg}}" . ',$thisline);'; |
1211
|
1
|
|
|
|
|
5
|
$action .= 'push @{$thisparser->{errors}}, [qq{'.$self->{msg}.'},$thisline];'; |
1212
|
|
|
|
|
|
|
|
1213
|
|
|
|
|
|
|
} |
1214
|
|
|
|
|
|
|
else # GENERATE ERROR MESSAGE DURING PARSE |
1215
|
|
|
|
|
|
|
{ |
1216
|
8
|
|
|
|
|
12
|
$action .= ' |
1217
|
|
|
|
|
|
|
my $rule = $item[0]; |
1218
|
|
|
|
|
|
|
$rule =~ s/_/ /g; |
1219
|
|
|
|
|
|
|
#WAS: Parse::RecDescent::_error("Invalid $rule: " . $expectation->message() ,$thisline); |
1220
|
|
|
|
|
|
|
push @{$thisparser->{errors}}, ["Invalid $rule: " . $expectation->message() ,$thisline]; |
1221
|
|
|
|
|
|
|
'; |
1222
|
|
|
|
|
|
|
} |
1223
|
|
|
|
|
|
|
|
1224
|
|
|
|
|
|
|
my $dir = |
1225
|
|
|
|
|
|
|
new Parse::RecDescent::Directive('if (' . |
1226
|
|
|
|
|
|
|
($self->{"commitonly"} ? '$commit' : '1') . |
1227
|
|
|
|
|
|
|
") { do {$action} unless ".' $_noactions; undef } else {0}', |
1228
|
8
|
50
|
|
|
|
95
|
$self->{"lookahead"},0,$self->describe); |
1229
|
8
|
|
|
|
|
21
|
$dir->{hashname} = $self->{hashname}; |
1230
|
8
|
|
|
|
|
20
|
return $dir->code($namespace, $rule, 0); |
1231
|
|
|
|
|
|
|
} |
1232
|
|
|
|
|
|
|
|
1233
|
|
|
|
|
|
|
1; |
1234
|
|
|
|
|
|
|
|
1235
|
|
|
|
|
|
|
package Parse::RecDescent::Token; |
1236
|
|
|
|
|
|
|
|
1237
|
209
|
|
|
209
|
|
1295
|
sub sethashname { $_[0]->{hashname} = '__PATTERN' . ++$_[1]->{patcount} . '__'; } |
1238
|
|
|
|
|
|
|
|
1239
|
442
|
|
|
442
|
|
304
|
sub issubrule { undef } |
1240
|
144
|
|
|
144
|
|
697
|
sub isterminal { 1 } |
1241
|
827
|
|
|
827
|
|
3356
|
sub describe ($) { shift->{'description'}} |
1242
|
|
|
|
|
|
|
|
1243
|
|
|
|
|
|
|
|
1244
|
|
|
|
|
|
|
# ARGS ARE: $self, $pattern, $left_delim, $modifiers, $lookahead, $linenum |
1245
|
|
|
|
|
|
|
sub new ($$$$$$) |
1246
|
|
|
|
|
|
|
{ |
1247
|
209
|
|
33
|
209
|
|
413
|
my $class = ref($_[0]) || $_[0]; |
1248
|
209
|
|
|
|
|
257
|
my $pattern = $_[1]; |
1249
|
209
|
|
|
|
|
267
|
my $pat = $_[1]; |
1250
|
209
|
|
|
|
|
181
|
my $ldel = $_[2]; |
1251
|
209
|
|
|
|
|
187
|
my $rdel = $ldel; |
1252
|
209
|
|
|
|
|
307
|
$rdel =~ tr/{[(}])>/; |
1253
|
|
|
|
|
|
|
|
1254
|
209
|
|
|
|
|
180
|
my $mod = $_[3]; |
1255
|
|
|
|
|
|
|
|
1256
|
209
|
|
|
|
|
177
|
my $desc; |
1257
|
|
|
|
|
|
|
|
1258
|
209
|
50
|
|
|
|
434
|
if ($ldel eq '/') { $desc = "$ldel$pattern$rdel$mod" } |
|
209
|
|
|
|
|
326
|
|
1259
|
1
|
|
|
|
|
1
|
else { $desc = "m$ldel$pattern$rdel$mod" } |
1260
|
209
|
|
|
|
|
540
|
$desc =~ s/\\/\\\\/g; |
1261
|
209
|
|
|
|
|
202
|
$desc =~ s/\$$/\\\$/g; |
1262
|
209
|
|
|
|
|
190
|
$desc =~ s/}/\\}/g; |
1263
|
209
|
|
|
|
|
273
|
$desc =~ s/{/\\{/g; |
1264
|
|
|
|
|
|
|
|
1265
|
209
|
50
|
66
|
16
|
|
12879
|
if (!eval "no strict; |
|
16
|
|
|
13
|
|
59
|
|
|
16
|
|
|
8
|
|
24
|
|
|
16
|
|
|
8
|
|
622
|
|
|
15
|
|
|
6
|
|
48
|
|
|
15
|
|
|
6
|
|
29
|
|
|
15
|
|
|
7
|
|
529
|
|
|
13
|
|
|
6
|
|
40
|
|
|
13
|
|
|
3
|
|
21
|
|
|
9
|
|
|
3
|
|
360
|
|
|
13
|
|
|
3
|
|
41
|
|
|
16
|
|
|
2
|
|
20
|
|
|
11
|
|
|
|
|
436
|
|
|
9
|
|
|
|
|
28
|
|
|
9
|
|
|
|
|
9
|
|
|
14
|
|
|
|
|
281
|
|
|
8
|
|
|
|
|
22
|
|
|
8
|
|
|
|
|
16
|
|
|
13
|
|
|
|
|
258
|
|
|
12
|
|
|
|
|
30
|
|
|
12
|
|
|
|
|
18
|
|
|
12
|
|
|
|
|
205
|
|
|
7
|
|
|
|
|
65
|
|
|
3
|
|
|
|
|
3
|
|
|
12
|
|
|
|
|
187
|
|
|
5
|
|
|
|
|
20
|
|
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
199
|
|
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
143
|
|
|
12
|
|
|
|
|
47
|
|
|
12
|
|
|
|
|
14
|
|
|
10
|
|
|
|
|
3691
|
|
|
11
|
|
|
|
|
43
|
|
|
11
|
|
|
|
|
16
|
|
|
11
|
|
|
|
|
2971
|
|
1266
|
|
|
|
|
|
|
local \$SIG{__WARN__} = sub {0}; |
1267
|
|
|
|
|
|
|
'' =~ m$ldel$pattern$rdel$mod" and $@) |
1268
|
|
|
|
|
|
|
{ |
1269
|
1
|
|
|
|
|
1
|
Parse::RecDescent::_warn(3, "Token pattern \"m$ldel$pattern$rdel$mod\" |
1270
|
|
|
|
|
|
|
may not be a valid regular expression", |
1271
|
|
|
|
|
|
|
$_[5]); |
1272
|
1
|
|
|
|
|
70
|
$@ =~ s/ at \(eval.*/./; |
1273
|
1
|
|
|
|
|
4
|
Parse::RecDescent::_hint($@); |
1274
|
|
|
|
|
|
|
} |
1275
|
|
|
|
|
|
|
|
1276
|
|
|
|
|
|
|
# QUIETLY PREVENT (WELL-INTENTIONED) CALAMITY |
1277
|
209
|
|
|
|
|
343
|
$mod =~ s/[gc]//g; |
1278
|
209
|
|
|
|
|
416
|
$pattern =~ s/(\A|[^\\])\\G/$1/g; |
1279
|
|
|
|
|
|
|
|
1280
|
208
|
|
|
|
|
1089
|
bless |
1281
|
|
|
|
|
|
|
{ |
1282
|
|
|
|
|
|
|
"pattern" => $pattern, |
1283
|
|
|
|
|
|
|
"ldelim" => $ldel, |
1284
|
|
|
|
|
|
|
"rdelim" => $rdel, |
1285
|
|
|
|
|
|
|
"mod" => $mod, |
1286
|
|
|
|
|
|
|
"lookahead" => $_[4], |
1287
|
|
|
|
|
|
|
"line" => $_[5], |
1288
|
|
|
|
|
|
|
"description" => $desc, |
1289
|
|
|
|
|
|
|
}, $class; |
1290
|
|
|
|
|
|
|
} |
1291
|
|
|
|
|
|
|
|
1292
|
|
|
|
|
|
|
|
1293
|
|
|
|
|
|
|
sub code($$$$$) |
1294
|
|
|
|
|
|
|
{ |
1295
|
209
|
|
|
210
|
|
202
|
my ($self, $namespace, $rule, $check) = @_; |
1296
|
209
|
|
|
|
|
330
|
my $ldel = $self->{"ldelim"}; |
1297
|
209
|
|
|
|
|
285
|
my $rdel = $self->{"rdelim"}; |
1298
|
209
|
|
|
|
|
180
|
my $sdel = $ldel; |
1299
|
209
|
|
|
|
|
216
|
my $mod = $self->{"mod"}; |
1300
|
|
|
|
|
|
|
|
1301
|
209
|
|
|
|
|
349
|
$sdel =~ s/[[{(<]/{}/; |
1302
|
|
|
|
|
|
|
|
1303
|
|
|
|
|
|
|
my $code = ' |
1304
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{Trying terminal: [' . $self->describe |
1305
|
|
|
|
|
|
|
. ']}, Parse::RecDescent::_tracefirst($text), |
1306
|
|
|
|
|
|
|
q{' . $rule->{name} . '}, |
1307
|
|
|
|
|
|
|
$tracelevel) |
1308
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1309
|
|
|
|
|
|
|
undef $lastsep; |
1310
|
|
|
|
|
|
|
$expectation->is(q{' . ($rule->hasleftmost($self) ? '' |
1311
|
|
|
|
|
|
|
: $self->describe ) . '})->at($text); |
1312
|
|
|
|
|
|
|
' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) . ' |
1313
|
|
|
|
|
|
|
|
1314
|
|
|
|
|
|
|
' . ($self->{"lookahead"}<0?'if':'unless') |
1315
|
|
|
|
|
|
|
. ' ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and ' |
1316
|
|
|
|
|
|
|
. ($check->{itempos}? 'do {'.Parse::RecDescent::Production::incitempos().' 1} and ' : '') |
1317
|
|
|
|
|
|
|
. ' $text =~ m' . $ldel . '\A(?:' . $self->{"pattern"} . ')' . $rdel . $mod . ') |
1318
|
|
|
|
|
|
|
{ |
1319
|
|
|
|
|
|
|
'.($self->{"lookahead"} ? '$text = $_savetext;' : '$text = $lastsep . $text if defined $lastsep;') . |
1320
|
|
|
|
|
|
|
($check->{itempos} ? Parse::RecDescent::Production::unincitempos() : '') . ' |
1321
|
|
|
|
|
|
|
$expectation->failed(); |
1322
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{<>}, |
1323
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text)) |
1324
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1325
|
|
|
|
|
|
|
|
1326
|
|
|
|
|
|
|
last; |
1327
|
|
|
|
|
|
|
} |
1328
|
|
|
|
|
|
|
$current_match = substr($text, $-[0], $+[0] - $-[0]); |
1329
|
|
|
|
|
|
|
substr($text,0,length($current_match),q{}); |
1330
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} |
1331
|
|
|
|
|
|
|
. $current_match . q{])}, |
1332
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text)) |
1333
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1334
|
|
|
|
|
|
|
push @item, $item{'.$self->{hashname}.'}=$current_match; |
1335
|
209
|
100
|
|
|
|
301
|
' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .' |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1336
|
|
|
|
|
|
|
'; |
1337
|
|
|
|
|
|
|
|
1338
|
209
|
|
|
|
|
513
|
return $code; |
1339
|
|
|
|
|
|
|
} |
1340
|
|
|
|
|
|
|
|
1341
|
|
|
|
|
|
|
1; |
1342
|
|
|
|
|
|
|
|
1343
|
|
|
|
|
|
|
package Parse::RecDescent::Literal; |
1344
|
|
|
|
|
|
|
|
1345
|
919
|
|
|
920
|
|
2014
|
sub sethashname { $_[0]->{hashname} = '__STRING' . ++$_[1]->{strcount} . '__'; } |
1346
|
|
|
|
|
|
|
|
1347
|
2586
|
|
|
2587
|
|
1681
|
sub issubrule { undef } |
1348
|
0
|
|
|
1
|
|
0
|
sub isterminal { 1 } |
1349
|
4583
|
|
|
4584
|
|
14677
|
sub describe ($) { shift->{'description'} } |
1350
|
|
|
|
|
|
|
|
1351
|
|
|
|
|
|
|
sub new ($$$$) |
1352
|
|
|
|
|
|
|
{ |
1353
|
919
|
|
33
|
920
|
|
1504
|
my $class = ref($_[0]) || $_[0]; |
1354
|
|
|
|
|
|
|
|
1355
|
919
|
|
|
|
|
727
|
my $pattern = $_[1]; |
1356
|
|
|
|
|
|
|
|
1357
|
919
|
|
|
|
|
648
|
my $desc = $pattern; |
1358
|
919
|
|
|
|
|
868
|
$desc=~s/\\/\\\\/g; |
1359
|
919
|
|
|
|
|
678
|
$desc=~s/}/\\}/g; |
1360
|
919
|
|
|
|
|
745
|
$desc=~s/{/\\{/g; |
1361
|
|
|
|
|
|
|
|
1362
|
919
|
|
|
|
|
3488
|
bless |
1363
|
|
|
|
|
|
|
{ |
1364
|
|
|
|
|
|
|
"pattern" => $pattern, |
1365
|
|
|
|
|
|
|
"lookahead" => $_[2], |
1366
|
|
|
|
|
|
|
"line" => $_[3], |
1367
|
|
|
|
|
|
|
"description" => "'$desc'", |
1368
|
|
|
|
|
|
|
}, $class; |
1369
|
|
|
|
|
|
|
} |
1370
|
|
|
|
|
|
|
|
1371
|
|
|
|
|
|
|
|
1372
|
|
|
|
|
|
|
sub code($$$$) |
1373
|
|
|
|
|
|
|
{ |
1374
|
923
|
|
|
924
|
|
832
|
my ($self, $namespace, $rule, $check) = @_; |
1375
|
|
|
|
|
|
|
|
1376
|
|
|
|
|
|
|
my $code = ' |
1377
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{Trying terminal: [' . $self->describe |
1378
|
|
|
|
|
|
|
. ']}, |
1379
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1380
|
|
|
|
|
|
|
q{' . $rule->{name} . '}, |
1381
|
|
|
|
|
|
|
$tracelevel) |
1382
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1383
|
|
|
|
|
|
|
undef $lastsep; |
1384
|
|
|
|
|
|
|
$expectation->is(q{' . ($rule->hasleftmost($self) ? '' |
1385
|
|
|
|
|
|
|
: $self->describe ) . '})->at($text); |
1386
|
|
|
|
|
|
|
' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) . ' |
1387
|
|
|
|
|
|
|
|
1388
|
|
|
|
|
|
|
' . ($self->{"lookahead"}<0?'if':'unless') |
1389
|
|
|
|
|
|
|
. ' ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and ' |
1390
|
|
|
|
|
|
|
. ($check->{itempos}? 'do {'.Parse::RecDescent::Production::incitempos().' 1} and ' : '') |
1391
|
|
|
|
|
|
|
. ' $text =~ m/\A' . quotemeta($self->{"pattern"}) . '/) |
1392
|
|
|
|
|
|
|
{ |
1393
|
|
|
|
|
|
|
'.($self->{"lookahead"} ? '$text = $_savetext;' : '$text = $lastsep . $text if defined $lastsep;').' |
1394
|
|
|
|
|
|
|
'. ($check->{itempos} ? Parse::RecDescent::Production::unincitempos() : '') . ' |
1395
|
|
|
|
|
|
|
$expectation->failed(); |
1396
|
|
|
|
|
|
|
Parse::RecDescent::_trace(qq{<>}, |
1397
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text)) |
1398
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1399
|
|
|
|
|
|
|
last; |
1400
|
|
|
|
|
|
|
} |
1401
|
|
|
|
|
|
|
$current_match = substr($text, $-[0], $+[0] - $-[0]); |
1402
|
|
|
|
|
|
|
substr($text,0,length($current_match),q{}); |
1403
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} |
1404
|
|
|
|
|
|
|
. $current_match . q{])}, |
1405
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text)) |
1406
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1407
|
|
|
|
|
|
|
push @item, $item{'.$self->{hashname}.'}=$current_match; |
1408
|
923
|
100
|
|
|
|
1006
|
' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .' |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1409
|
|
|
|
|
|
|
'; |
1410
|
|
|
|
|
|
|
|
1411
|
923
|
|
|
|
|
1443
|
return $code; |
1412
|
|
|
|
|
|
|
} |
1413
|
|
|
|
|
|
|
|
1414
|
|
|
|
|
|
|
1; |
1415
|
|
|
|
|
|
|
|
1416
|
|
|
|
|
|
|
package Parse::RecDescent::InterpLit; |
1417
|
|
|
|
|
|
|
|
1418
|
5
|
|
|
6
|
|
17
|
sub sethashname { $_[0]->{hashname} = '__STRING' . ++$_[1]->{strcount} . '__'; } |
1419
|
|
|
|
|
|
|
|
1420
|
6
|
|
|
7
|
|
5
|
sub issubrule { undef } |
1421
|
0
|
|
|
1
|
|
0
|
sub isterminal { 1 } |
1422
|
27
|
|
|
28
|
|
89
|
sub describe ($) { shift->{'description'} } |
1423
|
|
|
|
|
|
|
|
1424
|
|
|
|
|
|
|
sub new ($$$$) |
1425
|
|
|
|
|
|
|
{ |
1426
|
5
|
|
33
|
6
|
|
10
|
my $class = ref($_[0]) || $_[0]; |
1427
|
|
|
|
|
|
|
|
1428
|
5
|
|
|
|
|
7
|
my $pattern = $_[1]; |
1429
|
5
|
|
|
|
|
6
|
$pattern =~ s#/#\\/#g; |
1430
|
|
|
|
|
|
|
|
1431
|
5
|
|
|
|
|
4
|
my $desc = $pattern; |
1432
|
5
|
|
|
|
|
5
|
$desc=~s/\\/\\\\/g; |
1433
|
5
|
|
|
|
|
5
|
$desc=~s/}/\\}/g; |
1434
|
5
|
|
|
|
|
5
|
$desc=~s/{/\\{/g; |
1435
|
|
|
|
|
|
|
|
1436
|
5
|
|
|
|
|
22
|
bless |
1437
|
|
|
|
|
|
|
{ |
1438
|
|
|
|
|
|
|
"pattern" => $pattern, |
1439
|
|
|
|
|
|
|
"lookahead" => $_[2], |
1440
|
|
|
|
|
|
|
"line" => $_[3], |
1441
|
|
|
|
|
|
|
"description" => "'$desc'", |
1442
|
|
|
|
|
|
|
}, $class; |
1443
|
|
|
|
|
|
|
} |
1444
|
|
|
|
|
|
|
|
1445
|
|
|
|
|
|
|
sub code($$$$) |
1446
|
|
|
|
|
|
|
{ |
1447
|
5
|
|
|
6
|
|
7
|
my ($self, $namespace, $rule, $check) = @_; |
1448
|
|
|
|
|
|
|
|
1449
|
|
|
|
|
|
|
my $code = ' |
1450
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{Trying terminal: [' . $self->describe |
1451
|
|
|
|
|
|
|
. ']}, |
1452
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1453
|
|
|
|
|
|
|
q{' . $rule->{name} . '}, |
1454
|
|
|
|
|
|
|
$tracelevel) |
1455
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1456
|
|
|
|
|
|
|
undef $lastsep; |
1457
|
|
|
|
|
|
|
$expectation->is(q{' . ($rule->hasleftmost($self) ? '' |
1458
|
|
|
|
|
|
|
: $self->describe ) . '})->at($text); |
1459
|
|
|
|
|
|
|
' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) . ' |
1460
|
|
|
|
|
|
|
|
1461
|
|
|
|
|
|
|
' . ($self->{"lookahead"}<0?'if':'unless') |
1462
|
|
|
|
|
|
|
. ' ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and ' |
1463
|
|
|
|
|
|
|
. ($check->{itempos}? 'do {'.Parse::RecDescent::Production::incitempos().' 1} and ' : '') |
1464
|
|
|
|
|
|
|
. ' do { $_tok = "' . $self->{"pattern"} . '"; 1 } and |
1465
|
|
|
|
|
|
|
substr($text,0,length($_tok)) eq $_tok and |
1466
|
|
|
|
|
|
|
do { substr($text,0,length($_tok)) = ""; 1; } |
1467
|
|
|
|
|
|
|
) |
1468
|
|
|
|
|
|
|
{ |
1469
|
|
|
|
|
|
|
'.($self->{"lookahead"} ? '$text = $_savetext;' : '$text = $lastsep . $text if defined $lastsep;').' |
1470
|
|
|
|
|
|
|
'. ($check->{itempos} ? Parse::RecDescent::Production::unincitempos() : '') . ' |
1471
|
|
|
|
|
|
|
$expectation->failed(); |
1472
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{<>}, |
1473
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text)) |
1474
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1475
|
|
|
|
|
|
|
last; |
1476
|
|
|
|
|
|
|
} |
1477
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} |
1478
|
|
|
|
|
|
|
. $_tok . q{])}, |
1479
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text)) |
1480
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1481
|
|
|
|
|
|
|
push @item, $item{'.$self->{hashname}.'}=$_tok; |
1482
|
5
|
100
|
|
|
|
8
|
' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .' |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1483
|
|
|
|
|
|
|
'; |
1484
|
|
|
|
|
|
|
|
1485
|
5
|
|
|
|
|
10
|
return $code; |
1486
|
|
|
|
|
|
|
} |
1487
|
|
|
|
|
|
|
|
1488
|
|
|
|
|
|
|
1; |
1489
|
|
|
|
|
|
|
|
1490
|
|
|
|
|
|
|
package Parse::RecDescent::Subrule; |
1491
|
|
|
|
|
|
|
|
1492
|
1592
|
|
|
1593
|
|
1567
|
sub issubrule ($) { return $_[0]->{"subrule"} } |
1493
|
9
|
|
|
10
|
|
22
|
sub isterminal { 0 } |
1494
|
|
|
|
1021
|
|
|
sub sethashname {} |
1495
|
|
|
|
|
|
|
|
1496
|
|
|
|
|
|
|
sub describe ($) |
1497
|
|
|
|
|
|
|
{ |
1498
|
3381
|
|
33
|
3382
|
|
5880
|
my $desc = $_[0]->{"implicit"} || $_[0]->{"subrule"}; |
1499
|
3381
|
100
|
|
|
|
4188
|
$desc = "" if $_[0]->{"matchrule"}; |
1500
|
3381
|
|
|
|
|
11106
|
return $desc; |
1501
|
|
|
|
|
|
|
} |
1502
|
|
|
|
|
|
|
|
1503
|
|
|
|
|
|
|
sub callsyntax($$) |
1504
|
|
|
|
|
|
|
{ |
1505
|
1020
|
100
|
|
1021
|
|
1132
|
if ($_[0]->{"matchrule"}) |
1506
|
|
|
|
|
|
|
{ |
1507
|
2
|
|
|
|
|
12
|
return "&{'$_[1]'.qq{$_[0]->{subrule}}}"; |
1508
|
|
|
|
|
|
|
} |
1509
|
|
|
|
|
|
|
else |
1510
|
|
|
|
|
|
|
{ |
1511
|
1018
|
|
|
|
|
4408
|
return $_[1].$_[0]->{"subrule"}; |
1512
|
|
|
|
|
|
|
} |
1513
|
|
|
|
|
|
|
} |
1514
|
|
|
|
|
|
|
|
1515
|
|
|
|
|
|
|
sub new ($$$$;$$$) |
1516
|
|
|
|
|
|
|
{ |
1517
|
1020
|
|
33
|
1021
|
|
1697
|
my $class = ref($_[0]) || $_[0]; |
1518
|
1020
|
|
50
|
|
|
6942
|
bless |
|
|
|
100
|
|
|
|
|
1519
|
|
|
|
|
|
|
{ |
1520
|
|
|
|
|
|
|
"subrule" => $_[1], |
1521
|
|
|
|
|
|
|
"lookahead" => $_[2], |
1522
|
|
|
|
|
|
|
"line" => $_[3], |
1523
|
|
|
|
|
|
|
"implicit" => $_[4] || undef, |
1524
|
|
|
|
|
|
|
"matchrule" => $_[5], |
1525
|
|
|
|
|
|
|
"argcode" => $_[6] || undef, |
1526
|
|
|
|
|
|
|
}, $class; |
1527
|
|
|
|
|
|
|
} |
1528
|
|
|
|
|
|
|
|
1529
|
|
|
|
|
|
|
|
1530
|
|
|
|
|
|
|
sub code($$$$) |
1531
|
|
|
|
|
|
|
{ |
1532
|
1020
|
|
|
1021
|
|
1234
|
my ($self, $namespace, $rule, $check) = @_; |
1533
|
|
|
|
|
|
|
|
1534
|
|
|
|
|
|
|
' |
1535
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{Trying subrule: [' . $self->{"subrule"} . ']}, |
1536
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1537
|
|
|
|
|
|
|
q{' . $rule->{"name"} . '}, |
1538
|
|
|
|
|
|
|
$tracelevel) |
1539
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1540
|
|
|
|
|
|
|
if (1) { no strict qw{refs}; |
1541
|
|
|
|
|
|
|
$expectation->is(' . ($rule->hasleftmost($self) ? 'q{}' |
1542
|
|
|
|
|
|
|
# WAS : 'qq{'.$self->describe.'}' ) . ')->at($text); |
1543
|
|
|
|
|
|
|
: 'q{'.$self->describe.'}' ) . ')->at($text); |
1544
|
|
|
|
|
|
|
' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) |
1545
|
|
|
|
|
|
|
. ($self->{"lookahead"}<0?'if':'unless') |
1546
|
|
|
|
|
|
|
. ' (defined ($_tok = ' |
1547
|
|
|
|
|
|
|
. $self->callsyntax($namespace.'::') |
1548
|
|
|
|
|
|
|
. '($thisparser,$text,$repeating,' |
1549
|
|
|
|
|
|
|
. ($self->{"lookahead"}?'1':'$_noactions') |
1550
|
|
|
|
|
|
|
. ($self->{argcode} ? ",sub { return $self->{argcode} }" |
1551
|
|
|
|
|
|
|
: ',sub { \\@arg }') |
1552
|
|
|
|
|
|
|
. ($check->{"itempos"}?',$itempos[$#itempos]':',undef') |
1553
|
|
|
|
|
|
|
. '))) |
1554
|
|
|
|
|
|
|
{ |
1555
|
|
|
|
|
|
|
'.($self->{"lookahead"} ? '$text = $_savetext;' : '').' |
1556
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{<<'.Parse::RecDescent::_matchtracemessage($self,1).' subrule: [' |
1557
|
|
|
|
|
|
|
. $self->{subrule} . ']>>}, |
1558
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1559
|
|
|
|
|
|
|
q{' . $rule->{"name"} .'}, |
1560
|
|
|
|
|
|
|
$tracelevel) |
1561
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1562
|
|
|
|
|
|
|
$expectation->failed(); |
1563
|
|
|
|
|
|
|
last; |
1564
|
|
|
|
|
|
|
} |
1565
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{>>'.Parse::RecDescent::_matchtracemessage($self).' subrule: [' |
1566
|
|
|
|
|
|
|
. $self->{subrule} . ']<< (return value: [} |
1567
|
|
|
|
|
|
|
. $_tok . q{]}, |
1568
|
|
|
|
|
|
|
|
1569
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1570
|
|
|
|
|
|
|
q{' . $rule->{"name"} .'}, |
1571
|
|
|
|
|
|
|
$tracelevel) |
1572
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1573
|
|
|
|
|
|
|
$item{q{' . $self->{subrule} . '}} = $_tok; |
1574
|
|
|
|
|
|
|
push @item, $_tok; |
1575
|
1020
|
100
|
|
|
|
1885
|
' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .' |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1576
|
|
|
|
|
|
|
} |
1577
|
|
|
|
|
|
|
' |
1578
|
|
|
|
|
|
|
} |
1579
|
|
|
|
|
|
|
|
1580
|
|
|
|
|
|
|
package Parse::RecDescent::Repetition; |
1581
|
|
|
|
|
|
|
|
1582
|
149
|
|
|
150
|
|
186
|
sub issubrule ($) { return $_[0]->{"subrule"} } |
1583
|
3
|
|
|
4
|
|
6
|
sub isterminal { 0 } |
1584
|
|
|
|
330
|
|
|
sub sethashname { } |
1585
|
|
|
|
|
|
|
|
1586
|
|
|
|
|
|
|
sub describe ($) |
1587
|
|
|
|
|
|
|
{ |
1588
|
1777
|
|
66
|
1778
|
|
2949
|
my $desc = $_[0]->{"expected"} || $_[0]->{"subrule"}; |
1589
|
1777
|
50
|
|
|
|
2121
|
$desc = "" if $_[0]->{"matchrule"}; |
1590
|
1777
|
|
|
|
|
4713
|
return $desc; |
1591
|
|
|
|
|
|
|
} |
1592
|
|
|
|
|
|
|
|
1593
|
|
|
|
|
|
|
sub callsyntax($$) |
1594
|
|
|
|
|
|
|
{ |
1595
|
329
|
50
|
|
330
|
|
398
|
if ($_[0]->{matchrule}) |
1596
|
0
|
|
|
|
|
0
|
{ return "sub { goto &{''.qq{$_[1]$_[0]->{subrule}}} }"; } |
1597
|
|
|
|
|
|
|
else |
1598
|
329
|
|
|
|
|
1482
|
{ return "\\&$_[1]$_[0]->{subrule}"; } |
1599
|
|
|
|
|
|
|
} |
1600
|
|
|
|
|
|
|
|
1601
|
|
|
|
|
|
|
sub new ($$$$$$$$$$) |
1602
|
|
|
|
|
|
|
{ |
1603
|
329
|
|
|
330
|
|
674
|
my ($self, $subrule, $repspec, $min, $max, $lookahead, $line, $parser, $matchrule, $argcode) = @_; |
1604
|
329
|
|
33
|
|
|
884
|
my $class = ref($self) || $self; |
1605
|
329
|
50
|
|
|
|
477
|
($max, $min) = ( $min, $max) if ($max<$min); |
1606
|
|
|
|
|
|
|
|
1607
|
329
|
|
|
|
|
253
|
my $desc; |
1608
|
329
|
100
|
|
|
|
522
|
if ($subrule=~/\A_alternation_\d+_of_production_\d+_of_rule/) |
1609
|
37
|
|
|
|
|
114
|
{ $desc = $parser->{"rules"}{$subrule}->expected } |
1610
|
|
|
|
|
|
|
|
1611
|
329
|
50
|
|
|
|
483
|
if ($lookahead) |
1612
|
|
|
|
|
|
|
{ |
1613
|
0
|
0
|
|
|
|
0
|
if ($min>0) |
1614
|
|
|
|
|
|
|
{ |
1615
|
0
|
|
|
|
|
0
|
return new Parse::RecDescent::Subrule($subrule,$lookahead,$line,$desc,$matchrule,$argcode); |
1616
|
|
|
|
|
|
|
} |
1617
|
|
|
|
|
|
|
else |
1618
|
|
|
|
|
|
|
{ |
1619
|
0
|
|
|
|
|
0
|
Parse::RecDescent::_error("Not symbol (\"!\") before |
1620
|
|
|
|
|
|
|
\"$subrule\" doesn't make |
1621
|
|
|
|
|
|
|
sense.",$line); |
1622
|
0
|
|
|
|
|
0
|
Parse::RecDescent::_hint("Lookahead for negated optional |
1623
|
|
|
|
|
|
|
repetitions (such as |
1624
|
|
|
|
|
|
|
\"!$subrule($repspec)\" can never |
1625
|
|
|
|
|
|
|
succeed, since optional items always |
1626
|
|
|
|
|
|
|
match (zero times at worst). |
1627
|
|
|
|
|
|
|
Did you mean a single \"!$subrule\", |
1628
|
|
|
|
|
|
|
instead?"); |
1629
|
|
|
|
|
|
|
} |
1630
|
|
|
|
|
|
|
} |
1631
|
|
|
|
|
|
|
bless |
1632
|
|
|
|
|
|
|
{ |
1633
|
329
|
|
50
|
|
|
2370
|
"subrule" => $subrule, |
1634
|
|
|
|
|
|
|
"repspec" => $repspec, |
1635
|
|
|
|
|
|
|
"min" => $min, |
1636
|
|
|
|
|
|
|
"max" => $max, |
1637
|
|
|
|
|
|
|
"lookahead" => $lookahead, |
1638
|
|
|
|
|
|
|
"line" => $line, |
1639
|
|
|
|
|
|
|
"expected" => $desc, |
1640
|
|
|
|
|
|
|
"argcode" => $argcode || undef, |
1641
|
|
|
|
|
|
|
"matchrule" => $matchrule, |
1642
|
|
|
|
|
|
|
}, $class; |
1643
|
|
|
|
|
|
|
} |
1644
|
|
|
|
|
|
|
|
1645
|
|
|
|
|
|
|
sub code($$$$) |
1646
|
|
|
|
|
|
|
{ |
1647
|
329
|
|
|
330
|
|
336
|
my ($self, $namespace, $rule, $check) = @_; |
1648
|
|
|
|
|
|
|
|
1649
|
|
|
|
|
|
|
my ($subrule, $repspec, $min, $max, $lookahead) = |
1650
|
329
|
|
|
|
|
277
|
@{$self}{ qw{subrule repspec min max lookahead} }; |
|
329
|
|
|
|
|
617
|
|
1651
|
|
|
|
|
|
|
|
1652
|
|
|
|
|
|
|
' |
1653
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{Trying repeated subrule: [' . $self->describe . ']}, |
1654
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1655
|
|
|
|
|
|
|
q{' . $rule->{"name"} . '}, |
1656
|
|
|
|
|
|
|
$tracelevel) |
1657
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1658
|
|
|
|
|
|
|
$expectation->is(' . ($rule->hasleftmost($self) ? 'q{}' |
1659
|
|
|
|
|
|
|
# WAS : 'qq{'.$self->describe.'}' ) . ')->at($text); |
1660
|
|
|
|
|
|
|
: 'q{'.$self->describe.'}' ) . ')->at($text); |
1661
|
|
|
|
|
|
|
' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) .' |
1662
|
|
|
|
|
|
|
unless (defined ($_tok = $thisparser->_parserepeat($text, ' |
1663
|
|
|
|
|
|
|
. $self->callsyntax($namespace.'::') |
1664
|
|
|
|
|
|
|
. ', ' . $min . ', ' . $max . ', ' |
1665
|
|
|
|
|
|
|
. ($self->{"lookahead"}?'1':'$_noactions') |
1666
|
|
|
|
|
|
|
. ',$expectation,' |
1667
|
|
|
|
|
|
|
. ($self->{argcode} ? "sub { return $self->{argcode} }" |
1668
|
|
|
|
|
|
|
: 'sub { \\@arg }') |
1669
|
|
|
|
|
|
|
. ($check->{"itempos"}?',$itempos[$#itempos]':',undef') |
1670
|
|
|
|
|
|
|
. '))) |
1671
|
|
|
|
|
|
|
{ |
1672
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{<<'.Parse::RecDescent::_matchtracemessage($self,1).' repeated subrule: [' |
1673
|
|
|
|
|
|
|
. $self->describe . ']>>}, |
1674
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1675
|
|
|
|
|
|
|
q{' . $rule->{"name"} .'}, |
1676
|
|
|
|
|
|
|
$tracelevel) |
1677
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1678
|
|
|
|
|
|
|
last; |
1679
|
|
|
|
|
|
|
} |
1680
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{>>'.Parse::RecDescent::_matchtracemessage($self).' repeated subrule: [' |
1681
|
|
|
|
|
|
|
. $self->{subrule} . ']<< (} |
1682
|
|
|
|
|
|
|
. @$_tok . q{ times)}, |
1683
|
|
|
|
|
|
|
|
1684
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1685
|
|
|
|
|
|
|
q{' . $rule->{"name"} .'}, |
1686
|
|
|
|
|
|
|
$tracelevel) |
1687
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1688
|
|
|
|
|
|
|
$item{q{' . "$self->{subrule}($self->{repspec})" . '}} = $_tok; |
1689
|
|
|
|
|
|
|
push @item, $_tok; |
1690
|
329
|
100
|
|
|
|
378
|
' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .' |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1691
|
|
|
|
|
|
|
|
1692
|
|
|
|
|
|
|
' |
1693
|
|
|
|
|
|
|
} |
1694
|
|
|
|
|
|
|
|
1695
|
|
|
|
|
|
|
package Parse::RecDescent::Result; |
1696
|
|
|
|
|
|
|
|
1697
|
0
|
|
|
1
|
|
0
|
sub issubrule { 0 } |
1698
|
0
|
|
|
1
|
|
0
|
sub isterminal { 0 } |
1699
|
0
|
|
|
1
|
|
0
|
sub describe { '' } |
1700
|
|
|
|
|
|
|
|
1701
|
|
|
|
|
|
|
sub new |
1702
|
|
|
|
|
|
|
{ |
1703
|
0
|
|
|
1
|
|
0
|
my ($class, $pos) = @_; |
1704
|
|
|
|
|
|
|
|
1705
|
0
|
|
|
|
|
0
|
bless {}, $class; |
1706
|
|
|
|
|
|
|
} |
1707
|
|
|
|
|
|
|
|
1708
|
|
|
|
|
|
|
sub code($$$$) |
1709
|
|
|
|
|
|
|
{ |
1710
|
0
|
|
|
1
|
|
0
|
my ($self, $namespace, $rule) = @_; |
1711
|
|
|
|
|
|
|
|
1712
|
0
|
|
|
|
|
0
|
' |
1713
|
|
|
|
|
|
|
$return = $item[-1]; |
1714
|
|
|
|
|
|
|
'; |
1715
|
|
|
|
|
|
|
} |
1716
|
|
|
|
|
|
|
|
1717
|
|
|
|
|
|
|
package Parse::RecDescent::Operator; |
1718
|
|
|
|
|
|
|
|
1719
|
|
|
|
|
|
|
my @opertype = ( " non-optional", "n optional" ); |
1720
|
|
|
|
|
|
|
|
1721
|
188
|
|
|
189
|
|
153
|
sub issubrule { 0 } |
1722
|
0
|
|
|
1
|
|
0
|
sub isterminal { 0 } |
1723
|
|
|
|
|
|
|
|
1724
|
1084
|
|
|
1085
|
|
3989
|
sub describe { $_[0]->{"expected"} } |
1725
|
137
|
|
|
138
|
|
391
|
sub sethashname { $_[0]->{hashname} = '__DIRECTIVE' . ++$_[1]->{dircount} . '__'; } |
1726
|
|
|
|
|
|
|
|
1727
|
|
|
|
|
|
|
|
1728
|
|
|
|
|
|
|
sub new |
1729
|
|
|
|
|
|
|
{ |
1730
|
137
|
|
|
138
|
|
190
|
my ($class, $type, $minrep, $maxrep, $leftarg, $op, $rightarg) = @_; |
1731
|
|
|
|
|
|
|
|
1732
|
137
|
|
|
|
|
399
|
bless |
1733
|
|
|
|
|
|
|
{ |
1734
|
|
|
|
|
|
|
"type" => "${type}op", |
1735
|
|
|
|
|
|
|
"leftarg" => $leftarg, |
1736
|
|
|
|
|
|
|
"op" => $op, |
1737
|
|
|
|
|
|
|
"min" => $minrep, |
1738
|
|
|
|
|
|
|
"max" => $maxrep, |
1739
|
|
|
|
|
|
|
"rightarg" => $rightarg, |
1740
|
|
|
|
|
|
|
"expected" => "<${type}op: ".$leftarg->describe." ".$op->describe." ".$rightarg->describe.">", |
1741
|
|
|
|
|
|
|
}, $class; |
1742
|
|
|
|
|
|
|
} |
1743
|
|
|
|
|
|
|
|
1744
|
|
|
|
|
|
|
sub code($$$$) |
1745
|
|
|
|
|
|
|
{ |
1746
|
137
|
|
|
138
|
|
137
|
my ($self, $namespace, $rule, $check) = @_; |
1747
|
|
|
|
|
|
|
|
1748
|
137
|
|
|
|
|
324
|
my @codeargs = @_[1..$#_]; |
1749
|
|
|
|
|
|
|
|
1750
|
|
|
|
|
|
|
my ($leftarg, $op, $rightarg) = |
1751
|
137
|
|
|
|
|
120
|
@{$self}{ qw{leftarg op rightarg} }; |
|
137
|
|
|
|
|
242
|
|
1752
|
|
|
|
|
|
|
|
1753
|
|
|
|
|
|
|
my $code = ' |
1754
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{Trying operator: [' . $self->describe . ']}, |
1755
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1756
|
137
|
100
|
|
|
|
182
|
q{' . $rule->{"name"} . '}, |
1757
|
|
|
|
|
|
|
$tracelevel) |
1758
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1759
|
|
|
|
|
|
|
$expectation->is(' . ($rule->hasleftmost($self) ? 'q{}' |
1760
|
|
|
|
|
|
|
# WAS : 'qq{'.$self->describe.'}' ) . ')->at($text); |
1761
|
|
|
|
|
|
|
: 'q{'.$self->describe.'}' ) . ')->at($text); |
1762
|
|
|
|
|
|
|
|
1763
|
|
|
|
|
|
|
$_tok = undef; |
1764
|
|
|
|
|
|
|
OPLOOP: while (1) |
1765
|
|
|
|
|
|
|
{ |
1766
|
|
|
|
|
|
|
$repcount = 0; |
1767
|
|
|
|
|
|
|
my @item; |
1768
|
|
|
|
|
|
|
my %item; |
1769
|
|
|
|
|
|
|
'; |
1770
|
|
|
|
|
|
|
|
1771
|
|
|
|
|
|
|
$code .= ' |
1772
|
|
|
|
|
|
|
my $_itempos = $itempos[-1]; |
1773
|
|
|
|
|
|
|
my $itemposfirst; |
1774
|
137
|
100
|
|
|
|
236
|
' if $check->{itempos}; |
1775
|
|
|
|
|
|
|
|
1776
|
137
|
100
|
|
|
|
240
|
if ($self->{type} eq "leftop" ) |
1777
|
|
|
|
|
|
|
{ |
1778
|
133
|
|
|
|
|
253
|
$code .= ' |
1779
|
|
|
|
|
|
|
# MATCH LEFTARG |
1780
|
|
|
|
|
|
|
' . $leftarg->code(@codeargs) . ' |
1781
|
|
|
|
|
|
|
|
1782
|
|
|
|
|
|
|
'; |
1783
|
|
|
|
|
|
|
|
1784
|
|
|
|
|
|
|
$code .= ' |
1785
|
|
|
|
|
|
|
if (defined($_itempos) and !defined($itemposfirst)) |
1786
|
|
|
|
|
|
|
{ |
1787
|
|
|
|
|
|
|
$itemposfirst = Parse::RecDescent::Production::_duplicate_itempos($_itempos); |
1788
|
|
|
|
|
|
|
} |
1789
|
133
|
100
|
|
|
|
231
|
' if $check->{itempos}; |
1790
|
|
|
|
|
|
|
|
1791
|
|
|
|
|
|
|
$code .= ' |
1792
|
|
|
|
|
|
|
$repcount++; |
1793
|
|
|
|
|
|
|
|
1794
|
|
|
|
|
|
|
my $savetext = $text; |
1795
|
|
|
|
|
|
|
my $backtrack; |
1796
|
|
|
|
|
|
|
|
1797
|
|
|
|
|
|
|
# MATCH (OP RIGHTARG)(s) |
1798
|
|
|
|
|
|
|
while ($repcount < ' . $self->{max} . ') |
1799
|
|
|
|
|
|
|
{ |
1800
|
|
|
|
|
|
|
$backtrack = 0; |
1801
|
|
|
|
|
|
|
' . $op->code(@codeargs) . ' |
1802
|
|
|
|
|
|
|
' . ($op->isterminal() ? 'pop @item;' : '$backtrack=1;' ) . ' |
1803
|
|
|
|
|
|
|
' . (ref($op) eq 'Parse::RecDescent::Token' |
1804
|
133
|
50
|
66
|
|
|
365
|
? 'if (defined $1) {push @item, $item{'.($self->{name}||$self->{hashname}).'}=$1; $backtrack=1;}' |
|
|
50
|
|
|
|
|
|
1805
|
|
|
|
|
|
|
: "" ) . ' |
1806
|
|
|
|
|
|
|
' . $rightarg->code(@codeargs) . ' |
1807
|
|
|
|
|
|
|
$savetext = $text; |
1808
|
|
|
|
|
|
|
$repcount++; |
1809
|
|
|
|
|
|
|
} |
1810
|
|
|
|
|
|
|
$text = $savetext; |
1811
|
|
|
|
|
|
|
pop @item if $backtrack; |
1812
|
|
|
|
|
|
|
|
1813
|
|
|
|
|
|
|
'; |
1814
|
|
|
|
|
|
|
} |
1815
|
|
|
|
|
|
|
else |
1816
|
|
|
|
|
|
|
{ |
1817
|
|
|
|
|
|
|
$code .= ' |
1818
|
|
|
|
|
|
|
my $savetext = $text; |
1819
|
|
|
|
|
|
|
my $backtrack; |
1820
|
|
|
|
|
|
|
# MATCH (LEFTARG OP)(s) |
1821
|
4
|
|
|
|
|
10
|
while ($repcount < ' . $self->{max} . ') |
1822
|
|
|
|
|
|
|
{ |
1823
|
|
|
|
|
|
|
$backtrack = 0; |
1824
|
|
|
|
|
|
|
' . $leftarg->code(@codeargs) . ' |
1825
|
|
|
|
|
|
|
'; |
1826
|
|
|
|
|
|
|
$code .= ' |
1827
|
|
|
|
|
|
|
if (defined($_itempos) and !defined($itemposfirst)) |
1828
|
|
|
|
|
|
|
{ |
1829
|
|
|
|
|
|
|
$itemposfirst = Parse::RecDescent::Production::_duplicate_itempos($_itempos); |
1830
|
|
|
|
|
|
|
} |
1831
|
4
|
50
|
|
|
|
12
|
' if $check->{itempos}; |
1832
|
|
|
|
|
|
|
|
1833
|
|
|
|
|
|
|
$code .= ' |
1834
|
|
|
|
|
|
|
$repcount++; |
1835
|
|
|
|
|
|
|
$backtrack = 1; |
1836
|
|
|
|
|
|
|
' . $op->code(@codeargs) . ' |
1837
|
|
|
|
|
|
|
$savetext = $text; |
1838
|
|
|
|
|
|
|
' . ($op->isterminal() ? 'pop @item;' : "" ) . ' |
1839
|
4
|
50
|
33
|
|
|
8
|
' . (ref($op) eq 'Parse::RecDescent::Token' ? 'do { push @item, $item{'.($self->{name}||$self->{hashname}).'}=$1; } if defined $1;' : "" ) . ' |
|
|
50
|
|
|
|
|
|
1840
|
|
|
|
|
|
|
} |
1841
|
|
|
|
|
|
|
$text = $savetext; |
1842
|
|
|
|
|
|
|
pop @item if $backtrack; |
1843
|
|
|
|
|
|
|
|
1844
|
|
|
|
|
|
|
# MATCH RIGHTARG |
1845
|
|
|
|
|
|
|
' . $rightarg->code(@codeargs) . ' |
1846
|
|
|
|
|
|
|
$repcount++; |
1847
|
|
|
|
|
|
|
'; |
1848
|
|
|
|
|
|
|
} |
1849
|
|
|
|
|
|
|
|
1850
|
137
|
100
|
|
|
|
320
|
$code .= 'unless (@item) { undef $_tok; last }' unless $self->{min}==0; |
1851
|
|
|
|
|
|
|
|
1852
|
137
|
|
|
|
|
115
|
$code .= ' |
1853
|
|
|
|
|
|
|
$_tok = [ @item ]; |
1854
|
|
|
|
|
|
|
'; |
1855
|
|
|
|
|
|
|
|
1856
|
|
|
|
|
|
|
|
1857
|
|
|
|
|
|
|
$code .= ' |
1858
|
|
|
|
|
|
|
if (defined $itemposfirst) |
1859
|
|
|
|
|
|
|
{ |
1860
|
|
|
|
|
|
|
Parse::RecDescent::Production::_update_itempos( |
1861
|
|
|
|
|
|
|
$_itempos, $itemposfirst, undef, [qw(from)]); |
1862
|
|
|
|
|
|
|
} |
1863
|
137
|
100
|
|
|
|
219
|
' if $check->{itempos}; |
1864
|
|
|
|
|
|
|
|
1865
|
137
|
|
|
|
|
111
|
$code .= ' |
1866
|
|
|
|
|
|
|
last; |
1867
|
|
|
|
|
|
|
} # end of OPLOOP |
1868
|
|
|
|
|
|
|
'; |
1869
|
|
|
|
|
|
|
|
1870
|
|
|
|
|
|
|
$code .= ' |
1871
|
|
|
|
|
|
|
unless ($repcount>='.$self->{min}.') |
1872
|
|
|
|
|
|
|
{ |
1873
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{<<'.Parse::RecDescent::_matchtracemessage($self,1).' operator: [' |
1874
|
|
|
|
|
|
|
. $self->describe |
1875
|
|
|
|
|
|
|
. ']>>}, |
1876
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1877
|
|
|
|
|
|
|
q{' . $rule->{"name"} .'}, |
1878
|
|
|
|
|
|
|
$tracelevel) |
1879
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1880
|
|
|
|
|
|
|
$expectation->failed(); |
1881
|
|
|
|
|
|
|
last; |
1882
|
|
|
|
|
|
|
} |
1883
|
|
|
|
|
|
|
Parse::RecDescent::_trace(q{>>'.Parse::RecDescent::_matchtracemessage($self).' operator: [' |
1884
|
|
|
|
|
|
|
. $self->describe |
1885
|
|
|
|
|
|
|
. ']<< (return value: [} |
1886
|
|
|
|
|
|
|
. qq{@{$_tok||[]}} . q{]}, |
1887
|
|
|
|
|
|
|
Parse::RecDescent::_tracefirst($text), |
1888
|
|
|
|
|
|
|
q{' . $rule->{"name"} .'}, |
1889
|
|
|
|
|
|
|
$tracelevel) |
1890
|
|
|
|
|
|
|
if defined $::RD_TRACE; |
1891
|
|
|
|
|
|
|
|
1892
|
137
|
|
66
|
|
|
305
|
push @item, $item{'.($self->{name}||$self->{hashname}).'}=$_tok||[]; |
1893
|
|
|
|
|
|
|
'; |
1894
|
|
|
|
|
|
|
|
1895
|
137
|
|
|
|
|
628
|
return $code; |
1896
|
|
|
|
|
|
|
} |
1897
|
|
|
|
|
|
|
|
1898
|
|
|
|
|
|
|
|
1899
|
|
|
|
|
|
|
package Parse::RecDescent::Expectation; |
1900
|
|
|
|
|
|
|
|
1901
|
|
|
|
|
|
|
sub new ($) |
1902
|
|
|
|
|
|
|
{ |
1903
|
455
|
|
|
456
|
|
8165
|
bless { |
1904
|
|
|
|
|
|
|
"failed" => 0, |
1905
|
|
|
|
|
|
|
"expected" => "", |
1906
|
|
|
|
|
|
|
"unexpected" => "", |
1907
|
|
|
|
|
|
|
"lastexpected" => "", |
1908
|
|
|
|
|
|
|
"lastunexpected" => "", |
1909
|
|
|
|
|
|
|
"defexpected" => $_[1], |
1910
|
|
|
|
|
|
|
}; |
1911
|
|
|
|
|
|
|
} |
1912
|
|
|
|
|
|
|
|
1913
|
|
|
|
|
|
|
sub is ($$) |
1914
|
|
|
|
|
|
|
{ |
1915
|
840
|
|
|
841
|
|
842
|
$_[0]->{lastexpected} = $_[1]; return $_[0]; |
|
840
|
|
|
|
|
1131
|
|
1916
|
|
|
|
|
|
|
} |
1917
|
|
|
|
|
|
|
|
1918
|
|
|
|
|
|
|
sub at ($$) |
1919
|
|
|
|
|
|
|
{ |
1920
|
1410
|
|
|
1411
|
|
1339
|
$_[0]->{lastunexpected} = $_[1]; return $_[0]; |
|
1410
|
|
|
|
|
19099
|
|
1921
|
|
|
|
|
|
|
} |
1922
|
|
|
|
|
|
|
|
1923
|
|
|
|
|
|
|
sub failed ($) |
1924
|
|
|
|
|
|
|
{ |
1925
|
219
|
100
|
|
220
|
|
3257
|
return unless $_[0]->{lastexpected}; |
1926
|
15
|
50
|
|
|
|
39
|
$_[0]->{expected} = $_[0]->{lastexpected} unless $_[0]->{failed}; |
1927
|
15
|
50
|
|
|
|
52
|
$_[0]->{unexpected} = $_[0]->{lastunexpected} unless $_[0]->{failed}; |
1928
|
15
|
|
|
|
|
213
|
$_[0]->{failed} = 1; |
1929
|
|
|
|
|
|
|
} |
1930
|
|
|
|
|
|
|
|
1931
|
|
|
|
|
|
|
sub message ($) |
1932
|
|
|
|
|
|
|
{ |
1933
|
0
|
|
|
1
|
|
0
|
my ($self) = @_; |
1934
|
0
|
0
|
|
|
|
0
|
$self->{expected} = $self->{defexpected} unless $self->{expected}; |
1935
|
0
|
|
|
|
|
0
|
$self->{expected} =~ s/_/ /g; |
1936
|
0
|
0
|
0
|
|
|
0
|
if (!$self->{unexpected} || $self->{unexpected} =~ /\A\s*\Z/s) |
1937
|
|
|
|
|
|
|
{ |
1938
|
0
|
|
|
|
|
0
|
return "Was expecting $self->{expected}"; |
1939
|
|
|
|
|
|
|
} |
1940
|
|
|
|
|
|
|
else |
1941
|
|
|
|
|
|
|
{ |
1942
|
0
|
|
|
|
|
0
|
$self->{unexpected} =~ /\s*(.*)/; |
1943
|
0
|
|
|
|
|
0
|
return "Was expecting $self->{expected} but found \"$1\" instead"; |
1944
|
|
|
|
|
|
|
} |
1945
|
|
|
|
|
|
|
} |
1946
|
|
|
|
|
|
|
|
1947
|
|
|
|
|
|
|
1; |
1948
|
|
|
|
|
|
|
|
1949
|
|
|
|
|
|
|
package Parse::RecDescent; |
1950
|
|
|
|
|
|
|
|
1951
|
13
|
|
|
13
|
|
127
|
use Carp; |
|
13
|
|
|
|
|
17
|
|
|
13
|
|
|
|
|
1013
|
|
1952
|
13
|
|
|
13
|
|
107
|
use vars qw ( $AUTOLOAD $VERSION $_FILENAME); |
|
13
|
|
|
|
|
20
|
|
|
13
|
|
|
|
|
4083
|
|
1953
|
|
|
|
|
|
|
|
1954
|
|
|
|
|
|
|
my $ERRORS = 0; |
1955
|
|
|
|
|
|
|
|
1956
|
|
|
|
|
|
|
our $VERSION = '1.967014'; |
1957
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
1958
|
|
|
|
|
|
|
$_FILENAME=__FILE__; |
1959
|
|
|
|
|
|
|
|
1960
|
|
|
|
|
|
|
# BUILDING A PARSER |
1961
|
|
|
|
|
|
|
|
1962
|
|
|
|
|
|
|
my $nextnamespace = "namespace000001"; |
1963
|
|
|
|
|
|
|
|
1964
|
|
|
|
|
|
|
sub _nextnamespace() |
1965
|
|
|
|
|
|
|
{ |
1966
|
16
|
|
|
17
|
|
53
|
return "Parse::RecDescent::" . $nextnamespace++; |
1967
|
|
|
|
|
|
|
} |
1968
|
|
|
|
|
|
|
|
1969
|
|
|
|
|
|
|
# ARGS ARE: $class, $grammar, $compiling, $namespace |
1970
|
|
|
|
|
|
|
sub new ($$$$) |
1971
|
|
|
|
|
|
|
{ |
1972
|
25
|
|
33
|
26
|
0
|
639
|
my $class = ref($_[0]) || $_[0]; |
1973
|
25
|
|
|
|
|
38
|
local $Parse::RecDescent::compiling = $_[2]; |
1974
|
25
|
100
|
|
|
|
86
|
my $name_space_name = defined $_[3] |
1975
|
|
|
|
|
|
|
? "Parse::RecDescent::".$_[3] |
1976
|
|
|
|
|
|
|
: _nextnamespace(); |
1977
|
25
|
|
|
|
|
151
|
my $self = |
1978
|
|
|
|
|
|
|
{ |
1979
|
|
|
|
|
|
|
"rules" => {}, |
1980
|
|
|
|
|
|
|
"namespace" => $name_space_name, |
1981
|
|
|
|
|
|
|
"startcode" => '', |
1982
|
|
|
|
|
|
|
"localvars" => '', |
1983
|
|
|
|
|
|
|
"_AUTOACTION" => undef, |
1984
|
|
|
|
|
|
|
"_AUTOTREE" => undef, |
1985
|
|
|
|
|
|
|
|
1986
|
|
|
|
|
|
|
# Precompiled parsers used to set _precompiled, but that |
1987
|
|
|
|
|
|
|
# wasn't present in some versions of Parse::RecDescent used to |
1988
|
|
|
|
|
|
|
# build precompiled parsers. Instead, set a new |
1989
|
|
|
|
|
|
|
# _not_precompiled flag, which is remove from future |
1990
|
|
|
|
|
|
|
# Precompiled parsers at build time. |
1991
|
|
|
|
|
|
|
"_not_precompiled" => 1, |
1992
|
|
|
|
|
|
|
}; |
1993
|
|
|
|
|
|
|
|
1994
|
|
|
|
|
|
|
|
1995
|
25
|
50
|
|
|
|
73
|
if ($::RD_AUTOACTION) { |
1996
|
0
|
|
|
|
|
0
|
my $sourcecode = $::RD_AUTOACTION; |
1997
|
0
|
0
|
|
|
|
0
|
$sourcecode = "{ $sourcecode }" |
1998
|
|
|
|
|
|
|
unless $sourcecode =~ /\A\s*\{.*\}\s*\Z/; |
1999
|
|
|
|
|
|
|
$self->{_check}{itempos} = |
2000
|
0
|
|
|
|
|
0
|
$sourcecode =~ /\@itempos\b|\$itempos\s*\[/; |
2001
|
|
|
|
|
|
|
$self->{_AUTOACTION} |
2002
|
0
|
|
|
|
|
0
|
= new Parse::RecDescent::Action($sourcecode,0,-1) |
2003
|
|
|
|
|
|
|
} |
2004
|
|
|
|
|
|
|
|
2005
|
25
|
|
|
|
|
41
|
bless $self, $class; |
2006
|
25
|
|
|
|
|
82
|
return $self->Replace($_[1]) |
2007
|
|
|
|
|
|
|
} |
2008
|
|
|
|
|
|
|
|
2009
|
|
|
|
|
|
|
sub Compile($$$$) { |
2010
|
0
|
|
|
1
|
0
|
0
|
die "Compilation of Parse::RecDescent grammars not yet implemented\n"; |
2011
|
|
|
|
|
|
|
} |
2012
|
|
|
|
|
|
|
|
2013
|
|
|
|
|
|
|
sub DESTROY { |
2014
|
23
|
|
|
24
|
|
4347
|
my ($self) = @_; |
2015
|
23
|
|
|
|
|
59
|
my $namespace = $self->{namespace}; |
2016
|
23
|
|
|
|
|
187
|
$namespace =~ s/Parse::RecDescent:://; |
2017
|
23
|
100
|
|
|
|
5159
|
if ($self->{_not_precompiled}) { |
2018
|
|
|
|
|
|
|
# BEGIN WORKAROUND |
2019
|
|
|
|
|
|
|
# Perl has a bug that creates a circular reference between |
2020
|
|
|
|
|
|
|
# @ISA and that variable's stash: |
2021
|
|
|
|
|
|
|
# https://rt.perl.org/rt3/Ticket/Display.html?id=92708 |
2022
|
|
|
|
|
|
|
# Emptying the array before deleting the stash seems to |
2023
|
|
|
|
|
|
|
# prevent the leak. Once the ticket above has been resolved, |
2024
|
|
|
|
|
|
|
# these two lines can be removed. |
2025
|
13
|
|
|
13
|
|
131
|
no strict 'refs'; |
|
13
|
|
|
|
|
20
|
|
|
13
|
|
|
|
|
79658
|
|
2026
|
13
|
|
|
|
|
16
|
@{$self->{namespace} . '::ISA'} = (); |
|
13
|
|
|
|
|
136
|
|
2027
|
|
|
|
|
|
|
# END WORKAROUND |
2028
|
|
|
|
|
|
|
|
2029
|
|
|
|
|
|
|
# Some grammars may contain circular references between rules, |
2030
|
|
|
|
|
|
|
# such as: |
2031
|
|
|
|
|
|
|
# a: 'ID' | b |
2032
|
|
|
|
|
|
|
# b: '(' a ')' |
2033
|
|
|
|
|
|
|
# Unless these references are broken, the subs stay around on |
2034
|
|
|
|
|
|
|
# stash deletion below. Iterate through the stash entries and |
2035
|
|
|
|
|
|
|
# for each defined code reference, set it to reference sub {} |
2036
|
|
|
|
|
|
|
# instead. |
2037
|
|
|
|
|
|
|
{ |
2038
|
13
|
|
|
|
|
23
|
local $^W; # avoid 'sub redefined' warnings. |
|
13
|
|
|
|
|
40
|
|
2039
|
13
|
|
|
1
|
|
39
|
my $blank_sub = sub {}; |
2040
|
13
|
|
|
|
|
16
|
while (my ($name, $glob) = each %{"Parse::RecDescent::$namespace\::"}) { |
|
155
|
|
|
|
|
450
|
|
2041
|
142
|
100
|
|
|
|
313
|
*$glob = $blank_sub if defined &$glob; |
2042
|
|
|
|
|
|
|
} |
2043
|
|
|
|
|
|
|
} |
2044
|
|
|
|
|
|
|
|
2045
|
|
|
|
|
|
|
# Delete the namespace's stash |
2046
|
13
|
|
|
|
|
1024
|
delete $Parse::RecDescent::{$namespace.'::'}; |
2047
|
|
|
|
|
|
|
} |
2048
|
|
|
|
|
|
|
} |
2049
|
|
|
|
|
|
|
|
2050
|
|
|
|
|
|
|
# BUILDING A GRAMMAR.... |
2051
|
|
|
|
|
|
|
|
2052
|
|
|
|
|
|
|
# ARGS ARE: $self, $grammar, $isimplicit, $isleftop |
2053
|
|
|
|
|
|
|
sub Replace ($$) |
2054
|
|
|
|
|
|
|
{ |
2055
|
|
|
|
|
|
|
# set $replace = 1 for _generate |
2056
|
25
|
|
|
26
|
0
|
70
|
splice(@_, 2, 0, 1); |
2057
|
|
|
|
|
|
|
|
2058
|
25
|
|
|
|
|
86
|
return _generate(@_); |
2059
|
|
|
|
|
|
|
} |
2060
|
|
|
|
|
|
|
|
2061
|
|
|
|
|
|
|
# ARGS ARE: $self, $grammar, $isimplicit, $isleftop |
2062
|
|
|
|
|
|
|
sub Extend ($$) |
2063
|
|
|
|
|
|
|
{ |
2064
|
|
|
|
|
|
|
# set $replace = 0 for _generate |
2065
|
4
|
|
|
5
|
0
|
36
|
splice(@_, 2, 0, 0); |
2066
|
|
|
|
|
|
|
|
2067
|
4
|
|
|
|
|
15
|
return _generate(@_); |
2068
|
|
|
|
|
|
|
} |
2069
|
|
|
|
|
|
|
|
2070
|
|
|
|
|
|
|
sub _no_rule ($$;$) |
2071
|
|
|
|
|
|
|
{ |
2072
|
0
|
|
|
1
|
|
0
|
_error("Ruleless $_[0] at start of grammar.",$_[1]); |
2073
|
0
|
0
|
|
|
|
0
|
my $desc = $_[2] ? "\"$_[2]\"" : ""; |
2074
|
0
|
|
|
|
|
0
|
_hint("You need to define a rule for the $_[0] $desc |
2075
|
|
|
|
|
|
|
to be part of."); |
2076
|
|
|
|
|
|
|
} |
2077
|
|
|
|
|
|
|
|
2078
|
|
|
|
|
|
|
my $NEGLOOKAHEAD = '\G(\s*\.\.\.\!)'; |
2079
|
|
|
|
|
|
|
my $POSLOOKAHEAD = '\G(\s*\.\.\.)'; |
2080
|
|
|
|
|
|
|
my $RULE = '\G\s*(\w+)[ \t]*:'; |
2081
|
|
|
|
|
|
|
my $PROD = '\G\s*([|])'; |
2082
|
|
|
|
|
|
|
my $TOKEN = q{\G\s*/((\\\\/|\\\\\\\\|[^/])*)/([cgimsox]*)}; |
2083
|
|
|
|
|
|
|
my $MTOKEN = q{\G\s*(m\s*[^\w\s])}; |
2084
|
|
|
|
|
|
|
my $LITERAL = q{\G\s*'((\\\\['\\\\]|[^'])*)'}; |
2085
|
|
|
|
|
|
|
my $INTERPLIT = q{\G\s*"((\\\\["\\\\]|[^"])*)"}; |
2086
|
|
|
|
|
|
|
my $SUBRULE = '\G\s*(\w+)'; |
2087
|
|
|
|
|
|
|
my $MATCHRULE = '\G(\s*
|
2088
|
|
|
|
|
|
|
my $SIMPLEPAT = '((\\s+/[^/\\\\]*(?:\\\\.[^/\\\\]*)*/)?)'; |
2089
|
|
|
|
|
|
|
my $OPTIONAL = '\G\((\?)'.$SIMPLEPAT.'\)'; |
2090
|
|
|
|
|
|
|
my $ANY = '\G\((s\?)'.$SIMPLEPAT.'\)'; |
2091
|
|
|
|
|
|
|
my $MANY = '\G\((s|\.\.)'.$SIMPLEPAT.'\)'; |
2092
|
|
|
|
|
|
|
my $EXACTLY = '\G\(([1-9]\d*)'.$SIMPLEPAT.'\)'; |
2093
|
|
|
|
|
|
|
my $BETWEEN = '\G\((\d+)\.\.([1-9]\d*)'.$SIMPLEPAT.'\)'; |
2094
|
|
|
|
|
|
|
my $ATLEAST = '\G\((\d+)\.\.'.$SIMPLEPAT.'\)'; |
2095
|
|
|
|
|
|
|
my $ATMOST = '\G\(\.\.([1-9]\d*)'.$SIMPLEPAT.'\)'; |
2096
|
|
|
|
|
|
|
my $BADREP = '\G\((-?\d+)?\.\.(-?\d+)?'.$SIMPLEPAT.'\)'; |
2097
|
|
|
|
|
|
|
my $ACTION = '\G\s*\{'; |
2098
|
|
|
|
|
|
|
my $IMPLICITSUBRULE = '\G\s*\('; |
2099
|
|
|
|
|
|
|
my $COMMENT = '\G\s*(#.*)'; |
2100
|
|
|
|
|
|
|
my $COMMITMK = '\G\s*'; |
2101
|
|
|
|
|
|
|
my $UNCOMMITMK = '\G\s*'; |
2102
|
|
|
|
|
|
|
my $QUOTELIKEMK = '\G\s*'; |
2103
|
|
|
|
|
|
|
my $CODEBLOCKMK = '\G\s*{}]+))?>'; |
2104
|
|
|
|
|
|
|
my $VARIABLEMK = '\G\s*'; |
2105
|
|
|
|
|
|
|
my $NOCHECKMK = '\G\s*'; |
2106
|
|
|
|
|
|
|
my $AUTOACTIONPATMK = '\G\s*
|
2107
|
|
|
|
|
|
|
my $AUTOTREEMK = '\G\s*'; |
2108
|
|
|
|
|
|
|
my $AUTOSTUBMK = '\G\s*'; |
2109
|
|
|
|
|
|
|
my $AUTORULEMK = '\G\s*'; |
2110
|
|
|
|
|
|
|
my $REJECTMK = '\G\s*'; |
2111
|
|
|
|
|
|
|
my $CONDREJECTMK = '\G\s*
|
2112
|
|
|
|
|
|
|
my $SCOREMK = '\G\s*
|
2113
|
|
|
|
|
|
|
my $AUTOSCOREMK = '\G\s*
|
2114
|
|
|
|
|
|
|
my $SKIPMK = '\G\s*
|
2115
|
|
|
|
|
|
|
my $OPMK = '\G\s*<(left|right)op(?:=(\'.*?\'))?:'; |
2116
|
|
|
|
|
|
|
my $ENDDIRECTIVEMK = '\G\s*>'; |
2117
|
|
|
|
|
|
|
my $RESYNCMK = '\G\s*'; |
2118
|
|
|
|
|
|
|
my $RESYNCPATMK = '\G\s*
|
2119
|
|
|
|
|
|
|
my $RULEVARPATMK = '\G\s*
|
2120
|
|
|
|
|
|
|
my $DEFERPATMK = '\G\s*
|
2121
|
|
|
|
|
|
|
my $TOKENPATMK = '\G\s*
|
2122
|
|
|
|
|
|
|
my $AUTOERRORMK = '\G\s*'; |
2123
|
|
|
|
|
|
|
my $MSGERRORMK = '\G\s*
|
2124
|
|
|
|
|
|
|
my $NOCHECK = '\G\s*'; |
2125
|
|
|
|
|
|
|
my $WARNMK = '\G\s*'; |
2126
|
|
|
|
|
|
|
my $HINTMK = '\G\s*'; |
2127
|
|
|
|
|
|
|
my $TRACEBUILDMK = '\G\s*'; |
2128
|
|
|
|
|
|
|
my $TRACEPARSEMK = '\G\s*'; |
2129
|
|
|
|
|
|
|
my $UNCOMMITPROD = $PROD.'\s*
|
2130
|
|
|
|
|
|
|
my $ERRORPROD = $PROD.'\s*
|
2131
|
|
|
|
|
|
|
my $LONECOLON = '\G\s*:'; |
2132
|
|
|
|
|
|
|
my $OTHER = '\G\s*([^\s]+)'; |
2133
|
|
|
|
|
|
|
|
2134
|
|
|
|
|
|
|
my @lines = 0; |
2135
|
|
|
|
|
|
|
|
2136
|
|
|
|
|
|
|
sub _generate |
2137
|
|
|
|
|
|
|
{ |
2138
|
66
|
|
|
67
|
|
129
|
my ($self, $grammar, $replace, $isimplicit, $isleftop) = (@_, 0); |
2139
|
|
|
|
|
|
|
|
2140
|
66
|
|
|
|
|
69
|
my $aftererror = 0; |
2141
|
66
|
|
|
|
|
71
|
my $lookahead = 0; |
2142
|
66
|
|
|
|
|
96
|
my $lookaheadspec = ""; |
2143
|
66
|
|
|
|
|
61
|
my $must_pop_lines; |
2144
|
66
|
100
|
|
|
|
142
|
if (! $lines[-1]) { |
2145
|
29
|
|
|
|
|
79
|
push @lines, _linecount($grammar) ; |
2146
|
29
|
|
|
|
|
39
|
$must_pop_lines = 1; |
2147
|
|
|
|
|
|
|
} |
2148
|
|
|
|
|
|
|
$self->{_check}{itempos} = ($grammar =~ /\@itempos\b|\$itempos\s*\[/) |
2149
|
66
|
100
|
|
|
|
583
|
unless $self->{_check}{itempos}; |
2150
|
66
|
|
|
|
|
130
|
for (qw(thisoffset thiscolumn prevline prevoffset prevcolumn)) |
2151
|
|
|
|
|
|
|
{ |
2152
|
|
|
|
|
|
|
$self->{_check}{$_} = |
2153
|
|
|
|
|
|
|
($grammar =~ /\$$_/) || $self->{_check}{itempos} |
2154
|
330
|
100
|
33
|
|
|
4129
|
unless $self->{_check}{$_}; |
2155
|
|
|
|
|
|
|
} |
2156
|
66
|
|
|
|
|
69
|
my $line; |
2157
|
|
|
|
|
|
|
|
2158
|
66
|
|
|
|
|
62
|
my $rule = undef; |
2159
|
66
|
|
|
|
|
63
|
my $prod = undef; |
2160
|
66
|
|
|
|
|
61
|
my $item = undef; |
2161
|
66
|
|
|
|
|
71
|
my $lastgreedy = ''; |
2162
|
66
|
|
|
|
|
125
|
pos $grammar = 0; |
2163
|
66
|
|
|
|
|
95
|
study $grammar; |
2164
|
|
|
|
|
|
|
|
2165
|
66
|
|
|
|
|
65
|
local $::RD_HINT = $::RD_HINT; |
2166
|
66
|
|
|
|
|
63
|
local $::RD_WARN = $::RD_WARN; |
2167
|
66
|
|
|
|
|
62
|
local $::RD_TRACE = $::RD_TRACE; |
2168
|
66
|
|
|
|
|
56
|
local $::RD_CHECK = $::RD_CHECK; |
2169
|
|
|
|
|
|
|
|
2170
|
66
|
|
|
|
|
165
|
while (pos $grammar < length $grammar) |
2171
|
|
|
|
|
|
|
{ |
2172
|
4344
|
|
|
|
|
5530
|
$line = $lines[-1] - _linecount($grammar) + 1; |
2173
|
4344
|
|
|
|
|
3356
|
my $commitonly; |
2174
|
4344
|
|
|
|
|
3193
|
my $code = ""; |
2175
|
4344
|
|
|
|
|
4258
|
my @components = (); |
2176
|
4344
|
100
|
66
|
|
|
77276
|
if ($grammar =~ m/$COMMENT/gco) |
|
|
100
|
66
|
|
|
|
|
|
|
100
|
33
|
|
|
|
|
|
|
100
|
66
|
|
|
|
|
|
|
100
|
33
|
|
|
|
|
|
|
100
|
66
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2177
|
|
|
|
|
|
|
{ |
2178
|
51
|
|
|
|
|
185
|
_parse("a comment",0,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2179
|
51
|
|
|
|
|
141
|
next; |
2180
|
|
|
|
|
|
|
} |
2181
|
|
|
|
|
|
|
elsif ($grammar =~ m/$NEGLOOKAHEAD/gco) |
2182
|
|
|
|
|
|
|
{ |
2183
|
1
|
|
|
|
|
4
|
_parse("a negative lookahead",$aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2184
|
1
|
50
|
|
|
|
3
|
$lookahead = $lookahead ? -$lookahead : -1; |
2185
|
1
|
|
|
|
|
2
|
$lookaheadspec .= $1; |
2186
|
1
|
|
|
|
|
2
|
next; # SKIP LOOKAHEAD RESET AT END OF while LOOP |
2187
|
|
|
|
|
|
|
} |
2188
|
|
|
|
|
|
|
elsif ($grammar =~ m/$POSLOOKAHEAD/gco) |
2189
|
|
|
|
|
|
|
{ |
2190
|
7
|
|
|
|
|
38
|
_parse("a positive lookahead",$aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2191
|
7
|
50
|
|
|
|
21
|
$lookahead = $lookahead ? $lookahead : 1; |
2192
|
7
|
|
|
|
|
14
|
$lookaheadspec .= $1; |
2193
|
7
|
|
|
|
|
16
|
next; # SKIP LOOKAHEAD RESET AT END OF while LOOP |
2194
|
|
|
|
|
|
|
} |
2195
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$ACTION)/gco |
2196
|
85
|
|
|
|
|
184
|
and do { ($code) = extract_codeblock($grammar); $code }) |
|
85
|
|
|
|
|
153529
|
|
2197
|
|
|
|
|
|
|
{ |
2198
|
85
|
|
|
|
|
190
|
_parse("an action", $aftererror, $line, $code); |
2199
|
85
|
|
|
|
|
344
|
$item = new Parse::RecDescent::Action($code,$lookahead,$line); |
2200
|
85
|
100
|
66
|
|
|
272
|
$prod and $prod->additem($item) |
2201
|
|
|
|
|
|
|
or $self->_addstartcode($code); |
2202
|
|
|
|
|
|
|
} |
2203
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$IMPLICITSUBRULE)/gco |
2204
|
37
|
|
|
|
|
83
|
and do { ($code) = extract_codeblock($grammar,'{([',undef,'(',1); |
2205
|
37
|
|
|
|
|
8554
|
$code }) |
2206
|
|
|
|
|
|
|
{ |
2207
|
37
|
|
|
|
|
207
|
$code =~ s/\A\s*\(|\)\Z//g; |
2208
|
37
|
|
|
|
|
105
|
_parse("an implicit subrule", $aftererror, $line, |
2209
|
|
|
|
|
|
|
"( $code )"); |
2210
|
37
|
|
|
|
|
92
|
my $implicit = $rule->nextimplicit; |
2211
|
|
|
|
|
|
|
return undef |
2212
|
37
|
50
|
|
|
|
173
|
if !$self->_generate("$implicit : $code",$replace,1); |
2213
|
37
|
|
|
|
|
47
|
my $pos = pos $grammar; |
2214
|
37
|
|
|
|
|
421
|
substr($grammar,$pos,0,$implicit); |
2215
|
37
|
|
|
|
|
57
|
pos $grammar = $pos;; |
2216
|
|
|
|
|
|
|
} |
2217
|
|
|
|
|
|
|
elsif ($grammar =~ m/$ENDDIRECTIVEMK/gco) |
2218
|
|
|
|
|
|
|
{ |
2219
|
|
|
|
|
|
|
|
2220
|
|
|
|
|
|
|
# EXTRACT TRAILING REPETITION SPECIFIER (IF ANY) |
2221
|
|
|
|
|
|
|
|
2222
|
137
|
|
|
|
|
169
|
my ($minrep,$maxrep) = (1,$MAXREP); |
2223
|
137
|
100
|
|
|
|
249
|
if ($grammar =~ m/\G[(]/gc) |
2224
|
|
|
|
|
|
|
{ |
2225
|
3
|
|
|
|
|
5
|
pos($grammar)--; |
2226
|
|
|
|
|
|
|
|
2227
|
3
|
50
|
|
|
|
92
|
if ($grammar =~ m/$OPTIONAL/gco) |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2228
|
0
|
|
|
|
|
0
|
{ ($minrep, $maxrep) = (0,1) } |
2229
|
|
|
|
|
|
|
elsif ($grammar =~ m/$ANY/gco) |
2230
|
3
|
|
|
|
|
4
|
{ $minrep = 0 } |
2231
|
|
|
|
|
|
|
elsif ($grammar =~ m/$EXACTLY/gco) |
2232
|
0
|
|
|
|
|
0
|
{ ($minrep, $maxrep) = ($1,$1) } |
2233
|
|
|
|
|
|
|
elsif ($grammar =~ m/$BETWEEN/gco) |
2234
|
0
|
|
|
|
|
0
|
{ ($minrep, $maxrep) = ($1,$2) } |
2235
|
|
|
|
|
|
|
elsif ($grammar =~ m/$ATLEAST/gco) |
2236
|
0
|
|
|
|
|
0
|
{ $minrep = $1 } |
2237
|
|
|
|
|
|
|
elsif ($grammar =~ m/$ATMOST/gco) |
2238
|
0
|
|
|
|
|
0
|
{ $maxrep = $1 } |
2239
|
|
|
|
|
|
|
elsif ($grammar =~ m/$MANY/gco) |
2240
|
|
|
|
|
|
|
{ } |
2241
|
|
|
|
|
|
|
elsif ($grammar =~ m/$BADREP/gco) |
2242
|
|
|
|
|
|
|
{ |
2243
|
0
|
|
|
|
|
0
|
_parse("an invalid repetition specifier", 0,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2244
|
0
|
|
|
|
|
0
|
_error("Incorrect specification of a repeated directive", |
2245
|
|
|
|
|
|
|
$line); |
2246
|
0
|
|
|
|
|
0
|
_hint("Repeated directives cannot have |
2247
|
|
|
|
|
|
|
a maximum repetition of zero, nor can they have |
2248
|
|
|
|
|
|
|
negative components in their ranges."); |
2249
|
|
|
|
|
|
|
} |
2250
|
|
|
|
|
|
|
} |
2251
|
|
|
|
|
|
|
|
2252
|
137
|
50
|
|
|
|
353
|
$prod && $prod->enddirective($line,$minrep,$maxrep); |
2253
|
|
|
|
|
|
|
} |
2254
|
|
|
|
|
|
|
elsif ($grammar =~ m/\G\s*<[^m]/gc) |
2255
|
|
|
|
|
|
|
{ |
2256
|
166
|
|
|
|
|
309
|
pos($grammar)-=2; |
2257
|
|
|
|
|
|
|
|
2258
|
166
|
100
|
66
|
|
|
2730
|
if ($grammar =~ m/$OPMK/gco) |
|
|
100
|
33
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
|
|
50
|
66
|
|
|
|
|
|
|
50
|
66
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
|
|
100
|
33
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2259
|
|
|
|
|
|
|
{ |
2260
|
|
|
|
|
|
|
# $DB::single=1; |
2261
|
137
|
|
|
|
|
426
|
_parse("a $1-associative operator directive", $aftererror, $line, "<$1op:...>"); |
2262
|
137
|
|
100
|
|
|
562
|
$prod->adddirective($1, $line,$2||''); |
2263
|
|
|
|
|
|
|
} |
2264
|
|
|
|
|
|
|
elsif ($grammar =~ m/$UNCOMMITMK/gco) |
2265
|
|
|
|
|
|
|
{ |
2266
|
2
|
|
|
|
|
9
|
_parse("an uncommit marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2267
|
2
|
|
|
|
|
4
|
$item = new Parse::RecDescent::Directive('$commit=0;1', |
2268
|
|
|
|
|
|
|
$lookahead,$line,""); |
2269
|
2
|
50
|
33
|
|
|
5
|
$prod and $prod->additem($item) |
2270
|
|
|
|
|
|
|
or _no_rule("",$line); |
2271
|
|
|
|
|
|
|
} |
2272
|
|
|
|
|
|
|
elsif ($grammar =~ m/$QUOTELIKEMK/gco) |
2273
|
|
|
|
|
|
|
{ |
2274
|
0
|
|
|
|
|
0
|
_parse("an perl quotelike marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2275
|
0
|
|
|
|
|
0
|
$item = new Parse::RecDescent::Directive( |
2276
|
|
|
|
|
|
|
'my ($match,@res); |
2277
|
|
|
|
|
|
|
($match,$text,undef,@res) = |
2278
|
|
|
|
|
|
|
Text::Balanced::extract_quotelike($text,$skip); |
2279
|
|
|
|
|
|
|
$match ? \@res : undef; |
2280
|
|
|
|
|
|
|
', $lookahead,$line,""); |
2281
|
0
|
0
|
0
|
|
|
0
|
$prod and $prod->additem($item) |
2282
|
|
|
|
|
|
|
or _no_rule("",$line); |
2283
|
|
|
|
|
|
|
} |
2284
|
|
|
|
|
|
|
elsif ($grammar =~ m/$CODEBLOCKMK/gco) |
2285
|
|
|
|
|
|
|
{ |
2286
|
0
|
|
0
|
|
|
0
|
my $outer = $1||"{}"; |
2287
|
0
|
|
|
|
|
0
|
_parse("an perl codeblock marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2288
|
0
|
|
|
|
|
0
|
$item = new Parse::RecDescent::Directive( |
2289
|
|
|
|
|
|
|
'Text::Balanced::extract_codeblock($text,undef,$skip,\''.$outer.'\'); |
2290
|
|
|
|
|
|
|
', $lookahead,$line,""); |
2291
|
0
|
0
|
0
|
|
|
0
|
$prod and $prod->additem($item) |
2292
|
|
|
|
|
|
|
or _no_rule("",$line); |
2293
|
|
|
|
|
|
|
} |
2294
|
|
|
|
|
|
|
elsif ($grammar =~ m/$VARIABLEMK/gco) |
2295
|
|
|
|
|
|
|
{ |
2296
|
0
|
|
|
|
|
0
|
_parse("an perl variable marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2297
|
0
|
|
|
|
|
0
|
$item = new Parse::RecDescent::Directive( |
2298
|
|
|
|
|
|
|
'Text::Balanced::extract_variable($text,$skip); |
2299
|
|
|
|
|
|
|
', $lookahead,$line,""); |
2300
|
0
|
0
|
0
|
|
|
0
|
$prod and $prod->additem($item) |
2301
|
|
|
|
|
|
|
or _no_rule("",$line); |
2302
|
|
|
|
|
|
|
} |
2303
|
|
|
|
|
|
|
elsif ($grammar =~ m/$NOCHECKMK/gco) |
2304
|
|
|
|
|
|
|
{ |
2305
|
0
|
|
|
|
|
0
|
_parse("a disable checking marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2306
|
0
|
0
|
|
|
|
0
|
if ($rule) |
2307
|
|
|
|
|
|
|
{ |
2308
|
0
|
|
|
|
|
0
|
_error(" directive not at start of grammar", $line); |
2309
|
0
|
|
|
|
|
0
|
_hint("The directive can only |
2310
|
|
|
|
|
|
|
be specified at the start of a |
2311
|
|
|
|
|
|
|
grammar (before the first rule |
2312
|
|
|
|
|
|
|
is defined."); |
2313
|
|
|
|
|
|
|
} |
2314
|
|
|
|
|
|
|
else |
2315
|
|
|
|
|
|
|
{ |
2316
|
0
|
|
|
|
|
0
|
local $::RD_CHECK = 1; |
2317
|
|
|
|
|
|
|
} |
2318
|
|
|
|
|
|
|
} |
2319
|
|
|
|
|
|
|
elsif ($grammar =~ m/$AUTOSTUBMK/gco) |
2320
|
|
|
|
|
|
|
{ |
2321
|
0
|
|
|
|
|
0
|
_parse("an autostub marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2322
|
0
|
|
|
|
|
0
|
$::RD_AUTOSTUB = ""; |
2323
|
|
|
|
|
|
|
} |
2324
|
|
|
|
|
|
|
elsif ($grammar =~ m/$AUTORULEMK/gco) |
2325
|
|
|
|
|
|
|
{ |
2326
|
0
|
|
|
|
|
0
|
_parse("an autorule marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2327
|
0
|
|
|
|
|
0
|
$::RD_AUTOSTUB = $1; |
2328
|
|
|
|
|
|
|
} |
2329
|
|
|
|
|
|
|
elsif ($grammar =~ m/$AUTOTREEMK/gco) |
2330
|
|
|
|
|
|
|
{ |
2331
|
3
|
100
|
|
|
|
7
|
my $base = defined($1) ? $1 : ""; |
2332
|
3
|
|
|
|
|
11
|
my $current_match = substr($grammar, $-[0], $+[0] - $-[0]); |
2333
|
3
|
100
|
100
|
|
|
14
|
$base .= "::" if $base && $base !~ /::$/; |
2334
|
3
|
|
|
|
|
7
|
_parse("an autotree marker", $aftererror,$line, $current_match); |
2335
|
3
|
50
|
|
|
|
5
|
if ($rule) |
2336
|
|
|
|
|
|
|
{ |
2337
|
0
|
|
|
|
|
0
|
_error(" directive not at start of grammar", $line); |
2338
|
0
|
|
|
|
|
0
|
_hint("The directive can only |
2339
|
|
|
|
|
|
|
be specified at the start of a |
2340
|
|
|
|
|
|
|
grammar (before the first rule |
2341
|
|
|
|
|
|
|
is defined."); |
2342
|
|
|
|
|
|
|
} |
2343
|
|
|
|
|
|
|
else |
2344
|
|
|
|
|
|
|
{ |
2345
|
3
|
|
|
|
|
6
|
undef $self->{_AUTOACTION}; |
2346
|
|
|
|
|
|
|
$self->{_AUTOTREE}{NODE} |
2347
|
3
|
|
|
|
|
14
|
= new Parse::RecDescent::Action(q({bless \%item, ').$base.q('.$item[0]}),0,-1); |
2348
|
|
|
|
|
|
|
$self->{_AUTOTREE}{TERMINAL} |
2349
|
3
|
|
|
|
|
11
|
= new Parse::RecDescent::Action(q({bless {__VALUE__=>$item[1]}, ').$base.q('.$item[0]}),0,-1); |
2350
|
|
|
|
|
|
|
} |
2351
|
|
|
|
|
|
|
} |
2352
|
|
|
|
|
|
|
|
2353
|
|
|
|
|
|
|
elsif ($grammar =~ m/$REJECTMK/gco) |
2354
|
|
|
|
|
|
|
{ |
2355
|
1
|
|
|
|
|
6
|
_parse("an reject marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2356
|
1
|
|
|
|
|
8
|
$item = new Parse::RecDescent::UncondReject($lookahead,$line,""); |
2357
|
1
|
50
|
33
|
|
|
4
|
$prod and $prod->additem($item) |
2358
|
|
|
|
|
|
|
or _no_rule("",$line); |
2359
|
|
|
|
|
|
|
} |
2360
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$CONDREJECTMK)/gco |
2361
|
2
|
|
|
|
|
6
|
and do { ($code) = extract_codeblock($grammar,'{',undef,'<'); |
2362
|
2
|
|
|
|
|
1148
|
$code }) |
2363
|
|
|
|
|
|
|
{ |
2364
|
2
|
|
|
|
|
4
|
_parse("a (conditional) reject marker", $aftererror,$line, $code ); |
2365
|
2
|
|
|
|
|
6
|
$code =~ /\A\s*\Z/s; |
2366
|
2
|
|
|
|
|
4
|
my $cond = $1; |
2367
|
2
|
|
|
|
|
12
|
$item = new Parse::RecDescent::Directive( |
2368
|
|
|
|
|
|
|
"($1) ? undef : 1", $lookahead,$line,""); |
2369
|
2
|
50
|
33
|
|
|
7
|
$prod and $prod->additem($item) |
2370
|
|
|
|
|
|
|
or _no_rule("",$line); |
2371
|
|
|
|
|
|
|
} |
2372
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$SCOREMK)/gco |
2373
|
0
|
|
|
|
|
0
|
and do { ($code) = extract_codeblock($grammar,'{',undef,'<'); |
2374
|
0
|
|
|
|
|
0
|
$code }) |
2375
|
|
|
|
|
|
|
{ |
2376
|
0
|
|
|
|
|
0
|
_parse("a score marker", $aftererror,$line, $code ); |
2377
|
0
|
|
|
|
|
0
|
$code =~ /\A\s*\Z/s; |
2378
|
0
|
0
|
0
|
|
|
0
|
$prod and $prod->addscore($1, $lookahead, $line) |
2379
|
|
|
|
|
|
|
or _no_rule($code,$line); |
2380
|
|
|
|
|
|
|
} |
2381
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$AUTOSCOREMK)/gco |
2382
|
0
|
|
|
|
|
0
|
and do { ($code) = extract_codeblock($grammar,'{',undef,'<'); |
2383
|
0
|
|
|
|
|
0
|
$code; |
2384
|
|
|
|
|
|
|
} ) |
2385
|
|
|
|
|
|
|
{ |
2386
|
0
|
|
|
|
|
0
|
_parse("an autoscore specifier", $aftererror,$line,$code); |
2387
|
0
|
|
|
|
|
0
|
$code =~ /\A\s*\Z/s; |
2388
|
|
|
|
|
|
|
|
2389
|
0
|
0
|
0
|
|
|
0
|
$rule and $rule->addautoscore($1,$self) |
2390
|
|
|
|
|
|
|
or _no_rule($code,$line); |
2391
|
|
|
|
|
|
|
|
2392
|
0
|
|
|
|
|
0
|
$item = new Parse::RecDescent::UncondReject($lookahead,$line,$code); |
2393
|
0
|
0
|
0
|
|
|
0
|
$prod and $prod->additem($item) |
2394
|
|
|
|
|
|
|
or _no_rule($code,$line); |
2395
|
|
|
|
|
|
|
} |
2396
|
|
|
|
|
|
|
elsif ($grammar =~ m/$RESYNCMK/gco) |
2397
|
|
|
|
|
|
|
{ |
2398
|
8
|
|
|
|
|
38
|
_parse("a resync to newline marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2399
|
8
|
|
|
|
|
55
|
$item = new Parse::RecDescent::Directive( |
2400
|
|
|
|
|
|
|
'if ($text =~ s/(\A[^\n]*\n)//) { $return = 0; $1; } else { undef }', |
2401
|
|
|
|
|
|
|
$lookahead,$line,""); |
2402
|
8
|
50
|
33
|
|
|
30
|
$prod and $prod->additem($item) |
2403
|
|
|
|
|
|
|
or _no_rule("",$line); |
2404
|
|
|
|
|
|
|
} |
2405
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$RESYNCPATMK)/gco |
2406
|
0
|
|
|
|
|
0
|
and do { ($code) = extract_bracketed($grammar,'<'); |
2407
|
0
|
|
|
|
|
0
|
$code }) |
2408
|
|
|
|
|
|
|
{ |
2409
|
0
|
|
|
|
|
0
|
_parse("a resync with pattern marker", $aftererror,$line, $code ); |
2410
|
0
|
|
|
|
|
0
|
$code =~ /\A\s*\Z/s; |
2411
|
0
|
|
|
|
|
0
|
$item = new Parse::RecDescent::Directive( |
2412
|
|
|
|
|
|
|
'if ($text =~ s/(\A'.$1.')//) { $return = 0; $1; } else { undef }', |
2413
|
|
|
|
|
|
|
$lookahead,$line,$code); |
2414
|
0
|
0
|
0
|
|
|
0
|
$prod and $prod->additem($item) |
2415
|
|
|
|
|
|
|
or _no_rule($code,$line); |
2416
|
|
|
|
|
|
|
} |
2417
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$SKIPMK)/gco |
2418
|
4
|
|
|
|
|
17
|
and do { ($code) = extract_codeblock($grammar,'<'); |
2419
|
4
|
|
|
|
|
1594
|
$code }) |
2420
|
|
|
|
|
|
|
{ |
2421
|
4
|
|
|
|
|
9
|
_parse("a skip marker", $aftererror,$line, $code ); |
2422
|
4
|
|
|
|
|
13
|
$code =~ /\A\s*\Z/s; |
2423
|
4
|
100
|
|
|
|
10
|
if ($rule) { |
2424
|
3
|
|
|
|
|
23
|
$item = new Parse::RecDescent::Directive( |
2425
|
|
|
|
|
|
|
'my $oldskip = $skip; $skip='.$1.'; $oldskip', |
2426
|
|
|
|
|
|
|
$lookahead,$line,$code); |
2427
|
3
|
50
|
33
|
|
|
13
|
$prod and $prod->additem($item) |
2428
|
|
|
|
|
|
|
or _no_rule($code,$line); |
2429
|
|
|
|
|
|
|
} else { |
2430
|
|
|
|
|
|
|
#global directive |
2431
|
1
|
|
|
|
|
3
|
$self->{skip} = $1; |
2432
|
|
|
|
|
|
|
} |
2433
|
|
|
|
|
|
|
} |
2434
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$RULEVARPATMK)/gco |
2435
|
1
|
|
|
|
|
4
|
and do { ($code) = extract_codeblock($grammar,'{',undef,'<'); |
2436
|
1
|
|
|
|
|
389
|
$code; |
2437
|
|
|
|
|
|
|
} ) |
2438
|
|
|
|
|
|
|
{ |
2439
|
1
|
|
|
|
|
3
|
_parse("a rule variable specifier", $aftererror,$line,$code); |
2440
|
1
|
|
|
|
|
4
|
$code =~ /\A\s*\Z/s; |
2441
|
|
|
|
|
|
|
|
2442
|
1
|
50
|
33
|
|
|
5
|
$rule and $rule->addvar($1,$self) |
2443
|
|
|
|
|
|
|
or _no_rule($code,$line); |
2444
|
|
|
|
|
|
|
|
2445
|
1
|
|
|
|
|
7
|
$item = new Parse::RecDescent::UncondReject($lookahead,$line,$code); |
2446
|
1
|
50
|
33
|
|
|
4
|
$prod and $prod->additem($item) |
2447
|
|
|
|
|
|
|
or _no_rule($code,$line); |
2448
|
|
|
|
|
|
|
} |
2449
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$AUTOACTIONPATMK)/gco |
2450
|
0
|
|
|
|
|
0
|
and do { ($code) = extract_codeblock($grammar,'{',undef,'<'); |
2451
|
0
|
|
|
|
|
0
|
$code; |
2452
|
|
|
|
|
|
|
} ) |
2453
|
|
|
|
|
|
|
{ |
2454
|
0
|
|
|
|
|
0
|
_parse("an autoaction specifier", $aftererror,$line,$code); |
2455
|
0
|
|
|
|
|
0
|
$code =~ s/\A\s*\Z/$1/s; |
2456
|
0
|
0
|
|
|
|
0
|
if ($code =~ /\A\s*[^{]|[^}]\s*\Z/) { |
2457
|
0
|
|
|
|
|
0
|
$code = "{ $code }" |
2458
|
|
|
|
|
|
|
} |
2459
|
|
|
|
|
|
|
$self->{_check}{itempos} = |
2460
|
0
|
|
|
|
|
0
|
$code =~ /\@itempos\b|\$itempos\s*\[/; |
2461
|
|
|
|
|
|
|
$self->{_AUTOACTION} |
2462
|
0
|
|
|
|
|
0
|
= new Parse::RecDescent::Action($code,0,-$line) |
2463
|
|
|
|
|
|
|
} |
2464
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$DEFERPATMK)/gco |
2465
|
0
|
|
|
|
|
0
|
and do { ($code) = extract_codeblock($grammar,'{',undef,'<'); |
2466
|
0
|
|
|
|
|
0
|
$code; |
2467
|
|
|
|
|
|
|
} ) |
2468
|
|
|
|
|
|
|
{ |
2469
|
0
|
|
|
|
|
0
|
_parse("a deferred action specifier", $aftererror,$line,$code); |
2470
|
0
|
|
|
|
|
0
|
$code =~ s/\A\s*\Z/$1/s; |
2471
|
0
|
0
|
|
|
|
0
|
if ($code =~ /\A\s*[^{]|[^}]\s*\Z/) |
2472
|
|
|
|
|
|
|
{ |
2473
|
0
|
|
|
|
|
0
|
$code = "{ $code }" |
2474
|
|
|
|
|
|
|
} |
2475
|
|
|
|
|
|
|
|
2476
|
0
|
|
|
|
|
0
|
$item = new Parse::RecDescent::Directive( |
2477
|
|
|
|
|
|
|
"push \@{\$thisparser->{deferred}}, sub $code;", |
2478
|
|
|
|
|
|
|
$lookahead,$line,""); |
2479
|
0
|
0
|
0
|
|
|
0
|
$prod and $prod->additem($item) |
2480
|
|
|
|
|
|
|
or _no_rule("",$line); |
2481
|
|
|
|
|
|
|
|
2482
|
0
|
|
|
|
|
0
|
$self->{deferrable} = 1; |
2483
|
|
|
|
|
|
|
} |
2484
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$TOKENPATMK)/gco |
2485
|
0
|
|
|
|
|
0
|
and do { ($code) = extract_codeblock($grammar,'{',undef,'<'); |
2486
|
0
|
|
|
|
|
0
|
$code; |
2487
|
|
|
|
|
|
|
} ) |
2488
|
|
|
|
|
|
|
{ |
2489
|
0
|
|
|
|
|
0
|
_parse("a token constructor", $aftererror,$line,$code); |
2490
|
0
|
|
|
|
|
0
|
$code =~ s/\A\s*\Z/$1/s; |
2491
|
|
|
|
|
|
|
|
2492
|
0
|
|
0
|
|
|
0
|
my $types = eval 'no strict; local $SIG{__WARN__} = sub {0}; my @arr=('.$code.'); @arr' || (); |
2493
|
0
|
0
|
|
|
|
0
|
if (!$types) |
2494
|
|
|
|
|
|
|
{ |
2495
|
0
|
|
|
|
|
0
|
_error("Incorrect token specification: \"$@\"", $line); |
2496
|
0
|
|
|
|
|
0
|
_hint("The directive requires a list |
2497
|
|
|
|
|
|
|
of one or more strings representing possible |
2498
|
|
|
|
|
|
|
types of the specified token. For example: |
2499
|
|
|
|
|
|
|
"); |
2500
|
|
|
|
|
|
|
} |
2501
|
|
|
|
|
|
|
else |
2502
|
|
|
|
|
|
|
{ |
2503
|
0
|
|
|
|
|
0
|
$item = new Parse::RecDescent::Directive( |
2504
|
|
|
|
|
|
|
'no strict; |
2505
|
|
|
|
|
|
|
$return = { text => $item[-1] }; |
2506
|
|
|
|
|
|
|
@{$return->{type}}{'.$code.'} = (1..'.$types.');', |
2507
|
|
|
|
|
|
|
$lookahead,$line,""); |
2508
|
0
|
0
|
0
|
|
|
0
|
$prod and $prod->additem($item) |
2509
|
|
|
|
|
|
|
or _no_rule("",$line); |
2510
|
|
|
|
|
|
|
} |
2511
|
|
|
|
|
|
|
} |
2512
|
|
|
|
|
|
|
elsif ($grammar =~ m/$COMMITMK/gco) |
2513
|
|
|
|
|
|
|
{ |
2514
|
1
|
|
|
|
|
6
|
_parse("an commit marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2515
|
1
|
|
|
|
|
4
|
$item = new Parse::RecDescent::Directive('$commit = 1', |
2516
|
|
|
|
|
|
|
$lookahead,$line,""); |
2517
|
1
|
50
|
33
|
|
|
4
|
$prod and $prod->additem($item) |
2518
|
|
|
|
|
|
|
or _no_rule("",$line); |
2519
|
|
|
|
|
|
|
} |
2520
|
|
|
|
|
|
|
elsif ($grammar =~ m/$NOCHECKMK/gco) { |
2521
|
0
|
|
|
|
|
0
|
_parse("an hint request", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2522
|
0
|
|
|
|
|
0
|
$::RD_CHECK = 0; |
2523
|
|
|
|
|
|
|
} |
2524
|
|
|
|
|
|
|
elsif ($grammar =~ m/$HINTMK/gco) { |
2525
|
0
|
|
|
|
|
0
|
_parse("an hint request", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2526
|
0
|
|
|
|
|
0
|
$::RD_HINT = $self->{__HINT__} = 1; |
2527
|
|
|
|
|
|
|
} |
2528
|
|
|
|
|
|
|
elsif ($grammar =~ m/$WARNMK/gco) { |
2529
|
0
|
|
|
|
|
0
|
_parse("an warning request", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2530
|
0
|
0
|
|
|
|
0
|
$::RD_WARN = $self->{__WARN__} = $1 ? $2+0 : 1; |
2531
|
|
|
|
|
|
|
} |
2532
|
|
|
|
|
|
|
elsif ($grammar =~ m/$TRACEBUILDMK/gco) { |
2533
|
0
|
|
|
|
|
0
|
_parse("an grammar build trace request", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2534
|
0
|
0
|
|
|
|
0
|
$::RD_TRACE = $1 ? $2+0 : 1; |
2535
|
|
|
|
|
|
|
} |
2536
|
|
|
|
|
|
|
elsif ($grammar =~ m/$TRACEPARSEMK/gco) { |
2537
|
0
|
|
|
|
|
0
|
_parse("an parse trace request", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2538
|
0
|
0
|
|
|
|
0
|
$self->{__TRACE__} = $1 ? $2+0 : 1; |
2539
|
|
|
|
|
|
|
} |
2540
|
|
|
|
|
|
|
elsif ($grammar =~ m/$AUTOERRORMK/gco) |
2541
|
|
|
|
|
|
|
{ |
2542
|
7
|
|
|
|
|
19
|
$commitonly = $1; |
2543
|
7
|
|
|
|
|
31
|
_parse("an error marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2544
|
7
|
|
|
|
|
54
|
$item = new Parse::RecDescent::Error('',$lookahead,$1,$line); |
2545
|
7
|
50
|
33
|
|
|
29
|
$prod and $prod->additem($item) |
2546
|
|
|
|
|
|
|
or _no_rule("",$line); |
2547
|
7
|
|
|
|
|
14
|
$aftererror = !$commitonly; |
2548
|
|
|
|
|
|
|
} |
2549
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$MSGERRORMK)/gco |
2550
|
0
|
|
|
|
|
0
|
and do { $commitonly = $1; |
2551
|
0
|
|
|
|
|
0
|
($code) = extract_bracketed($grammar,'<'); |
2552
|
0
|
|
|
|
|
0
|
$code }) |
2553
|
|
|
|
|
|
|
{ |
2554
|
0
|
|
|
|
|
0
|
_parse("an error marker", $aftererror,$line,$code); |
2555
|
0
|
|
|
|
|
0
|
$code =~ /\A\s*\Z/s; |
2556
|
0
|
|
|
|
|
0
|
$item = new Parse::RecDescent::Error($1,$lookahead,$commitonly,$line); |
2557
|
0
|
0
|
0
|
|
|
0
|
$prod and $prod->additem($item) |
2558
|
|
|
|
|
|
|
or _no_rule("$code",$line); |
2559
|
0
|
|
|
|
|
0
|
$aftererror = !$commitonly; |
2560
|
|
|
|
|
|
|
} |
2561
|
0
|
|
|
|
|
0
|
elsif (do { $commitonly = $1; |
2562
|
0
|
|
|
|
|
0
|
($code) = extract_bracketed($grammar,'<'); |
2563
|
0
|
|
|
|
|
0
|
$code }) |
2564
|
|
|
|
|
|
|
{ |
2565
|
0
|
0
|
|
|
|
0
|
if ($code =~ /^<[A-Z_]+>$/) |
2566
|
|
|
|
|
|
|
{ |
2567
|
0
|
|
|
|
|
0
|
_error("Token items are not yet |
2568
|
|
|
|
|
|
|
supported: \"$code\"", |
2569
|
|
|
|
|
|
|
$line); |
2570
|
0
|
|
|
|
|
0
|
_hint("Items like $code that consist of angle |
2571
|
|
|
|
|
|
|
brackets enclosing a sequence of |
2572
|
|
|
|
|
|
|
uppercase characters will eventually |
2573
|
|
|
|
|
|
|
be used to specify pre-lexed tokens |
2574
|
|
|
|
|
|
|
in a grammar. That functionality is not |
2575
|
|
|
|
|
|
|
yet implemented. Or did you misspell |
2576
|
|
|
|
|
|
|
\"$code\"?"); |
2577
|
|
|
|
|
|
|
} |
2578
|
|
|
|
|
|
|
else |
2579
|
|
|
|
|
|
|
{ |
2580
|
0
|
|
|
|
|
0
|
_error("Untranslatable item encountered: \"$code\"", |
2581
|
|
|
|
|
|
|
$line); |
2582
|
0
|
|
|
|
|
0
|
_hint("Did you misspell \"$code\" |
2583
|
|
|
|
|
|
|
or forget to comment it out?"); |
2584
|
|
|
|
|
|
|
} |
2585
|
|
|
|
|
|
|
} |
2586
|
|
|
|
|
|
|
} |
2587
|
|
|
|
|
|
|
elsif ($grammar =~ m/$RULE/gco) |
2588
|
|
|
|
|
|
|
{ |
2589
|
662
|
50
|
|
|
|
2528
|
_parseunneg("a rule declaration", 0, |
2590
|
|
|
|
|
|
|
$lookahead,$line, substr($grammar, $-[0], $+[0] - $-[0]) ) or next; |
2591
|
662
|
|
|
|
|
1356
|
my $rulename = $1; |
2592
|
662
|
50
|
|
|
|
1519
|
if ($rulename =~ /Replace|Extend|Precompile|PrecompiledRuntime|Save/ ) |
2593
|
|
|
|
|
|
|
{ |
2594
|
0
|
0
|
|
|
|
0
|
_warn(2,"Rule \"$rulename\" hidden by method |
2595
|
|
|
|
|
|
|
Parse::RecDescent::$rulename",$line) |
2596
|
|
|
|
|
|
|
and |
2597
|
|
|
|
|
|
|
_hint("The rule named \"$rulename\" cannot be directly |
2598
|
|
|
|
|
|
|
called through the Parse::RecDescent object |
2599
|
|
|
|
|
|
|
for this grammar (although it may still |
2600
|
|
|
|
|
|
|
be used as a subrule of other rules). |
2601
|
|
|
|
|
|
|
It can't be directly called because |
2602
|
|
|
|
|
|
|
Parse::RecDescent::$rulename is already defined (it |
2603
|
|
|
|
|
|
|
is the standard method of all |
2604
|
|
|
|
|
|
|
parsers)."); |
2605
|
|
|
|
|
|
|
} |
2606
|
662
|
|
|
|
|
1195
|
$rule = new Parse::RecDescent::Rule($rulename,$self,$line,$replace); |
2607
|
662
|
100
|
|
|
|
1506
|
$prod->check_pending($line) if $prod; |
2608
|
662
|
|
|
|
|
959
|
$prod = $rule->addprod( new Parse::RecDescent::Production ); |
2609
|
662
|
|
|
|
|
662
|
$aftererror = 0; |
2610
|
|
|
|
|
|
|
} |
2611
|
|
|
|
|
|
|
elsif ($grammar =~ m/$UNCOMMITPROD/gco) |
2612
|
|
|
|
|
|
|
{ |
2613
|
1
|
|
|
|
|
3
|
pos($grammar)-=9; |
2614
|
1
|
50
|
|
|
|
5
|
_parseunneg("a new (uncommitted) production", |
2615
|
|
|
|
|
|
|
0, $lookahead, $line, substr($grammar, $-[0], $+[0] - $-[0]) ) or next; |
2616
|
|
|
|
|
|
|
|
2617
|
1
|
50
|
|
|
|
5
|
$prod->check_pending($line) if $prod; |
2618
|
1
|
|
|
|
|
2
|
$prod = new Parse::RecDescent::Production($line,1); |
2619
|
1
|
50
|
33
|
|
|
6
|
$rule and $rule->addprod($prod) |
2620
|
|
|
|
|
|
|
or _no_rule("",$line); |
2621
|
1
|
|
|
|
|
1
|
$aftererror = 0; |
2622
|
|
|
|
|
|
|
} |
2623
|
|
|
|
|
|
|
elsif ($grammar =~ m/$ERRORPROD/gco) |
2624
|
|
|
|
|
|
|
{ |
2625
|
7
|
|
|
|
|
17
|
pos($grammar)-=6; |
2626
|
7
|
50
|
|
|
|
33
|
_parseunneg("a new (error) production", $aftererror, |
2627
|
|
|
|
|
|
|
$lookahead,$line, substr($grammar, $-[0], $+[0] - $-[0]) ) or next; |
2628
|
7
|
50
|
|
|
|
35
|
$prod->check_pending($line) if $prod; |
2629
|
7
|
|
|
|
|
19
|
$prod = new Parse::RecDescent::Production($line,0,1); |
2630
|
7
|
50
|
33
|
|
|
23
|
$rule and $rule->addprod($prod) |
2631
|
|
|
|
|
|
|
or _no_rule("",$line); |
2632
|
7
|
|
|
|
|
8
|
$aftererror = 0; |
2633
|
|
|
|
|
|
|
} |
2634
|
|
|
|
|
|
|
elsif ($grammar =~ m/$PROD/gco) |
2635
|
|
|
|
|
|
|
{ |
2636
|
582
|
50
|
|
|
|
2184
|
_parseunneg("a new production", 0, |
2637
|
|
|
|
|
|
|
$lookahead,$line, substr($grammar, $-[0], $+[0] - $-[0]) ) or next; |
2638
|
582
|
50
|
33
|
|
|
2313
|
$rule |
|
|
|
33
|
|
|
|
|
|
|
|
33
|
|
|
|
|
2639
|
|
|
|
|
|
|
and (!$prod || $prod->check_pending($line)) |
2640
|
|
|
|
|
|
|
and $prod = $rule->addprod(new Parse::RecDescent::Production($line)) |
2641
|
|
|
|
|
|
|
or _no_rule("production",$line); |
2642
|
582
|
|
|
|
|
544
|
$aftererror = 0; |
2643
|
|
|
|
|
|
|
} |
2644
|
|
|
|
|
|
|
elsif ($grammar =~ m/$LITERAL/gco) |
2645
|
|
|
|
|
|
|
{ |
2646
|
919
|
|
|
|
|
1265
|
my $literal = $1; |
2647
|
919
|
|
|
|
|
1093
|
($code = $literal) =~ s/\\\\/\\/g; |
2648
|
919
|
|
|
|
|
1210
|
_parse("a literal terminal", $aftererror,$line,$literal); |
2649
|
919
|
|
|
|
|
1701
|
$item = new Parse::RecDescent::Literal($code,$lookahead,$line); |
2650
|
919
|
50
|
33
|
|
|
2030
|
$prod and $prod->additem($item) |
2651
|
|
|
|
|
|
|
or _no_rule("literal terminal",$line,"'$literal'"); |
2652
|
|
|
|
|
|
|
} |
2653
|
|
|
|
|
|
|
elsif ($grammar =~ m/$INTERPLIT/gco) |
2654
|
|
|
|
|
|
|
{ |
2655
|
5
|
|
|
|
|
21
|
_parse("an interpolated literal terminal", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2656
|
5
|
|
|
|
|
23
|
$item = new Parse::RecDescent::InterpLit($1,$lookahead,$line); |
2657
|
5
|
50
|
33
|
|
|
15
|
$prod and $prod->additem($item) |
2658
|
|
|
|
|
|
|
or _no_rule("interpolated literal terminal",$line,"'$1'"); |
2659
|
|
|
|
|
|
|
} |
2660
|
|
|
|
|
|
|
elsif ($grammar =~ m/$TOKEN/gco) |
2661
|
|
|
|
|
|
|
{ |
2662
|
208
|
|
|
|
|
847
|
_parse("a /../ pattern terminal", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) ); |
2663
|
208
|
100
|
|
|
|
934
|
$item = new Parse::RecDescent::Token($1,'/',$3?$3:'',$lookahead,$line); |
2664
|
208
|
50
|
33
|
|
|
628
|
$prod and $prod->additem($item) |
2665
|
|
|
|
|
|
|
or _no_rule("pattern terminal",$line,"/$1/"); |
2666
|
|
|
|
|
|
|
} |
2667
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$MTOKEN)/gco |
2668
|
0
|
|
|
|
|
0
|
and do { ($code, undef, @components) |
2669
|
|
|
|
|
|
|
= extract_quotelike($grammar); |
2670
|
0
|
|
|
|
|
0
|
$code } |
2671
|
|
|
|
|
|
|
) |
2672
|
|
|
|
|
|
|
|
2673
|
|
|
|
|
|
|
{ |
2674
|
0
|
|
|
|
|
0
|
_parse("an m/../ pattern terminal", $aftererror,$line,$code); |
2675
|
0
|
|
|
|
|
0
|
$item = new Parse::RecDescent::Token(@components[3,2,8], |
2676
|
|
|
|
|
|
|
$lookahead,$line); |
2677
|
0
|
0
|
0
|
|
|
0
|
$prod and $prod->additem($item) |
2678
|
|
|
|
|
|
|
or _no_rule("pattern terminal",$line,$code); |
2679
|
|
|
|
|
|
|
} |
2680
|
|
|
|
|
|
|
elsif ($grammar =~ m/(?=$MATCHRULE)/gco |
2681
|
2
|
|
|
|
|
6
|
and do { ($code) = extract_bracketed($grammar,'<'); |
2682
|
2
|
|
|
|
|
240
|
$code |
2683
|
|
|
|
|
|
|
} |
2684
|
|
|
|
|
|
|
or $grammar =~ m/$SUBRULE/gco |
2685
|
|
|
|
|
|
|
and $code = $1) |
2686
|
|
|
|
|
|
|
{ |
2687
|
1476
|
|
|
|
|
1190
|
my $name = $code; |
2688
|
1476
|
|
|
|
|
1031
|
my $matchrule = 0; |
2689
|
1476
|
100
|
|
|
|
2534
|
if (substr($name,0,1) eq '<') |
2690
|
|
|
|
|
|
|
{ |
2691
|
2
|
|
|
|
|
21
|
$name =~ s/$MATCHRULE\s*//; |
2692
|
2
|
|
|
|
|
6
|
$name =~ s/\s*>\Z//; |
2693
|
2
|
|
|
|
|
2
|
$matchrule = 1; |
2694
|
|
|
|
|
|
|
} |
2695
|
|
|
|
|
|
|
|
2696
|
|
|
|
|
|
|
# EXTRACT TRAILING ARG LIST (IF ANY) |
2697
|
|
|
|
|
|
|
|
2698
|
1476
|
|
100
|
|
|
2956
|
my ($argcode) = extract_codeblock($grammar, "[]",'') || ''; |
2699
|
|
|
|
|
|
|
|
2700
|
|
|
|
|
|
|
# EXTRACT TRAILING REPETITION SPECIFIER (IF ANY) |
2701
|
|
|
|
|
|
|
|
2702
|
1476
|
100
|
|
|
|
69738
|
if ($grammar =~ m/\G[(]/gc) |
2703
|
|
|
|
|
|
|
{ |
2704
|
456
|
|
|
|
|
671
|
pos($grammar)--; |
2705
|
|
|
|
|
|
|
|
2706
|
456
|
100
|
|
|
|
2463
|
if ($grammar =~ m/$OPTIONAL/gco) |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2707
|
|
|
|
|
|
|
{ |
2708
|
246
|
|
|
|
|
736
|
_parse("an zero-or-one subrule match", $aftererror,$line,"$code$argcode($1)"); |
2709
|
246
|
|
|
|
|
576
|
$item = new Parse::RecDescent::Repetition($name,$1,0,1, |
2710
|
|
|
|
|
|
|
$lookahead,$line, |
2711
|
|
|
|
|
|
|
$self, |
2712
|
|
|
|
|
|
|
$matchrule, |
2713
|
|
|
|
|
|
|
$argcode); |
2714
|
246
|
50
|
33
|
|
|
626
|
$prod and $prod->additem($item) |
2715
|
|
|
|
|
|
|
or _no_rule("repetition",$line,"$code$argcode($1)"); |
2716
|
|
|
|
|
|
|
|
2717
|
246
|
50
|
33
|
|
|
909
|
!$matchrule and $rule and $rule->addcall($name); |
2718
|
|
|
|
|
|
|
} |
2719
|
|
|
|
|
|
|
elsif ($grammar =~ m/$ANY/gco) |
2720
|
|
|
|
|
|
|
{ |
2721
|
30
|
|
|
|
|
113
|
_parse("a zero-or-more subrule match", $aftererror,$line,"$code$argcode($1)"); |
2722
|
30
|
100
|
|
|
|
74
|
if ($2) |
2723
|
|
|
|
|
|
|
{ |
2724
|
1
|
|
|
|
|
2
|
my $pos = pos $grammar; |
2725
|
1
|
|
|
|
|
4
|
substr($grammar,$pos,0, |
2726
|
|
|
|
|
|
|
"(s?) "); |
2727
|
|
|
|
|
|
|
|
2728
|
1
|
|
|
|
|
2
|
pos $grammar = $pos; |
2729
|
|
|
|
|
|
|
} |
2730
|
|
|
|
|
|
|
else |
2731
|
|
|
|
|
|
|
{ |
2732
|
29
|
|
|
|
|
90
|
$item = new Parse::RecDescent::Repetition($name,$1,0,$MAXREP, |
2733
|
|
|
|
|
|
|
$lookahead,$line, |
2734
|
|
|
|
|
|
|
$self, |
2735
|
|
|
|
|
|
|
$matchrule, |
2736
|
|
|
|
|
|
|
$argcode); |
2737
|
29
|
50
|
33
|
|
|
95
|
$prod and $prod->additem($item) |
2738
|
|
|
|
|
|
|
or _no_rule("repetition",$line,"$code$argcode($1)"); |
2739
|
|
|
|
|
|
|
|
2740
|
29
|
50
|
33
|
|
|
128
|
!$matchrule and $rule and $rule->addcall($name); |
2741
|
|
|
|
|
|
|
|
2742
|
29
|
50
|
|
|
|
88
|
_check_insatiable($name,$1,$grammar,$line) if $::RD_CHECK; |
2743
|
|
|
|
|
|
|
} |
2744
|
|
|
|
|
|
|
} |
2745
|
|
|
|
|
|
|
elsif ($grammar =~ m/$MANY/gco) |
2746
|
|
|
|
|
|
|
{ |
2747
|
179
|
|
|
|
|
549
|
_parse("a one-or-more subrule match", $aftererror,$line,"$code$argcode($1)"); |
2748
|
179
|
100
|
|
|
|
397
|
if ($2) |
2749
|
|
|
|
|
|
|
{ |
2750
|
|
|
|
|
|
|
# $DB::single=1; |
2751
|
126
|
|
|
|
|
137
|
my $pos = pos $grammar; |
2752
|
126
|
|
|
|
|
1535
|
substr($grammar,$pos,0, |
2753
|
|
|
|
|
|
|
" "); |
2754
|
|
|
|
|
|
|
|
2755
|
126
|
|
|
|
|
222
|
pos $grammar = $pos; |
2756
|
|
|
|
|
|
|
} |
2757
|
|
|
|
|
|
|
else |
2758
|
|
|
|
|
|
|
{ |
2759
|
53
|
|
|
|
|
194
|
$item = new Parse::RecDescent::Repetition($name,$1,1,$MAXREP, |
2760
|
|
|
|
|
|
|
$lookahead,$line, |
2761
|
|
|
|
|
|
|
$self, |
2762
|
|
|
|
|
|
|
$matchrule, |
2763
|
|
|
|
|
|
|
$argcode); |
2764
|
|
|
|
|
|
|
|
2765
|
53
|
50
|
33
|
|
|
219
|
$prod and $prod->additem($item) |
2766
|
|
|
|
|
|
|
or _no_rule("repetition",$line,"$code$argcode($1)"); |
2767
|
|
|
|
|
|
|
|
2768
|
53
|
50
|
33
|
|
|
366
|
!$matchrule and $rule and $rule->addcall($name); |
2769
|
|
|
|
|
|
|
|
2770
|
53
|
50
|
|
|
|
169
|
_check_insatiable($name,$1,$grammar,$line) if $::RD_CHECK; |
2771
|
|
|
|
|
|
|
} |
2772
|
|
|
|
|
|
|
} |
2773
|
|
|
|
|
|
|
elsif ($grammar =~ m/$EXACTLY/gco) |
2774
|
|
|
|
|
|
|
{ |
2775
|
0
|
|
|
|
|
0
|
_parse("an exactly-$1-times subrule match", $aftererror,$line,"$code$argcode($1)"); |
2776
|
0
|
0
|
|
|
|
0
|
if ($2) |
2777
|
|
|
|
|
|
|
{ |
2778
|
0
|
|
|
|
|
0
|
my $pos = pos $grammar; |
2779
|
0
|
|
|
|
|
0
|
substr($grammar,$pos,0, |
2780
|
|
|
|
|
|
|
"($1) "); |
2781
|
|
|
|
|
|
|
|
2782
|
0
|
|
|
|
|
0
|
pos $grammar = $pos; |
2783
|
|
|
|
|
|
|
} |
2784
|
|
|
|
|
|
|
else |
2785
|
|
|
|
|
|
|
{ |
2786
|
0
|
|
|
|
|
0
|
$item = new Parse::RecDescent::Repetition($name,$1,$1,$1, |
2787
|
|
|
|
|
|
|
$lookahead,$line, |
2788
|
|
|
|
|
|
|
$self, |
2789
|
|
|
|
|
|
|
$matchrule, |
2790
|
|
|
|
|
|
|
$argcode); |
2791
|
0
|
0
|
0
|
|
|
0
|
$prod and $prod->additem($item) |
2792
|
|
|
|
|
|
|
or _no_rule("repetition",$line,"$code$argcode($1)"); |
2793
|
|
|
|
|
|
|
|
2794
|
0
|
0
|
0
|
|
|
0
|
!$matchrule and $rule and $rule->addcall($name); |
2795
|
|
|
|
|
|
|
} |
2796
|
|
|
|
|
|
|
} |
2797
|
|
|
|
|
|
|
elsif ($grammar =~ m/$BETWEEN/gco) |
2798
|
|
|
|
|
|
|
{ |
2799
|
1
|
|
|
|
|
8
|
_parse("a $1-to-$2 subrule match", $aftererror,$line,"$code$argcode($1..$2)"); |
2800
|
1
|
50
|
|
|
|
4
|
if ($3) |
2801
|
|
|
|
|
|
|
{ |
2802
|
0
|
|
|
|
|
0
|
my $pos = pos $grammar; |
2803
|
0
|
|
|
|
|
0
|
substr($grammar,$pos,0, |
2804
|
|
|
|
|
|
|
"($1..$2) "); |
2805
|
|
|
|
|
|
|
|
2806
|
0
|
|
|
|
|
0
|
pos $grammar = $pos; |
2807
|
|
|
|
|
|
|
} |
2808
|
|
|
|
|
|
|
else |
2809
|
|
|
|
|
|
|
{ |
2810
|
1
|
|
|
|
|
8
|
$item = new Parse::RecDescent::Repetition($name,"$1..$2",$1,$2, |
2811
|
|
|
|
|
|
|
$lookahead,$line, |
2812
|
|
|
|
|
|
|
$self, |
2813
|
|
|
|
|
|
|
$matchrule, |
2814
|
|
|
|
|
|
|
$argcode); |
2815
|
1
|
50
|
33
|
|
|
4
|
$prod and $prod->additem($item) |
2816
|
|
|
|
|
|
|
or _no_rule("repetition",$line,"$code$argcode($1..$2)"); |
2817
|
|
|
|
|
|
|
|
2818
|
1
|
50
|
33
|
|
|
6
|
!$matchrule and $rule and $rule->addcall($name); |
2819
|
|
|
|
|
|
|
} |
2820
|
|
|
|
|
|
|
} |
2821
|
|
|
|
|
|
|
elsif ($grammar =~ m/$ATLEAST/gco) |
2822
|
|
|
|
|
|
|
{ |
2823
|
0
|
|
|
|
|
0
|
_parse("a $1-or-more subrule match", $aftererror,$line,"$code$argcode($1..)"); |
2824
|
0
|
0
|
|
|
|
0
|
if ($2) |
2825
|
|
|
|
|
|
|
{ |
2826
|
0
|
|
|
|
|
0
|
my $pos = pos $grammar; |
2827
|
0
|
|
|
|
|
0
|
substr($grammar,$pos,0, |
2828
|
|
|
|
|
|
|
"($1..) "); |
2829
|
|
|
|
|
|
|
|
2830
|
0
|
|
|
|
|
0
|
pos $grammar = $pos; |
2831
|
|
|
|
|
|
|
} |
2832
|
|
|
|
|
|
|
else |
2833
|
|
|
|
|
|
|
{ |
2834
|
0
|
|
|
|
|
0
|
$item = new Parse::RecDescent::Repetition($name,"$1..",$1,$MAXREP, |
2835
|
|
|
|
|
|
|
$lookahead,$line, |
2836
|
|
|
|
|
|
|
$self, |
2837
|
|
|
|
|
|
|
$matchrule, |
2838
|
|
|
|
|
|
|
$argcode); |
2839
|
0
|
0
|
0
|
|
|
0
|
$prod and $prod->additem($item) |
2840
|
|
|
|
|
|
|
or _no_rule("repetition",$line,"$code$argcode($1..)"); |
2841
|
|
|
|
|
|
|
|
2842
|
0
|
0
|
0
|
|
|
0
|
!$matchrule and $rule and $rule->addcall($name); |
2843
|
0
|
0
|
|
|
|
0
|
_check_insatiable($name,"$1..",$grammar,$line) if $::RD_CHECK; |
2844
|
|
|
|
|
|
|
} |
2845
|
|
|
|
|
|
|
} |
2846
|
|
|
|
|
|
|
elsif ($grammar =~ m/$ATMOST/gco) |
2847
|
|
|
|
|
|
|
{ |
2848
|
0
|
|
|
|
|
0
|
_parse("a one-to-$1 subrule match", $aftererror,$line,"$code$argcode(..$1)"); |
2849
|
0
|
0
|
|
|
|
0
|
if ($2) |
2850
|
|
|
|
|
|
|
{ |
2851
|
0
|
|
|
|
|
0
|
my $pos = pos $grammar; |
2852
|
0
|
|
|
|
|
0
|
substr($grammar,$pos,0, |
2853
|
|
|
|
|
|
|
"(..$1) "); |
2854
|
|
|
|
|
|
|
|
2855
|
0
|
|
|
|
|
0
|
pos $grammar = $pos; |
2856
|
|
|
|
|
|
|
} |
2857
|
|
|
|
|
|
|
else |
2858
|
|
|
|
|
|
|
{ |
2859
|
0
|
|
|
|
|
0
|
$item = new Parse::RecDescent::Repetition($name,"..$1",1,$1, |
2860
|
|
|
|
|
|
|
$lookahead,$line, |
2861
|
|
|
|
|
|
|
$self, |
2862
|
|
|
|
|
|
|
$matchrule, |
2863
|
|
|
|
|
|
|
$argcode); |
2864
|
0
|
0
|
0
|
|
|
0
|
$prod and $prod->additem($item) |
2865
|
|
|
|
|
|
|
or _no_rule("repetition",$line,"$code$argcode(..$1)"); |
2866
|
|
|
|
|
|
|
|
2867
|
0
|
0
|
0
|
|
|
0
|
!$matchrule and $rule and $rule->addcall($name); |
2868
|
|
|
|
|
|
|
} |
2869
|
|
|
|
|
|
|
} |
2870
|
|
|
|
|
|
|
elsif ($grammar =~ m/$BADREP/gco) |
2871
|
|
|
|
|
|
|
{ |
2872
|
0
|
|
|
|
|
0
|
my $current_match = substr($grammar, $-[0], $+[0] - $-[0]); |
2873
|
0
|
|
|
|
|
0
|
_parse("an subrule match with invalid repetition specifier", 0,$line, $current_match); |
2874
|
0
|
|
|
|
|
0
|
_error("Incorrect specification of a repeated subrule", |
2875
|
|
|
|
|
|
|
$line); |
2876
|
0
|
|
|
|
|
0
|
_hint("Repeated subrules like \"$code$argcode$current_match\" cannot have |
2877
|
|
|
|
|
|
|
a maximum repetition of zero, nor can they have |
2878
|
|
|
|
|
|
|
negative components in their ranges."); |
2879
|
|
|
|
|
|
|
} |
2880
|
|
|
|
|
|
|
} |
2881
|
|
|
|
|
|
|
else |
2882
|
|
|
|
|
|
|
{ |
2883
|
1020
|
|
|
|
|
1528
|
_parse("a subrule match", $aftererror,$line,$code); |
2884
|
1020
|
|
|
|
|
948
|
my $desc; |
2885
|
1020
|
50
|
|
|
|
1482
|
if ($name=~/\A_alternation_\d+_of_production_\d+_of_rule/) |
2886
|
0
|
|
|
|
|
0
|
{ $desc = $self->{"rules"}{$name}->expected } |
2887
|
1020
|
|
|
|
|
2013
|
$item = new Parse::RecDescent::Subrule($name, |
2888
|
|
|
|
|
|
|
$lookahead, |
2889
|
|
|
|
|
|
|
$line, |
2890
|
|
|
|
|
|
|
$desc, |
2891
|
|
|
|
|
|
|
$matchrule, |
2892
|
|
|
|
|
|
|
$argcode); |
2893
|
|
|
|
|
|
|
|
2894
|
1020
|
50
|
33
|
|
|
2237
|
$prod and $prod->additem($item) |
2895
|
|
|
|
|
|
|
or _no_rule("(sub)rule",$line,$name); |
2896
|
|
|
|
|
|
|
|
2897
|
1020
|
100
|
66
|
|
|
3665
|
!$matchrule and $rule and $rule->addcall($name); |
2898
|
|
|
|
|
|
|
} |
2899
|
|
|
|
|
|
|
} |
2900
|
|
|
|
|
|
|
elsif ($grammar =~ m/$LONECOLON/gco ) |
2901
|
|
|
|
|
|
|
{ |
2902
|
0
|
|
|
|
|
0
|
_error("Unexpected colon encountered", $line); |
2903
|
0
|
|
|
|
|
0
|
_hint("Did you mean \"|\" (to start a new production)? |
2904
|
|
|
|
|
|
|
Or perhaps you forgot that the colon |
2905
|
|
|
|
|
|
|
in a rule definition must be |
2906
|
|
|
|
|
|
|
on the same line as the rule name?"); |
2907
|
|
|
|
|
|
|
} |
2908
|
|
|
|
|
|
|
elsif ($grammar =~ m/$ACTION/gco ) # BAD ACTION, ALREADY FAILED |
2909
|
|
|
|
|
|
|
{ |
2910
|
0
|
|
|
|
|
0
|
_error("Malformed action encountered", |
2911
|
|
|
|
|
|
|
$line); |
2912
|
0
|
|
|
|
|
0
|
_hint("Did you forget the closing curly bracket |
2913
|
|
|
|
|
|
|
or is there a syntax error in the action?"); |
2914
|
|
|
|
|
|
|
} |
2915
|
|
|
|
|
|
|
elsif ($grammar =~ m/$OTHER/gco ) |
2916
|
|
|
|
|
|
|
{ |
2917
|
0
|
|
|
|
|
0
|
_error("Untranslatable item encountered: \"$1\"", |
2918
|
|
|
|
|
|
|
$line); |
2919
|
0
|
|
|
|
|
0
|
_hint("Did you misspell \"$1\" |
2920
|
|
|
|
|
|
|
or forget to comment it out?"); |
2921
|
|
|
|
|
|
|
} |
2922
|
|
|
|
|
|
|
|
2923
|
4285
|
50
|
|
|
|
6963
|
if ($lookaheadspec =~ tr /././ > 3) |
2924
|
|
|
|
|
|
|
{ |
2925
|
0
|
|
|
|
|
0
|
$lookaheadspec =~ s/\A\s+//; |
2926
|
0
|
0
|
|
|
|
0
|
$lookahead = $lookahead<0 |
2927
|
|
|
|
|
|
|
? 'a negative lookahead ("...!")' |
2928
|
|
|
|
|
|
|
: 'a positive lookahead ("...")' ; |
2929
|
0
|
0
|
|
|
|
0
|
_warn(1,"Found two or more lookahead specifiers in a |
2930
|
|
|
|
|
|
|
row.",$line) |
2931
|
|
|
|
|
|
|
and |
2932
|
|
|
|
|
|
|
_hint("Multiple positive and/or negative lookaheads |
2933
|
|
|
|
|
|
|
are simply multiplied together to produce a |
2934
|
|
|
|
|
|
|
single positive or negative lookahead |
2935
|
|
|
|
|
|
|
specification. In this case the sequence |
2936
|
|
|
|
|
|
|
\"$lookaheadspec\" was reduced to $lookahead. |
2937
|
|
|
|
|
|
|
Was this your intention?"); |
2938
|
|
|
|
|
|
|
} |
2939
|
4285
|
|
|
|
|
3015
|
$lookahead = 0; |
2940
|
4285
|
|
|
|
|
3163
|
$lookaheadspec = ""; |
2941
|
|
|
|
|
|
|
|
2942
|
4285
|
|
|
|
|
11626
|
$grammar =~ m/\G\s+/gc; |
2943
|
|
|
|
|
|
|
} |
2944
|
|
|
|
|
|
|
|
2945
|
66
|
100
|
|
|
|
119
|
if ($must_pop_lines) { |
2946
|
29
|
|
|
|
|
31
|
pop @lines; |
2947
|
|
|
|
|
|
|
} |
2948
|
|
|
|
|
|
|
|
2949
|
66
|
100
|
66
|
|
|
322
|
unless ($ERRORS or $isimplicit or !$::RD_CHECK) |
|
|
|
66
|
|
|
|
|
2950
|
|
|
|
|
|
|
{ |
2951
|
29
|
|
|
|
|
94
|
$self->_check_grammar(); |
2952
|
|
|
|
|
|
|
} |
2953
|
|
|
|
|
|
|
|
2954
|
66
|
100
|
66
|
|
|
309
|
unless ($ERRORS or $isimplicit or $Parse::RecDescent::compiling) |
|
|
|
66
|
|
|
|
|
2955
|
|
|
|
|
|
|
{ |
2956
|
20
|
|
|
|
|
47
|
my $code = $self->_code(); |
2957
|
20
|
50
|
|
|
|
57
|
if (defined $::RD_TRACE) |
2958
|
|
|
|
|
|
|
{ |
2959
|
0
|
0
|
|
|
|
0
|
my $mode = ($nextnamespace eq "namespace000002") ? '>' : '>>'; |
2960
|
0
|
|
|
|
|
0
|
print STDERR "printing code (", length($code),") to RD_TRACE\n"; |
2961
|
0
|
|
|
|
|
0
|
local *TRACE_FILE; |
2962
|
0
|
0
|
0
|
|
|
0
|
open TRACE_FILE, $mode, "RD_TRACE" |
2963
|
|
|
|
|
|
|
and print TRACE_FILE "my \$ERRORS;\n$code" |
2964
|
|
|
|
|
|
|
and close TRACE_FILE; |
2965
|
|
|
|
|
|
|
} |
2966
|
|
|
|
|
|
|
|
2967
|
20
|
50
|
66
|
2
|
|
2245
|
unless ( eval "$code 1" ) |
|
11
|
50
|
100
|
2
|
|
51
|
|
|
7
|
100
|
66
|
2
|
|
6
|
|
|
7
|
100
|
100
|
2
|
|
93
|
|
|
7
|
50
|
66
|
1
|
|
26
|
|
|
7
|
50
|
66
|
1
|
|
9
|
|
|
7
|
50
|
100
|
1
|
|
222
|
|
|
7
|
100
|
66
|
1
|
|
14
|
|
|
7
|
50
|
33
|
1
|
|
8
|
|
|
7
|
100
|
33
|
1
|
|
285
|
|
|
6
|
50
|
33
|
1
|
|
13
|
|
|
7
|
0
|
66
|
1
|
|
6
|
|
|
7
|
50
|
33
|
1
|
|
3215
|
|
|
6
|
0
|
33
|
1
|
|
9
|
|
|
6
|
50
|
33
|
1
|
|
10
|
|
|
6
|
50
|
33
|
1
|
|
738
|
|
|
6
|
50
|
33
|
1
|
|
36
|
|
|
6
|
50
|
33
|
1
|
|
10
|
|
|
6
|
100
|
33
|
1
|
|
726
|
|
|
6
|
50
|
33
|
1
|
|
12
|
|
|
6
|
100
|
33
|
1
|
|
9
|
|
|
2
|
50
|
33
|
1
|
|
710
|
|
|
2
|
100
|
33
|
1
|
|
9
|
|
|
2
|
50
|
33
|
1
|
|
3
|
|
|
1
|
50
|
33
|
1
|
|
840
|
|
|
2
|
50
|
0
|
1
|
|
8
|
|
|
2
|
50
|
0
|
1
|
|
6
|
|
|
2
|
100
|
0
|
1
|
|
1650
|
|
|
2
|
50
|
0
|
1
|
|
9
|
|
|
2
|
50
|
0
|
1
|
|
3
|
|
|
2
|
50
|
0
|
1
|
|
1573
|
|
|
2
|
50
|
33
|
1
|
|
6
|
|
|
2
|
50
|
33
|
1
|
|
5
|
|
|
2
|
50
|
33
|
1
|
|
2871
|
|
|
2
|
100
|
33
|
1
|
|
9
|
|
|
2
|
50
|
33
|
1
|
|
3
|
|
|
2
|
50
|
33
|
1
|
|
2759
|
|
|
2
|
50
|
33
|
1
|
|
6
|
|
|
6
|
50
|
33
|
1
|
|
15
|
|
|
6
|
50
|
33
|
1
|
|
1276
|
|
|
6
|
50
|
33
|
1
|
|
12
|
|
|
6
|
100
|
33
|
1
|
|
11
|
|
|
6
|
50
|
33
|
1
|
|
1016
|
|
|
6
|
50
|
66
|
1
|
|
11
|
|
|
6
|
100
|
33
|
1
|
|
9
|
|
|
6
|
100
|
33
|
1
|
|
1783
|
|
|
6
|
50
|
33
|
1
|
|
12
|
|
|
6
|
50
|
66
|
1
|
|
4
|
|
|
6
|
0
|
33
|
1
|
|
1946
|
|
|
6
|
0
|
33
|
1
|
|
27
|
|
|
6
|
0
|
33
|
1
|
|
31
|
|
|
3
|
50
|
33
|
1
|
|
1600
|
|
|
3
|
50
|
66
|
1
|
|
20
|
|
|
3
|
50
|
33
|
1
|
|
12
|
|
|
3
|
50
|
66
|
1
|
|
1384
|
|
|
5
|
0
|
33
|
1
|
|
18
|
|
|
5
|
50
|
33
|
1
|
|
10
|
|
|
5
|
50
|
33
|
1
|
|
1613
|
|
|
4
|
50
|
33
|
1
|
|
10
|
|
|
4
|
50
|
33
|
1
|
|
5
|
|
|
4
|
50
|
33
|
1
|
|
2441
|
|
|
4
|
50
|
33
|
8
|
|
10
|
|
|
5
|
50
|
33
|
3
|
|
10
|
|
|
3
|
0
|
33
|
1
|
|
1902
|
|
|
3
|
50
|
33
|
1
|
|
9
|
|
|
3
|
50
|
33
|
1
|
|
8
|
|
|
3
|
50
|
33
|
1
|
|
1941
|
|
|
3
|
50
|
33
|
1
|
|
11
|
|
|
3
|
0
|
33
|
1
|
|
5
|
|
|
3
|
50
|
33
|
|
|
2199
|
|
|
3
|
0
|
33
|
|
|
10
|
|
|
3
|
50
|
33
|
|
|
4
|
|
|
3
|
50
|
33
|
|
|
922
|
|
|
3
|
50
|
33
|
|
|
18
|
|
|
3
|
50
|
33
|
|
|
11
|
|
|
2
|
50
|
33
|
|
|
430
|
|
|
2
|
50
|
33
|
|
|
9
|
|
|
1
|
50
|
33
|
|
|
1
|
|
|
1
|
50
|
33
|
|
|
217
|
|
|
2
|
50
|
33
|
|
|
8
|
|
|
3
|
50
|
33
|
|
|
9
|
|
|
2
|
50
|
33
|
|
|
508
|
|
|
2
|
50
|
33
|
|
|
11
|
|
|
3
|
100
|
33
|
|
|
5
|
|
|
3
|
50
|
33
|
|
|
924
|
|
|
3
|
50
|
33
|
|
|
10
|
|
|
6
|
50
|
33
|
|
|
13
|
|
|
1
|
0
|
33
|
|
|
630
|
|
|
1
|
0
|
33
|
|
|
5
|
|
|
2
|
0
|
33
|
|
|
3
|
|
|
6
|
50
|
33
|
|
|
886
|
|
|
3
|
50
|
33
|
|
|
7
|
|
|
3
|
50
|
33
|
|
|
6
|
|
|
7
|
50
|
33
|
|
|
425
|
|
|
7
|
0
|
33
|
|
|
13
|
|
|
7
|
0
|
33
|
|
|
24
|
|
|
7
|
0
|
33
|
|
|
215
|
|
|
3
|
50
|
33
|
|
|
7
|
|
|
3
|
50
|
33
|
|
|
3
|
|
|
5
|
50
|
33
|
|
|
352
|
|
|
7
|
50
|
33
|
|
|
27
|
|
|
3
|
50
|
33
|
|
|
3
|
|
|
3
|
100
|
50
|
|
|
474
|
|
|
3
|
0
|
33
|
|
|
6
|
|
|
3
|
50
|
33
|
|
|
5
|
|
|
3
|
50
|
33
|
|
|
3085
|
|
|
3
|
50
|
33
|
|
|
7
|
|
|
3
|
50
|
33
|
|
|
5
|
|
|
3
|
50
|
33
|
|
|
1461
|
|
|
3
|
50
|
33
|
|
|
7
|
|
|
3
|
50
|
33
|
|
|
3
|
|
|
3
|
50
|
33
|
|
|
624
|
|
|
3
|
100
|
66
|
|
|
5
|
|
|
1
|
50
|
33
|
|
|
1
|
|
|
3
|
50
|
33
|
|
|
684
|
|
|
3
|
50
|
33
|
|
|
10
|
|
|
3
|
100
|
33
|
|
|
3
|
|
|
3
|
50
|
33
|
|
|
911
|
|
|
3
|
50
|
33
|
|
|
8
|
|
|
3
|
0
|
33
|
|
|
6
|
|
|
3
|
50
|
66
|
|
|
1473
|
|
|
3
|
50
|
33
|
|
|
11
|
|
|
3
|
50
|
66
|
|
|
3
|
|
|
3
|
50
|
66
|
|
|
891
|
|
|
3
|
0
|
33
|
|
|
7
|
|
|
3
|
0
|
33
|
|
|
5
|
|
|
3
|
0
|
33
|
|
|
622
|
|
|
3
|
50
|
66
|
|
|
10
|
|
|
3
|
50
|
33
|
|
|
10
|
|
|
3
|
50
|
33
|
|
|
443
|
|
|
3
|
0
|
33
|
|
|
8
|
|
|
3
|
50
|
33
|
|
|
4
|
|
|
3
|
50
|
33
|
|
|
926
|
|
|
3
|
50
|
33
|
|
|
8
|
|
|
3
|
50
|
33
|
|
|
5
|
|
|
3
|
0
|
33
|
|
|
861
|
|
|
3
|
0
|
33
|
|
|
8
|
|
|
3
|
0
|
33
|
|
|
6
|
|
|
3
|
50
|
50
|
|
|
54
|
|
|
3
|
50
|
33
|
|
|
7
|
|
|
3
|
50
|
33
|
|
|
4
|
|
|
3
|
50
|
33
|
|
|
112
|
|
|
3
|
0
|
33
|
|
|
17
|
|
|
3
|
50
|
33
|
|
|
4
|
|
|
3
|
50
|
33
|
|
|
120
|
|
|
3
|
50
|
33
|
|
|
10
|
|
|
3
|
50
|
33
|
|
|
7
|
|
|
3
|
50
|
33
|
|
|
1303
|
|
|
3
|
100
|
33
|
|
|
16
|
|
|
3
|
0
|
33
|
|
|
4
|
|
|
3
|
50
|
50
|
|
|
34
|
|
|
1
|
50
|
33
|
|
|
3
|
|
|
1
|
50
|
33
|
|
|
1
|
|
|
1
|
50
|
33
|
|
|
77
|
|
|
1
|
50
|
33
|
|
|
4
|
|
|
1
|
50
|
33
|
|
|
1
|
|
|
3
|
50
|
33
|
|
|
99
|
|
|
3
|
50
|
33
|
|
|
11
|
|
|
3
|
50
|
33
|
|
|
6
|
|
|
3
|
0
|
33
|
|
|
1735
|
|
|
3
|
0
|
33
|
|
|
10
|
|
|
3
|
0
|
33
|
|
|
8
|
|
|
3
|
50
|
33
|
|
|
37
|
|
|
3
|
50
|
33
|
|
|
8
|
|
|
3
|
50
|
33
|
|
|
7
|
|
|
1
|
50
|
33
|
|
|
99
|
|
|
1
|
0
|
33
|
|
|
3
|
|
|
1
|
50
|
33
|
|
|
1
|
|
|
3
|
50
|
33
|
|
|
121
|
|
|
1
|
50
|
33
|
|
|
4
|
|
|
1
|
50
|
33
|
|
|
1
|
|
|
3
|
0
|
33
|
|
|
958
|
|
|
3
|
50
|
66
|
|
|
7
|
|
|
3
|
0
|
33
|
|
|
6
|
|
|
3
|
50
|
33
|
|
|
29
|
|
|
1
|
50
|
33
|
|
|
2
|
|
|
1
|
50
|
33
|
|
|
2
|
|
|
3
|
50
|
33
|
|
|
76
|
|
|
3
|
50
|
33
|
|
|
18
|
|
|
3
|
50
|
33
|
|
|
2
|
|
|
3
|
50
|
33
|
|
|
97
|
|
|
3
|
50
|
33
|
|
|
8
|
|
|
3
|
50
|
66
|
|
|
6
|
|
|
3
|
0
|
33
|
|
|
893
|
|
|
8
|
0
|
66
|
|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
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
|
3
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
40
|
|
|
1
|
|
|
|
|
4
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
2968
|
|
|
|
|
|
|
{ |
2969
|
0
|
|
|
|
|
0
|
_error("Internal error in generated parser code!"); |
2970
|
0
|
|
|
|
|
0
|
$@ =~ s/at grammar/in grammar at/; |
2971
|
0
|
|
|
|
|
0
|
_hint($@); |
2972
|
|
|
|
|
|
|
} |
2973
|
|
|
|
|
|
|
} |
2974
|
|
|
|
|
|
|
|
2975
|
66
|
50
|
33
|
|
|
180
|
if ($ERRORS and !_verbosity("HINT")) |
2976
|
|
|
|
|
|
|
{ |
2977
|
0
|
0
|
|
|
|
0
|
local $::RD_HINT = defined $::RD_HINT ? $::RD_HINT : 1; |
2978
|
0
|
|
|
|
|
0
|
_hint('Set $::RD_HINT (or -RD_HINT if you\'re using "perl -s") |
2979
|
|
|
|
|
|
|
for hints on fixing these problems. Use $::RD_HINT = 0 |
2980
|
|
|
|
|
|
|
to disable this message.'); |
2981
|
|
|
|
|
|
|
} |
2982
|
66
|
50
|
|
|
|
119
|
if ($ERRORS) { $ERRORS=0; return } |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
2983
|
66
|
|
|
|
|
358
|
return $self; |
2984
|
|
|
|
|
|
|
} |
2985
|
|
|
|
|
|
|
|
2986
|
|
|
|
|
|
|
|
2987
|
|
|
|
|
|
|
sub _addstartcode($$) |
2988
|
|
|
|
|
|
|
{ |
2989
|
2
|
|
|
3
|
|
5
|
my ($self, $code) = @_; |
2990
|
2
|
|
|
|
|
7
|
$code =~ s/\A\s*\{(.*)\}\Z/$1/s; |
2991
|
|
|
|
|
|
|
|
2992
|
2
|
|
|
|
|
31
|
$self->{"startcode"} .= "$code;\n"; |
2993
|
|
|
|
|
|
|
} |
2994
|
|
|
|
|
|
|
|
2995
|
|
|
|
|
|
|
# CHECK FOR GRAMMAR PROBLEMS.... |
2996
|
|
|
|
|
|
|
|
2997
|
|
|
|
|
|
|
sub _check_insatiable($$$$) |
2998
|
|
|
|
|
|
|
{ |
2999
|
83
|
|
|
89
|
|
185
|
my ($subrule,$repspec,$grammar,$line) = @_; |
3000
|
83
|
|
|
|
|
162
|
pos($grammar)=pos($_[2]); |
3001
|
86
|
50
|
66
|
|
|
696
|
return if $grammar =~ m/$OPTIONAL/gco || $grammar =~ m/$ANY/gco; |
3002
|
86
|
|
|
|
|
105
|
my $min = 1; |
3003
|
84
|
100
|
66
|
|
|
2065
|
if ( $grammar =~ m/$MANY/gco |
|
|
|
66
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
66
|
|
|
|
|
3004
|
|
|
|
|
|
|
|| $grammar =~ m/$EXACTLY/gco |
3005
|
|
|
|
|
|
|
|| $grammar =~ m/$ATMOST/gco |
3006
|
7
|
|
|
|
|
100
|
|| $grammar =~ m/$BETWEEN/gco && do { $min=$2; 1 } |
|
3
|
|
|
|
|
7
|
|
3007
|
2
|
|
|
|
|
2
|
|| $grammar =~ m/$ATLEAST/gco && do { $min=$2; 1 } |
|
3
|
|
|
|
|
317
|
|
3008
|
|
|
|
|
|
|
|| $grammar =~ m/$SUBRULE(?!\s*:)/gco |
3009
|
|
|
|
|
|
|
) |
3010
|
|
|
|
|
|
|
{ |
3011
|
60
|
50
|
66
|
|
|
254
|
return unless $1 eq $subrule && $min > 0; |
3012
|
2
|
|
|
|
|
2
|
my $current_match = substr($grammar, $-[0], $+[0] - $-[0]); |
3013
|
2
|
50
|
|
|
|
333
|
_warn(3,"Subrule sequence \"$subrule($repspec) $current_match\" will |
3014
|
|
|
|
|
|
|
(almost certainly) fail.",$line) |
3015
|
|
|
|
|
|
|
and |
3016
|
|
|
|
|
|
|
_hint("Unless subrule \"$subrule\" performs some cunning |
3017
|
|
|
|
|
|
|
lookahead, the repetition \"$subrule($repspec)\" will |
3018
|
|
|
|
|
|
|
insatiably consume as many matches of \"$subrule\" as it |
3019
|
|
|
|
|
|
|
can, leaving none to match the \"$current_match\" that follows."); |
3020
|
|
|
|
|
|
|
} |
3021
|
|
|
|
|
|
|
} |
3022
|
|
|
|
|
|
|
|
3023
|
|
|
|
|
|
|
sub _check_grammar ($) |
3024
|
|
|
|
|
|
|
{ |
3025
|
32
|
|
|
35
|
|
45
|
my $self = shift; |
3026
|
35
|
|
|
|
|
51
|
my $rules = $self->{"rules"}; |
3027
|
31
|
|
|
|
|
340
|
my $rule; |
3028
|
30
|
|
|
|
|
151
|
foreach $rule ( values %$rules ) |
3029
|
|
|
|
|
|
|
{ |
3030
|
739
|
100
|
|
|
|
1159
|
next if ! $rule->{"changed"}; |
3031
|
|
|
|
|
|
|
|
3032
|
|
|
|
|
|
|
# CHECK FOR UNDEFINED RULES |
3033
|
|
|
|
|
|
|
|
3034
|
662
|
|
|
|
|
877
|
my $call; |
3035
|
662
|
|
|
|
|
419
|
foreach $call ( @{$rule->{"calls"}} ) |
|
662
|
|
|
|
|
778
|
|
3036
|
|
|
|
|
|
|
{ |
3037
|
1036
|
100
|
66
|
|
|
1353
|
if (!defined ${$rules}{$call} |
|
1040
|
|
|
|
|
1791
|
|
3038
|
5
|
|
|
|
|
48
|
&&!defined &{"Parse::RecDescent::$call"}) |
3039
|
|
|
|
|
|
|
{ |
3040
|
5
|
50
|
|
|
|
449
|
if (!defined $::RD_AUTOSTUB) |
3041
|
|
|
|
|
|
|
{ |
3042
|
2
|
100
|
|
|
|
6
|
_warn(3,"Undefined (sub)rule \"$call\" |
3043
|
|
|
|
|
|
|
used in a production.") |
3044
|
|
|
|
|
|
|
and |
3045
|
|
|
|
|
|
|
_hint("Will you be providing this rule |
3046
|
|
|
|
|
|
|
later, or did you perhaps |
3047
|
|
|
|
|
|
|
misspell \"$call\"? Otherwise |
3048
|
|
|
|
|
|
|
it will be treated as an |
3049
|
|
|
|
|
|
|
immediate ."); |
3050
|
5
|
|
|
|
|
8
|
eval "sub $self->{namespace}::$call {undef}"; |
3051
|
|
|
|
|
|
|
} |
3052
|
|
|
|
|
|
|
else # EXPERIMENTAL |
3053
|
|
|
|
|
|
|
{ |
3054
|
5
|
|
|
|
|
638
|
my $rule = qq{'$call'}; |
3055
|
1
|
50
|
33
|
|
|
4
|
if ($::RD_AUTOSTUB and $::RD_AUTOSTUB ne "1") { |
3056
|
1
|
|
|
|
|
2
|
$rule = $::RD_AUTOSTUB; |
3057
|
|
|
|
|
|
|
} |
3058
|
1
|
50
|
|
|
|
761
|
_warn(1,"Autogenerating rule: $call") |
3059
|
|
|
|
|
|
|
and |
3060
|
|
|
|
|
|
|
_hint("A call was made to a subrule |
3061
|
|
|
|
|
|
|
named \"$call\", but no such |
3062
|
|
|
|
|
|
|
rule was specified. However, |
3063
|
|
|
|
|
|
|
since \$::RD_AUTOSTUB |
3064
|
|
|
|
|
|
|
was defined, a rule stub |
3065
|
|
|
|
|
|
|
($call : $rule) was |
3066
|
|
|
|
|
|
|
automatically created."); |
3067
|
|
|
|
|
|
|
|
3068
|
1
|
|
|
|
|
4
|
$self->_generate("$call: $rule",0,1); |
3069
|
|
|
|
|
|
|
} |
3070
|
|
|
|
|
|
|
} |
3071
|
|
|
|
|
|
|
} |
3072
|
|
|
|
|
|
|
|
3073
|
|
|
|
|
|
|
# CHECK FOR LEFT RECURSION |
3074
|
|
|
|
|
|
|
|
3075
|
662
|
50
|
|
|
|
713
|
if ($rule->isleftrec($rules)) |
3076
|
|
|
|
|
|
|
{ |
3077
|
7
|
|
|
|
|
433
|
_error("Rule \"$rule->{name}\" is left-recursive."); |
3078
|
7
|
|
|
|
|
14
|
_hint("Redesign the grammar so it's not left-recursive. |
3079
|
|
|
|
|
|
|
That will probably mean you need to re-implement |
3080
|
|
|
|
|
|
|
repetitions using the '(s)' notation. |
3081
|
|
|
|
|
|
|
For example: \"$rule->{name}(s)\"."); |
3082
|
7
|
|
|
|
|
7
|
next; |
3083
|
|
|
|
|
|
|
} |
3084
|
|
|
|
|
|
|
|
3085
|
|
|
|
|
|
|
# CHECK FOR PRODUCTIONS FOLLOWING EMPTY PRODUCTIONS |
3086
|
|
|
|
|
|
|
{ |
3087
|
668
|
|
|
|
|
718
|
my $hasempty; |
|
668
|
|
|
|
|
441
|
|
3088
|
|
|
|
|
|
|
my $prod; |
3089
|
668
|
|
|
|
|
467
|
foreach $prod ( @{$rule->{"prods"}} ) { |
|
668
|
|
|
|
|
1232
|
|
3090
|
1264
|
50
|
|
|
|
1349
|
if ($hasempty) { |
3091
|
1
|
|
|
|
|
1
|
_error("Production " . $prod->describe . " for \"$rule->{name}\" |
3092
|
|
|
|
|
|
|
will never be reached (preceding empty production will |
3093
|
|
|
|
|
|
|
always match first)."); |
3094
|
7
|
|
|
|
|
776
|
_hint("Reorder the grammar so that the empty production |
3095
|
|
|
|
|
|
|
is last in the list or productions."); |
3096
|
7
|
|
|
|
|
8
|
last; |
3097
|
|
|
|
|
|
|
} |
3098
|
1264
|
|
66
|
|
|
1880
|
$hasempty ||= $prod->isempty(); |
3099
|
|
|
|
|
|
|
} |
3100
|
|
|
|
|
|
|
} |
3101
|
|
|
|
|
|
|
} |
3102
|
|
|
|
|
|
|
} |
3103
|
|
|
|
|
|
|
|
3104
|
|
|
|
|
|
|
# GENERATE ACTUAL PARSER CODE |
3105
|
|
|
|
|
|
|
|
3106
|
|
|
|
|
|
|
sub _code($) |
3107
|
|
|
|
|
|
|
{ |
3108
|
36
|
|
|
31
|
|
498
|
my $self = shift; |
3109
|
|
|
|
|
|
|
my $initial_skip = defined($self->{skip}) ? |
3110
|
36
|
100
|
|
|
|
187
|
'$skip = ' . $self->{skip} . ';' : |
3111
|
|
|
|
|
|
|
$self->_dump([$skip],[qw(skip)]); |
3112
|
|
|
|
|
|
|
|
3113
|
36
|
|
|
|
|
1547
|
my $code = qq! |
3114
|
|
|
|
|
|
|
package $self->{namespace}; |
3115
|
|
|
|
|
|
|
use strict; |
3116
|
|
|
|
|
|
|
use vars qw(\$skip \$AUTOLOAD $self->{localvars} ); |
3117
|
|
|
|
|
|
|
\@$self->{namespace}\::ISA = (); |
3118
|
|
|
|
|
|
|
$initial_skip |
3119
|
|
|
|
|
|
|
$self->{startcode} |
3120
|
|
|
|
|
|
|
|
3121
|
|
|
|
|
|
|
{ |
3122
|
|
|
|
|
|
|
local \$SIG{__WARN__} = sub {0}; |
3123
|
|
|
|
|
|
|
# PRETEND TO BE IN Parse::RecDescent NAMESPACE |
3124
|
|
|
|
|
|
|
*$self->{namespace}::AUTOLOAD = sub |
3125
|
|
|
|
|
|
|
{ |
3126
|
|
|
|
|
|
|
no strict 'refs'; |
3127
|
|
|
|
|
|
|
! |
3128
|
|
|
|
|
|
|
# This generated code uses ${"AUTOLOAD"} rather than $AUTOLOAD in |
3129
|
|
|
|
|
|
|
# order to avoid the circular reference documented here: |
3130
|
|
|
|
|
|
|
# https://rt.perl.org/rt3/Public/Bug/Display.html?id=110248 |
3131
|
|
|
|
|
|
|
# As a result of the investigation of |
3132
|
|
|
|
|
|
|
# https://rt.cpan.org/Ticket/Display.html?id=53710 |
3133
|
|
|
|
|
|
|
. qq! |
3134
|
|
|
|
|
|
|
\${"AUTOLOAD"} =~ s/^$self->{namespace}/Parse::RecDescent/; |
3135
|
|
|
|
|
|
|
goto &{\${"AUTOLOAD"}}; |
3136
|
|
|
|
|
|
|
} |
3137
|
|
|
|
|
|
|
} |
3138
|
|
|
|
|
|
|
|
3139
|
|
|
|
|
|
|
!; |
3140
|
36
|
|
|
|
|
381
|
$code .= "push \@$self->{namespace}\::ISA, 'Parse::RecDescent';"; |
3141
|
36
|
|
|
|
|
49
|
$self->{"startcode"} = ''; |
3142
|
|
|
|
|
|
|
|
3143
|
36
|
|
|
|
|
36
|
my $rule; |
3144
|
|
|
|
|
|
|
# sort the rules to ensure the output is reproducible |
3145
|
36
|
|
|
|
|
635
|
foreach $rule ( sort { $a->{name} cmp $b->{name} } |
|
3351
|
|
|
|
|
2536
|
|
3146
|
35
|
|
|
|
|
196
|
values %{$self->{"rules"}} ) |
3147
|
|
|
|
|
|
|
{ |
3148
|
744
|
100
|
|
|
|
1392
|
if ($rule->{"changed"}) |
3149
|
|
|
|
|
|
|
{ |
3150
|
661
|
|
|
|
|
1131
|
$code .= $rule->code($self->{"namespace"},$self); |
3151
|
667
|
|
|
|
|
1003
|
$rule->{"changed"} = 0; |
3152
|
|
|
|
|
|
|
} |
3153
|
|
|
|
|
|
|
} |
3154
|
|
|
|
|
|
|
|
3155
|
35
|
|
|
|
|
2378
|
return $code; |
3156
|
|
|
|
|
|
|
} |
3157
|
|
|
|
|
|
|
|
3158
|
|
|
|
|
|
|
# A wrapper for Data::Dumper->Dump, which localizes some variables to |
3159
|
|
|
|
|
|
|
# keep the output in a form suitable for Parse::RecDescent. |
3160
|
|
|
|
|
|
|
# |
3161
|
|
|
|
|
|
|
# List of variables and their defaults taken from |
3162
|
|
|
|
|
|
|
# $Data::Dumper::VERSION == 2.158 |
3163
|
|
|
|
|
|
|
|
3164
|
|
|
|
|
|
|
sub _dump { |
3165
|
43
|
|
|
40
|
|
5671
|
require Data::Dumper; |
3166
|
|
|
|
|
|
|
|
3167
|
|
|
|
|
|
|
# |
3168
|
|
|
|
|
|
|
# Allow the user's settings to persist for some features in case |
3169
|
|
|
|
|
|
|
# RD_TRACE is set. These shouldn't affect the eval()-ability of |
3170
|
|
|
|
|
|
|
# the resulting parser. |
3171
|
|
|
|
|
|
|
# |
3172
|
|
|
|
|
|
|
|
3173
|
|
|
|
|
|
|
#local $Data::Dumper::Indent = 2; |
3174
|
|
|
|
|
|
|
#local $Data::Dumper::Useqq = 0; |
3175
|
|
|
|
|
|
|
#local $Data::Dumper::Quotekeys = 1; |
3176
|
|
|
|
|
|
|
#local $Data::Dumper::Useperl = 0; |
3177
|
|
|
|
|
|
|
|
3178
|
|
|
|
|
|
|
# |
3179
|
|
|
|
|
|
|
# These may affect whether the output is valid perl code for |
3180
|
|
|
|
|
|
|
# eval(), and must be controlled. Set them to their default |
3181
|
|
|
|
|
|
|
# values. |
3182
|
|
|
|
|
|
|
# |
3183
|
|
|
|
|
|
|
|
3184
|
43
|
|
|
|
|
41411
|
local $Data::Dumper::Purity = 0; |
3185
|
43
|
|
|
|
|
62
|
local $Data::Dumper::Pad = ""; |
3186
|
43
|
|
|
|
|
65
|
local $Data::Dumper::Varname = "VAR"; |
3187
|
43
|
|
|
|
|
50
|
local $Data::Dumper::Terse = 0; |
3188
|
43
|
|
|
|
|
61
|
local $Data::Dumper::Freezer = ""; |
3189
|
43
|
|
|
|
|
61
|
local $Data::Dumper::Toaster = ""; |
3190
|
43
|
|
|
|
|
47
|
local $Data::Dumper::Deepcopy = 0; |
3191
|
43
|
|
|
|
|
56
|
local $Data::Dumper::Bless = "bless"; |
3192
|
43
|
|
|
|
|
68
|
local $Data::Dumper::Maxdepth = 0; |
3193
|
43
|
|
|
|
|
63
|
local $Data::Dumper::Pair = ' => '; |
3194
|
43
|
|
|
|
|
56
|
local $Data::Dumper::Deparse = 0; |
3195
|
43
|
|
|
|
|
53
|
local $Data::Dumper::Sparseseen = 0; |
3196
|
|
|
|
|
|
|
|
3197
|
|
|
|
|
|
|
# |
3198
|
|
|
|
|
|
|
# Modify the below options from their defaults. |
3199
|
|
|
|
|
|
|
# |
3200
|
|
|
|
|
|
|
|
3201
|
|
|
|
|
|
|
# Sort the keys to ensure the output is reproducible |
3202
|
43
|
|
|
|
|
58
|
local $Data::Dumper::Sortkeys = 1; |
3203
|
|
|
|
|
|
|
|
3204
|
|
|
|
|
|
|
# Don't stop recursing |
3205
|
43
|
|
|
|
|
54
|
local $Data::Dumper::Maxrecurse = 0; |
3206
|
|
|
|
|
|
|
|
3207
|
43
|
|
|
|
|
297
|
return Data::Dumper->Dump(@_[1..$#_]); |
3208
|
|
|
|
|
|
|
} |
3209
|
|
|
|
|
|
|
|
3210
|
|
|
|
|
|
|
# EXECUTING A PARSE.... |
3211
|
|
|
|
|
|
|
|
3212
|
|
|
|
|
|
|
sub AUTOLOAD # ($parser, $text; $linenum, @args) |
3213
|
|
|
|
|
|
|
{ |
3214
|
54
|
100
|
|
51
|
|
6853
|
croak "Could not find method: $AUTOLOAD\n" unless ref $_[0]; |
3215
|
54
|
|
33
|
|
|
118
|
my $class = ref($_[0]) || $_[0]; |
3216
|
54
|
50
|
|
|
|
132
|
my $text = ref($_[1]) eq 'SCALAR' ? ${$_[1]} : "$_[1]"; |
|
6
|
|
|
|
|
6
|
|
3217
|
54
|
|
|
|
|
94
|
$_[0]->{lastlinenum} = _linecount($text); |
3218
|
54
|
100
|
33
|
|
|
130
|
$_[0]->{lastlinenum} += ($_[2]||0) if @_ > 2; |
3219
|
54
|
|
|
|
|
73
|
$_[0]->{offsetlinenum} = $_[0]->{lastlinenum}; |
3220
|
54
|
|
|
|
|
64
|
$_[0]->{fulltext} = $text; |
3221
|
54
|
|
|
|
|
78
|
$_[0]->{fulltextlen} = length $text; |
3222
|
54
|
|
|
|
|
97
|
$_[0]->{linecounter_cache} = {}; |
3223
|
54
|
|
|
|
|
129
|
$_[0]->{deferred} = []; |
3224
|
54
|
|
|
|
|
65
|
$_[0]->{errors} = []; |
3225
|
54
|
|
|
|
|
133
|
my @args = @_[3..$#_]; |
3226
|
54
|
|
|
53
|
|
160
|
my $args = sub { [ @args ] }; |
|
54
|
|
|
|
|
890
|
|
3227
|
|
|
|
|
|
|
|
3228
|
50
|
|
|
|
|
347
|
$AUTOLOAD =~ s/$class/$_[0]->{namespace}/; |
3229
|
13
|
|
|
13
|
|
154
|
no strict "refs"; |
|
13
|
|
|
|
|
21
|
|
|
13
|
|
|
|
|
19467
|
|
3230
|
|
|
|
|
|
|
|
3231
|
50
|
|
66
|
|
|
106
|
local $::RD_WARN = $::RD_WARN || $_[0]->{__WARN__}; |
3232
|
50
|
|
33
|
|
|
123
|
local $::RD_HINT = $::RD_HINT || $_[0]->{__HINT__}; |
3233
|
50
|
|
66
|
|
|
108
|
local $::RD_TRACE = $::RD_TRACE || $_[0]->{__TRACE__}; |
3234
|
|
|
|
|
|
|
|
3235
|
50
|
100
|
|
|
|
159
|
croak "Unknown starting rule ($AUTOLOAD) called\n" |
3236
|
|
|
|
|
|
|
unless defined &$AUTOLOAD; |
3237
|
52
|
|
|
|
|
97
|
my $retval = &{$AUTOLOAD}( |
|
52
|
|
|
|
|
1139
|
|
3238
|
|
|
|
|
|
|
$_[0], # $parser |
3239
|
|
|
|
|
|
|
$text, # $text |
3240
|
|
|
|
|
|
|
undef, # $repeating |
3241
|
|
|
|
|
|
|
undef, # $_noactions |
3242
|
|
|
|
|
|
|
$args, # \@args |
3243
|
|
|
|
|
|
|
undef, # $_itempos |
3244
|
|
|
|
|
|
|
); |
3245
|
|
|
|
|
|
|
|
3246
|
|
|
|
|
|
|
|
3247
|
52
|
100
|
|
|
|
121
|
if (defined $retval) |
3248
|
|
|
|
|
|
|
{ |
3249
|
51
|
|
|
|
|
49
|
foreach ( @{$_[0]->{deferred}} ) { &$_; } |
|
51
|
|
|
|
|
118
|
|
|
4
|
|
|
|
|
8
|
|
3250
|
|
|
|
|
|
|
} |
3251
|
|
|
|
|
|
|
else |
3252
|
|
|
|
|
|
|
{ |
3253
|
5
|
|
|
|
|
10
|
foreach ( @{$_[0]->{errors}} ) { _error(@$_); } |
|
5
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
9
|
|
3254
|
|
|
|
|
|
|
} |
3255
|
|
|
|
|
|
|
|
3256
|
52
|
50
|
|
|
|
132
|
if (ref $_[1] eq 'SCALAR') { ${$_[1]} = $text } |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
5
|
|
3257
|
|
|
|
|
|
|
|
3258
|
52
|
|
|
|
|
56
|
$ERRORS = 0; |
3259
|
54
|
|
|
|
|
252
|
return $retval; |
3260
|
|
|
|
|
|
|
} |
3261
|
|
|
|
|
|
|
|
3262
|
|
|
|
|
|
|
sub _parserepeat($$$$$$$$$) # RETURNS A REF TO AN ARRAY OF MATCHES |
3263
|
|
|
|
|
|
|
{ |
3264
|
21
|
|
|
25
|
|
38
|
my ($parser, $text, $prod, $min, $max, $_noactions, $expectation, $argcode, $_itempos) = @_; |
3265
|
21
|
|
|
|
|
31
|
my @tokens = (); |
3266
|
|
|
|
|
|
|
|
3267
|
21
|
|
|
|
|
28
|
my $itemposfirst; |
3268
|
|
|
|
|
|
|
my $reps; |
3269
|
23
|
|
|
|
|
71
|
for ($reps=0; $reps<$max;) |
3270
|
|
|
|
|
|
|
{ |
3271
|
115
|
|
|
|
|
163
|
$expectation->at($text); |
3272
|
115
|
|
|
|
|
88
|
my $_savetext = $text; |
3273
|
119
|
|
|
|
|
93
|
my $prevtextlen = length $text; |
3274
|
119
|
|
|
|
|
97
|
my $_tok; |
3275
|
119
|
100
|
|
|
|
2085
|
if (! defined ($_tok = &$prod($parser,$text,1,$_noactions,$argcode,$_itempos))) |
3276
|
|
|
|
|
|
|
{ |
3277
|
21
|
|
|
|
|
29
|
$text = $_savetext; |
3278
|
17
|
|
|
|
|
19
|
last; |
3279
|
|
|
|
|
|
|
} |
3280
|
|
|
|
|
|
|
|
3281
|
98
|
100
|
100
|
|
|
192
|
if (defined($_itempos) and !defined($itemposfirst)) |
3282
|
|
|
|
|
|
|
{ |
3283
|
7
|
|
|
|
|
10
|
$itemposfirst = Parse::RecDescent::Production::_duplicate_itempos($_itempos); |
3284
|
|
|
|
|
|
|
} |
3285
|
|
|
|
|
|
|
|
3286
|
102
|
100
|
|
|
|
216
|
push @tokens, $_tok if defined $_tok; |
3287
|
103
|
100
|
100
|
|
|
398
|
last if ++$reps >= $min and $prevtextlen == length $text; |
3288
|
|
|
|
|
|
|
} |
3289
|
|
|
|
|
|
|
|
3290
|
24
|
100
|
|
|
|
54
|
do { $expectation->failed(); return undef} if $reps<$min; |
|
6
|
|
|
|
|
6
|
|
|
6
|
|
|
|
|
29
|
|
3291
|
|
|
|
|
|
|
|
3292
|
23
|
100
|
|
|
|
43
|
if (defined $itemposfirst) |
3293
|
|
|
|
|
|
|
{ |
3294
|
8
|
|
|
|
|
12
|
Parse::RecDescent::Production::_update_itempos($_itempos, $itemposfirst, undef, [qw(from)]); |
3295
|
|
|
|
|
|
|
} |
3296
|
|
|
|
|
|
|
|
3297
|
23
|
|
|
|
|
28
|
$_[1] = $text; |
3298
|
23
|
|
|
|
|
363
|
return [@tokens]; |
3299
|
|
|
|
|
|
|
} |
3300
|
|
|
|
|
|
|
|
3301
|
|
|
|
|
|
|
sub set_autoflush { |
3302
|
0
|
|
|
1
|
0
|
0
|
my $orig_selected = select $_[0]; |
3303
|
5
|
|
|
|
|
4
|
$| = 1; |
3304
|
5
|
|
|
|
|
5
|
select $orig_selected; |
3305
|
5
|
|
|
|
|
6
|
return; |
3306
|
|
|
|
|
|
|
} |
3307
|
|
|
|
|
|
|
|
3308
|
|
|
|
|
|
|
# ERROR REPORTING.... |
3309
|
|
|
|
|
|
|
|
3310
|
|
|
|
|
|
|
sub _write_ERROR { |
3311
|
5
|
|
|
1
|
|
3
|
my ($errorprefix, $errortext) = @_; |
3312
|
5
|
50
|
|
|
|
7
|
return if $errortext !~ /\S/; |
3313
|
5
|
|
|
|
|
6
|
$errorprefix =~ s/\s+\Z//; |
3314
|
5
|
|
|
|
|
4
|
local $^A = q{}; |
3315
|
|
|
|
|
|
|
|
3316
|
5
|
|
|
|
|
7
|
formline(<<'END_FORMAT', $errorprefix, $errortext); |
3317
|
|
|
|
|
|
|
@>>>>>>>>>>>>>>>>>>>>: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
3318
|
|
|
|
|
|
|
END_FORMAT |
3319
|
5
|
|
|
|
|
5
|
formline(<<'END_FORMAT', $errortext); |
3320
|
|
|
|
|
|
|
~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
3321
|
|
|
|
|
|
|
END_FORMAT |
3322
|
5
|
|
|
|
|
6
|
print {*STDERR} $^A; |
|
5
|
|
|
|
|
6
|
|
3323
|
|
|
|
|
|
|
} |
3324
|
|
|
|
|
|
|
|
3325
|
|
|
|
|
|
|
# TRACING |
3326
|
|
|
|
|
|
|
|
3327
|
|
|
|
|
|
|
my $TRACE_FORMAT = <<'END_FORMAT'; |
3328
|
|
|
|
|
|
|
@>|@|||||||||@^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<| |
3329
|
|
|
|
|
|
|
| ~~ |^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<| |
3330
|
|
|
|
|
|
|
END_FORMAT |
3331
|
|
|
|
|
|
|
|
3332
|
|
|
|
|
|
|
my $TRACECONTEXT_FORMAT = <<'END_FORMAT'; |
3333
|
|
|
|
|
|
|
@>|@|||||||||@ |^<<<<<<<<<<<<<<<<<<<<<<<<<<< |
3334
|
|
|
|
|
|
|
| ~~ | |^<<<<<<<<<<<<<<<<<<<<<<<<<<< |
3335
|
|
|
|
|
|
|
END_FORMAT |
3336
|
|
|
|
|
|
|
|
3337
|
|
|
|
|
|
|
sub _write_TRACE { |
3338
|
5
|
|
|
0
|
|
9
|
my ($tracelevel, $tracerulename, $tracemsg) = @_; |
3339
|
5
|
50
|
|
|
|
3
|
return if $tracemsg !~ /\S/; |
3340
|
0
|
|
|
|
|
0
|
$tracemsg =~ s/\s*\Z//; |
3341
|
5
|
|
|
|
|
12
|
local $^A = q{}; |
3342
|
5
|
|
|
|
|
10
|
my $bar = '|'; |
3343
|
5
|
|
|
|
|
4
|
formline($TRACE_FORMAT, $tracelevel, $tracerulename, $bar, $tracemsg, $tracemsg); |
3344
|
5
|
|
|
|
|
14
|
print {*STDERR} $^A; |
|
5
|
|
|
|
|
4
|
|
3345
|
|
|
|
|
|
|
} |
3346
|
|
|
|
|
|
|
|
3347
|
|
|
|
|
|
|
sub _write_TRACECONTEXT { |
3348
|
5
|
|
|
2
|
|
10
|
my ($tracelevel, $tracerulename, $tracecontext) = @_; |
3349
|
5
|
50
|
|
|
|
2
|
return if $tracecontext !~ /\S/; |
3350
|
5
|
|
|
|
|
14
|
$tracecontext =~ s/\s*\Z//; |
3351
|
5
|
|
|
|
|
5
|
local $^A = q{}; |
3352
|
5
|
|
|
|
|
11
|
my $bar = '|'; |
3353
|
5
|
|
|
|
|
5
|
formline($TRACECONTEXT_FORMAT, $tracelevel, $tracerulename, $bar, $tracecontext, $tracecontext); |
3354
|
5
|
|
|
|
|
10
|
print {*STDERR} $^A; |
|
5
|
|
|
|
|
5
|
|
3355
|
|
|
|
|
|
|
} |
3356
|
|
|
|
|
|
|
|
3357
|
|
|
|
|
|
|
sub _verbosity($) |
3358
|
|
|
|
|
|
|
{ |
3359
|
4239
|
100
|
33
|
4239
|
|
46044
|
defined $::RD_TRACE |
|
|
|
33
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
66
|
|
|
|
|
3360
|
|
|
|
|
|
|
or defined $::RD_HINT and $::RD_HINT and $_[0] =~ /ERRORS|WARN|HINT/ |
3361
|
|
|
|
|
|
|
or defined $::RD_WARN and $::RD_WARN and $_[0] =~ /ERRORS|WARN/ |
3362
|
|
|
|
|
|
|
or defined $::RD_ERRORS and $::RD_ERRORS and $_[0] =~ /ERRORS/ |
3363
|
|
|
|
|
|
|
} |
3364
|
|
|
|
|
|
|
|
3365
|
|
|
|
|
|
|
sub _error($;$) |
3366
|
|
|
|
|
|
|
{ |
3367
|
5
|
|
|
2
|
|
17
|
$ERRORS++; |
3368
|
5
|
50
|
|
|
|
9
|
return 0 if ! _verbosity("ERRORS"); |
3369
|
5
|
|
|
|
|
7
|
my $errortext = $_[0]; |
3370
|
5
|
50
|
|
|
|
3
|
my $errorprefix = "ERROR" . ($_[1] ? " (line $_[1])" : ""); |
3371
|
5
|
|
|
|
|
4
|
$errortext =~ s/\s+/ /g; |
3372
|
5
|
100
|
|
|
|
6
|
print {*STDERR} "\n" if _verbosity("WARN"); |
|
5
|
|
|
|
|
10
|
|
3373
|
5
|
|
|
|
|
8
|
_write_ERROR($errorprefix, $errortext); |
3374
|
5
|
|
|
|
|
6
|
return 1; |
3375
|
|
|
|
|
|
|
} |
3376
|
|
|
|
|
|
|
|
3377
|
|
|
|
|
|
|
sub _warn($$;$) |
3378
|
|
|
|
|
|
|
{ |
3379
|
32
|
100
|
66
|
30
|
|
43
|
return 0 unless _verbosity("WARN") && ($::RD_HINT || $_[0] >= ($::RD_WARN||1)); |
|
|
|
66
|
|
|
|
|
3380
|
5
|
|
|
|
|
9
|
my $errortext = $_[1]; |
3381
|
5
|
50
|
|
|
|
4
|
my $errorprefix = "Warning" . ($_[2] ? " (line $_[2])" : ""); |
3382
|
5
|
50
|
|
|
|
11
|
print {*STDERR} "\n" if _verbosity("HINT"); |
|
5
|
|
|
|
|
26
|
|
3383
|
4
|
|
|
|
|
7
|
$errortext =~ s/\s+/ /g; |
3384
|
4
|
|
|
|
|
6
|
_write_ERROR($errorprefix, $errortext); |
3385
|
4
|
|
|
|
|
8
|
return 1; |
3386
|
|
|
|
|
|
|
} |
3387
|
|
|
|
|
|
|
|
3388
|
|
|
|
|
|
|
sub _hint($) |
3389
|
|
|
|
|
|
|
{ |
3390
|
2
|
100
|
|
2
|
|
7
|
return 0 unless $::RD_HINT; |
3391
|
1
|
|
|
|
|
1
|
my $errortext = $_[0]; |
3392
|
1
|
50
|
|
|
|
2
|
my $errorprefix = "Hint" . ($_[1] ? " (line $_[1])" : ""); |
3393
|
1
|
|
|
|
|
3
|
$errortext =~ s/\s+/ /g; |
3394
|
1
|
|
|
|
|
3
|
_write_ERROR($errorprefix, $errortext); |
3395
|
1
|
|
|
|
|
3
|
return 1; |
3396
|
|
|
|
|
|
|
} |
3397
|
|
|
|
|
|
|
|
3398
|
|
|
|
|
|
|
sub _tracemax($) |
3399
|
|
|
|
|
|
|
{ |
3400
|
1
|
0
|
33
|
1
|
|
3
|
if (defined $::RD_TRACE |
|
|
|
66
|
|
|
|
|
|
|
|
33
|
|
|
|
|
3401
|
|
|
|
|
|
|
&& $::RD_TRACE =~ /\d+/ |
3402
|
|
|
|
|
|
|
&& $::RD_TRACE>1 |
3403
|
|
|
|
|
|
|
&& $::RD_TRACE+10
|
3404
|
|
|
|
|
|
|
{ |
3405
|
1
|
|
|
|
|
2
|
my $count = length($_[0]) - $::RD_TRACE; |
3406
|
1
|
|
|
|
|
3
|
return substr($_[0],0,$::RD_TRACE/2) |
3407
|
|
|
|
|
|
|
. "...<$count>..." |
3408
|
|
|
|
|
|
|
. substr($_[0],-$::RD_TRACE/2); |
3409
|
|
|
|
|
|
|
} |
3410
|
|
|
|
|
|
|
else |
3411
|
|
|
|
|
|
|
{ |
3412
|
1
|
|
|
|
|
4
|
return substr($_[0],0,500); |
3413
|
|
|
|
|
|
|
} |
3414
|
|
|
|
|
|
|
} |
3415
|
|
|
|
|
|
|
|
3416
|
|
|
|
|
|
|
sub _tracefirst($) |
3417
|
|
|
|
|
|
|
{ |
3418
|
1
|
50
|
33
|
1
|
|
2
|
if (defined $::RD_TRACE |
|
|
|
33
|
|
|
|
|
|
|
|
33
|
|
|
|
|
3419
|
|
|
|
|
|
|
&& $::RD_TRACE =~ /\d+/ |
3420
|
|
|
|
|
|
|
&& $::RD_TRACE>1 |
3421
|
|
|
|
|
|
|
&& $::RD_TRACE+10
|
3422
|
|
|
|
|
|
|
{ |
3423
|
1
|
|
|
|
|
2
|
my $count = length($_[0]) - $::RD_TRACE; |
3424
|
5
|
|
|
|
|
20
|
return substr($_[0],0,$::RD_TRACE) . "...<+$count>"; |
3425
|
|
|
|
|
|
|
} |
3426
|
|
|
|
|
|
|
else |
3427
|
|
|
|
|
|
|
{ |
3428
|
4
|
|
|
|
|
7
|
return substr($_[0],0,500); |
3429
|
|
|
|
|
|
|
} |
3430
|
|
|
|
|
|
|
} |
3431
|
|
|
|
|
|
|
|
3432
|
|
|
|
|
|
|
my $lastcontext = ''; |
3433
|
|
|
|
|
|
|
my $lastrulename = ''; |
3434
|
|
|
|
|
|
|
my $lastlevel = ''; |
3435
|
|
|
|
|
|
|
|
3436
|
|
|
|
|
|
|
sub _trace($;$$$) |
3437
|
|
|
|
|
|
|
{ |
3438
|
4
|
|
|
2
|
|
5
|
my $tracemsg = $_[0]; |
3439
|
4
|
|
66
|
|
|
3
|
my $tracecontext = $_[1]||$lastcontext; |
3440
|
4
|
|
33
|
|
|
4
|
my $tracerulename = $_[2]||$lastrulename; |
3441
|
4
|
|
33
|
|
|
5
|
my $tracelevel = $_[3]||$lastlevel; |
3442
|
4
|
50
|
|
|
|
6
|
if ($tracerulename) { $lastrulename = $tracerulename } |
|
4
|
|
|
|
|
3
|
|
3443
|
4
|
50
|
|
|
|
5
|
if ($tracelevel) { $lastlevel = $tracelevel } |
|
4
|
|
|
|
|
9
|
|
3444
|
|
|
|
|
|
|
|
3445
|
4
|
|
|
|
|
8
|
$tracecontext =~ s/\n/\\n/g; |
3446
|
4
|
|
|
|
|
8
|
$tracecontext =~ s/\s+/ /g; |
3447
|
4
|
|
|
|
|
10
|
$tracerulename = qq{$tracerulename}; |
3448
|
4
|
|
|
|
|
18
|
_write_TRACE($tracelevel, $tracerulename, $tracemsg); |
3449
|
2
|
0
|
|
|
|
4
|
if ($tracecontext ne $lastcontext) |
3450
|
|
|
|
|
|
|
{ |
3451
|
2
|
50
|
|
|
|
4
|
if ($tracecontext) |
3452
|
|
|
|
|
|
|
{ |
3453
|
2
|
|
|
|
|
4
|
$lastcontext = _tracefirst($tracecontext); |
3454
|
2
|
|
|
|
|
7
|
$tracecontext = qq{"$tracecontext"}; |
3455
|
|
|
|
|
|
|
} |
3456
|
|
|
|
|
|
|
else |
3457
|
|
|
|
|
|
|
{ |
3458
|
2
|
|
|
|
|
3
|
$tracecontext = qq{}; |
3459
|
|
|
|
|
|
|
} |
3460
|
2
|
|
|
|
|
2
|
_write_TRACECONTEXT($tracelevel, $tracerulename, $tracecontext); |
3461
|
|
|
|
|
|
|
} |
3462
|
|
|
|
|
|
|
} |
3463
|
|
|
|
|
|
|
|
3464
|
|
|
|
|
|
|
sub _matchtracemessage |
3465
|
|
|
|
|
|
|
{ |
3466
|
5823
|
|
|
5822
|
|
4663
|
my ($self, $reject) = @_; |
3467
|
|
|
|
|
|
|
|
3468
|
5823
|
|
|
|
|
3720
|
my $prefix = ''; |
3469
|
5823
|
|
|
|
|
3524
|
my $postfix = ''; |
3470
|
5823
|
|
|
|
|
4148
|
my $matched = not $reject; |
3471
|
5823
|
|
|
|
|
5813
|
my @t = ("Matched", "Didn't match"); |
3472
|
5823
|
100
|
66
|
|
|
9356
|
if (exists $self->{lookahead} and $self->{lookahead}) |
3473
|
|
|
|
|
|
|
{ |
3474
|
18
|
100
|
|
|
|
27
|
$postfix = $reject ? "(reject)" : "(keep)"; |
3475
|
18
|
|
|
|
|
23
|
$prefix = "..."; |
3476
|
18
|
100
|
|
|
|
33
|
if ($self->{lookahead} < 0) |
3477
|
|
|
|
|
|
|
{ |
3478
|
7
|
|
|
|
|
16
|
$prefix .= '!'; |
3479
|
4
|
|
|
|
|
5
|
$matched = not $matched; |
3480
|
|
|
|
|
|
|
} |
3481
|
|
|
|
|
|
|
} |
3482
|
5823
|
100
|
|
|
|
19031
|
$prefix . ($matched ? $t[0] : $t[1]) . $postfix; |
3483
|
|
|
|
|
|
|
} |
3484
|
|
|
|
|
|
|
|
3485
|
|
|
|
|
|
|
sub _parseunneg($$$$$) |
3486
|
|
|
|
|
|
|
{ |
3487
|
1254
|
|
|
1255
|
|
1738
|
_parse($_[0],$_[1],$_[3],$_[4]); |
3488
|
1254
|
50
|
|
|
|
1937
|
if ($_[2]<0) |
3489
|
|
|
|
|
|
|
{ |
3490
|
2
|
|
|
|
|
3
|
_error("Can't negate \"$_[4]\".",$_[3]); |
3491
|
2
|
|
|
|
|
3
|
_hint("You can't negate $_[0]. Remove the \"...!\" before |
3492
|
|
|
|
|
|
|
\"$_[4]\"."); |
3493
|
2
|
|
|
|
|
2
|
return 0; |
3494
|
|
|
|
|
|
|
} |
3495
|
1254
|
|
|
|
|
1839
|
return 1; |
3496
|
|
|
|
|
|
|
} |
3497
|
|
|
|
|
|
|
|
3498
|
|
|
|
|
|
|
sub _parse($$$$) |
3499
|
|
|
|
|
|
|
{ |
3500
|
4209
|
|
|
4208
|
|
4359
|
my $what = $_[3]; |
3501
|
4209
|
|
|
|
|
5602
|
$what =~ s/^\s+//; |
3502
|
4209
|
100
|
|
|
|
5656
|
if ($_[1]) |
3503
|
|
|
|
|
|
|
{ |
3504
|
2
|
50
|
|
|
|
4
|
_warn(3,"Found $_[0] ($what) after an unconditional ",$_[2]) |
3505
|
|
|
|
|
|
|
and |
3506
|
|
|
|
|
|
|
_hint("An unconditional always causes the |
3507
|
|
|
|
|
|
|
production containing it to immediately fail. |
3508
|
|
|
|
|
|
|
\u$_[0] that follows an |
3509
|
|
|
|
|
|
|
will never be reached. Did you mean to use |
3510
|
|
|
|
|
|
|
instead?"); |
3511
|
|
|
|
|
|
|
} |
3512
|
|
|
|
|
|
|
|
3513
|
4209
|
50
|
|
|
|
4890
|
return if ! _verbosity("TRACE"); |
3514
|
0
|
|
|
|
|
0
|
my $errortext = "Treating \"$what\" as $_[0]"; |
3515
|
0
|
|
|
|
|
0
|
my $errorprefix = "Parse::RecDescent"; |
3516
|
0
|
|
|
|
|
0
|
$errortext =~ s/\s+/ /g; |
3517
|
2
|
|
|
|
|
5
|
_write_ERROR($errorprefix, $errortext); |
3518
|
|
|
|
|
|
|
} |
3519
|
|
|
|
|
|
|
|
3520
|
|
|
|
|
|
|
sub _linecount($) { |
3521
|
4714
|
|
100
|
4713
|
|
29477
|
scalar substr($_[0], pos $_[0]||0) =~ tr/\n// |
3522
|
|
|
|
|
|
|
} |
3523
|
|
|
|
|
|
|
|
3524
|
|
|
|
|
|
|
|
3525
|
|
|
|
|
|
|
package main; |
3526
|
|
|
|
|
|
|
|
3527
|
13
|
|
|
13
|
|
136
|
use vars qw ( $RD_ERRORS $RD_WARN $RD_HINT $RD_TRACE $RD_CHECK ); |
|
13
|
|
|
|
|
20
|
|
|
13
|
|
|
|
|
1370
|
|
3528
|
|
|
|
|
|
|
$::RD_CHECK = 1; |
3529
|
|
|
|
|
|
|
$::RD_ERRORS = 1; |
3530
|
|
|
|
|
|
|
$::RD_WARN = 3; |
3531
|
|
|
|
|
|
|
|
3532
|
|
|
|
|
|
|
1; |
3533
|
|
|
|
|
|
|
|
3534
|
|
|
|
|
|
|
__END__ |