File Coverage

blib/lib/XML/XSH2/Parser.pm
Criterion Covered Total %
statement 5601 9130 61.3
branch 1726 5684 30.3
condition 431 1517 28.4
subroutine 297 475 62.5
pod 0 1 0.0
total 8055 16807 47.9


line stmt bran cond sub pod time code
1             #
2             # This parser was generated with
3             # Parse::RecDescent version 1.967015
4             #
5              
6             {
7             # GENERATE RECURSIVE DESCENT PARSER OBJECTS FROM A GRAMMAR
8              
9 8     8   242 use 5.006;
  8         31  
10 8     8   50 use strict;
  8         15  
  8         351  
11              
12             package # this should not be indexed by CPAN
13             XML::XSH2::Parser::_Runtime;
14              
15 8     8   5858 use Text::Balanced qw ( extract_codeblock extract_bracketed extract_quotelike extract_delimited );
  8         80818  
  8         808  
16              
17 8     8   69 use vars qw ( $skip );
  8         16  
  8         74547  
18              
19             *defskip = \ '\s*'; # DEFAULT SEPARATOR IS OPTIONAL WHITESPACE
20             $skip = '\s*'; # UNIVERSAL SEPARATOR IS OPTIONAL WHITESPACE
21             my $MAXREP = 100_000_000; # REPETITIONS MATCH AT MOST 100,000,000 TIMES
22              
23              
24              
25             package # this should not be indexed by CPAN
26             XML::XSH2::Parser::_Runtime::LineCounter;
27              
28              
29             sub TIESCALAR # ($classname, \$text, $thisparser, $prevflag)
30             {
31 31925 50   31925   98647 bless {
32             text => $_[1],
33             parser => $_[2],
34             prev => $_[3]?1:0,
35             }, $_[0];
36             }
37              
38             sub FETCH
39             {
40 2897     2897   5733 my $parser = $_[0]->{parser};
41 2897         4916 my $cache = $parser->{linecounter_cache};
42 2897         7329 my $from = $parser->{fulltextlen}-length(${$_[0]->{text}})-$_[0]->{prev}
43 2897         4522 ;
44              
45 2897 100       7579 unless (exists $cache->{$from})
46             {
47             $parser->{lastlinenum} = $parser->{offsetlinenum}
48 1817         5926 - XML::XSH2::Parser::_Runtime::_linecount(substr($parser->{fulltext},$from))
49             + 1;
50 1817         6384 $cache->{$from} = $parser->{lastlinenum};
51             }
52 2897         8838 return $cache->{$from};
53             }
54              
55             sub STORE
56             {
57 0     0   0 my $parser = $_[0]->{parser};
58 0         0 $parser->{offsetlinenum} -= $parser->{lastlinenum} - $_[1];
59 0         0 return undef;
60             }
61              
62             sub resync # ($linecounter)
63             {
64 0     0   0 my $self = tied($_[0]);
65 0 0       0 die "Tried to alter something other than a LineCounter\n"
66             unless $self =~ /XML::XSH2::Parser::_Runtime::LineCounter/;
67              
68 0         0 my $parser = $self->{parser};
69             my $apparently = $parser->{offsetlinenum}
70 0         0 - XML::XSH2::Parser::_Runtime::_linecount(${$self->{text}})
  0         0  
71             + 1;
72              
73 0         0 $parser->{offsetlinenum} += $parser->{lastlinenum} - $apparently;
74 0         0 return 1;
75             }
76              
77             package # this should not be indexed by CPAN
78             XML::XSH2::Parser::_Runtime::ColCounter;
79              
80             sub TIESCALAR # ($classname, \$text, $thisparser, $prevflag)
81             {
82 31925 50   31925   97668 bless {
83             text => $_[1],
84             parser => $_[2],
85             prev => $_[3]?1:0,
86             }, $_[0];
87             }
88              
89             sub FETCH
90             {
91 1200     1200   2143 my $parser = $_[0]->{parser};
92 1200         1697 my $missing = $parser->{fulltextlen}-length(${$_[0]->{text}})-$_[0]->{prev}+1;
  1200         2709  
93 1200         7604 substr($parser->{fulltext},0,$missing) =~ m/^(.*)\Z/m;
94 1200         4416 return length($1);
95             }
96              
97             sub STORE
98             {
99 0     0   0 die "Can't set column number via \$thiscolumn\n";
100             }
101              
102              
103             package # this should not be indexed by CPAN
104             XML::XSH2::Parser::_Runtime::OffsetCounter;
105              
106             sub TIESCALAR # ($classname, \$text, $thisparser, $prev)
107             {
108 31925 50   31925   116158 bless {
109             text => $_[1],
110             parser => $_[2],
111             prev => $_[3]?-1:0,
112             }, $_[0];
113             }
114              
115             sub FETCH
116             {
117 1200     1200   2147 my $parser = $_[0]->{parser};
118 1200         1718 return $parser->{fulltextlen}-length(${$_[0]->{text}})+$_[0]->{prev};
  1200         5315  
119             }
120              
121             sub STORE
122             {
123 0     0   0 die "Can't set current offset via \$thisoffset or \$prevoffset\n";
124             }
125              
126              
127              
128             package # this should not be indexed by CPAN
129             XML::XSH2::Parser::_Runtime::Rule;
130              
131             sub new ($$$$$)
132             {
133 0   0 0   0 my $class = ref($_[0]) || $_[0];
134 0         0 my $name = $_[1];
135 0         0 my $owner = $_[2];
136 0         0 my $line = $_[3];
137 0         0 my $replace = $_[4];
138              
139 0 0       0 if (defined $owner->{"rules"}{$name})
140             {
141 0         0 my $self = $owner->{"rules"}{$name};
142 0 0 0     0 if ($replace && !$self->{"changed"})
143             {
144 0         0 $self->reset;
145             }
146 0         0 return $self;
147             }
148             else
149             {
150 0         0 return $owner->{"rules"}{$name} =
151             bless
152             {
153             "name" => $name,
154             "prods" => [],
155             "calls" => [],
156             "changed" => 0,
157             "line" => $line,
158             "impcount" => 0,
159             "opcount" => 0,
160             "vars" => "",
161             }, $class;
162             }
163             }
164              
165             sub reset($)
166             {
167 0     0   0 @{$_[0]->{"prods"}} = ();
  0         0  
168 0         0 @{$_[0]->{"calls"}} = ();
  0         0  
169 0         0 $_[0]->{"changed"} = 0;
170 0         0 $_[0]->{"impcount"} = 0;
171 0         0 $_[0]->{"opcount"} = 0;
172 0         0 $_[0]->{"vars"} = "";
173             }
174              
175       0     sub DESTROY {}
176              
177             sub hasleftmost($$)
178             {
179 0     0   0 my ($self, $ref) = @_;
180              
181 0         0 my $prod;
182 0         0 foreach $prod ( @{$self->{"prods"}} )
  0         0  
183             {
184 0 0       0 return 1 if $prod->hasleftmost($ref);
185             }
186              
187 0         0 return 0;
188             }
189              
190             sub leftmostsubrules($)
191             {
192 0     0   0 my $self = shift;
193 0         0 my @subrules = ();
194              
195 0         0 my $prod;
196 0         0 foreach $prod ( @{$self->{"prods"}} )
  0         0  
197             {
198 0         0 push @subrules, $prod->leftmostsubrule();
199             }
200              
201 0         0 return @subrules;
202             }
203              
204             sub expected($)
205             {
206 0     0   0 my $self = shift;
207 0         0 my @expected = ();
208              
209 0         0 my $prod;
210 0         0 foreach $prod ( @{$self->{"prods"}} )
  0         0  
211             {
212 0         0 my $next = $prod->expected();
213 0 0 0     0 unless (! $next or _contains($next,@expected) )
214             {
215 0         0 push @expected, $next;
216             }
217             }
218              
219 0         0 return join ', or ', @expected;
220             }
221              
222             sub _contains($@)
223             {
224 0     0   0 my $target = shift;
225 0         0 my $item;
226 0 0       0 foreach $item ( @_ ) { return 1 if $target eq $item; }
  0         0  
227 0         0 return 0;
228             }
229              
230             sub addcall($$)
231             {
232 0     0   0 my ( $self, $subrule ) = @_;
233 0 0       0 unless ( _contains($subrule, @{$self->{"calls"}}) )
  0         0  
234             {
235 0         0 push @{$self->{"calls"}}, $subrule;
  0         0  
236             }
237             }
238              
239             sub addprod($$)
240             {
241 0     0   0 my ( $self, $prod ) = @_;
242 0         0 push @{$self->{"prods"}}, $prod;
  0         0  
243 0         0 $self->{"changed"} = 1;
244 0         0 $self->{"impcount"} = 0;
245 0         0 $self->{"opcount"} = 0;
246 0         0 $prod->{"number"} = $#{$self->{"prods"}};
  0         0  
247 0         0 return $prod;
248             }
249              
250             sub addvar
251             {
252 0     0   0 my ( $self, $var, $parser ) = @_;
253 0 0       0 if ($var =~ /\A\s*local\s+([%@\$]\w+)/)
254             {
255 0         0 $parser->{localvars} .= " $1";
256 0         0 $self->{"vars"} .= "$var;\n" }
257             else
258 0         0 { $self->{"vars"} .= "my $var;\n" }
259 0         0 $self->{"changed"} = 1;
260 0         0 return 1;
261             }
262              
263             sub addautoscore
264             {
265 0     0   0 my ( $self, $code ) = @_;
266 0         0 $self->{"autoscore"} = $code;
267 0         0 $self->{"changed"} = 1;
268 0         0 return 1;
269             }
270              
271             sub nextoperator($)
272             {
273 0     0   0 my $self = shift;
274 0         0 my $prodcount = scalar @{$self->{"prods"}};
  0         0  
275 0         0 my $opcount = ++$self->{"opcount"};
276 0         0 return "_operator_${opcount}_of_production_${prodcount}_of_rule_$self->{name}";
277             }
278              
279             sub nextimplicit($)
280             {
281 0     0   0 my $self = shift;
282 0         0 my $prodcount = scalar @{$self->{"prods"}};
  0         0  
283 0         0 my $impcount = ++$self->{"impcount"};
284 0         0 return "_alternation_${impcount}_of_production_${prodcount}_of_rule_$self->{name}";
285             }
286              
287              
288             sub code
289             {
290 0     0   0 my ($self, $namespace, $parser, $check) = @_;
291              
292 0 0       0 eval 'undef &' . $namespace . '::' . $self->{"name"} unless $parser->{saving};
293              
294             my $code =
295             '
296             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
297             sub ' . $namespace . '::' . $self->{"name"} . '
298             {
299             my $thisparser = $_[0];
300             use vars q{$tracelevel};
301             local $tracelevel = ($tracelevel||0)+1;
302             $ERRORS = 0;
303             my $thisrule = $thisparser->{"rules"}{"' . $self->{"name"} . '"};
304              
305             XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [' . $self->{"name"} . ']},
306             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
307             q{' . $self->{"name"} . '},
308             $tracelevel)
309             if defined $::RD_TRACE;
310              
311             ' . ($parser->{deferrable}
312             ? 'my $def_at = @{$thisparser->{deferred}};'
313             : '') .
314             '
315             my $err_at = @{$thisparser->{errors}};
316              
317             my $score;
318             my $score_return;
319             my $_tok;
320             my $return = undef;
321             my $_matched=0;
322             my $commit=0;
323             my @item = ();
324             my %item = ();
325             my $repeating = $_[2];
326             my $_noactions = $_[3];
327             my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
328             my $_itempos = $_[5];
329             my %arg = ($#arg & 01) ? @arg : (@arg, undef);
330             my $text;
331             my $lastsep;
332             my $current_match;
333             my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{' . $self->expected() . '});
334             $expectation->at($_[1]);
335             '. ($parser->{_check}{thisoffset}?'
336             my $thisoffset;
337             tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
338             ':'') . ($parser->{_check}{prevoffset}?'
339             my $prevoffset;
340             tie $prevoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser, 1;
341             ':'') . ($parser->{_check}{thiscolumn}?'
342             my $thiscolumn;
343             tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
344             ':'') . ($parser->{_check}{prevcolumn}?'
345             my $prevcolumn;
346             tie $prevcolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser, 1;
347             ':'') . ($parser->{_check}{prevline}?'
348             my $prevline;
349             tie $prevline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser, 1;
350             ':'') . '
351             my $thisline;
352             tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
353              
354 0 0       0 '. $self->{vars} .'
    0          
    0          
    0          
    0          
    0          
355             ';
356              
357 0         0 my $prod;
358 0         0 foreach $prod ( @{$self->{"prods"}} )
  0         0  
359             {
360 0 0       0 $prod->addscore($self->{autoscore},0,0) if $self->{autoscore};
361 0 0       0 next unless $prod->checkleftmost();
362 0         0 $code .= $prod->code($namespace,$self,$parser);
363              
364             $code .= $parser->{deferrable}
365 0 0       0 ? ' splice
366             @{$thisparser->{deferred}}, $def_at unless $_matched;
367             '
368             : '';
369             }
370              
371             $code .=
372             '
373             unless ( $_matched || defined($score) )
374             {
375             ' .($parser->{deferrable}
376             ? ' splice @{$thisparser->{deferred}}, $def_at;
377             '
378             : '') . '
379              
380             $_[1] = $text; # NOT SURE THIS IS NEEDED
381             XML::XSH2::Parser::_Runtime::_trace(q{<<'.XML::XSH2::Parser::_Runtime::_matchtracemessage($self,1).' rule>>},
382             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
383             q{' . $self->{"name"} .'},
384             $tracelevel)
385             if defined $::RD_TRACE;
386             return undef;
387             }
388             if (!defined($return) && defined($score))
389             {
390             XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
391             q{' . $self->{"name"} .'},
392             $tracelevel)
393             if defined $::RD_TRACE;
394             $return = $score_return;
395             }
396             splice @{$thisparser->{errors}}, $err_at;
397             $return = $item[$#item] unless defined $return;
398             if (defined $::RD_TRACE)
399             {
400             XML::XSH2::Parser::_Runtime::_trace(q{>>'.XML::XSH2::Parser::_Runtime::_matchtracemessage($self).' rule<< (return value: [} .
401             $return . q{])}, "",
402             q{' . $self->{"name"} .'},
403             $tracelevel);
404             XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
405             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
406             XML::XSH2::Parser::_Runtime::_tracefirst($text),
407 0 0       0 , q{' . $self->{"name"} .'},
408             $tracelevel)
409             }
410             $_[1] = $text;
411             return $return;
412             }
413             ';
414              
415 0         0 return $code;
416             }
417              
418             my @left;
419             sub isleftrec($$)
420             {
421 0     0   0 my ($self, $rules) = @_;
422 0         0 my $root = $self->{"name"};
423 0         0 @left = $self->leftmostsubrules();
424 0         0 my $next;
425 0         0 foreach $next ( @left )
426             {
427 0 0       0 next unless defined $rules->{$next}; # SKIP NON-EXISTENT RULES
428 0 0       0 return 1 if $next eq $root;
429 0         0 my $child;
430 0         0 foreach $child ( $rules->{$next}->leftmostsubrules() )
431             {
432 0 0       0 push(@left, $child)
433             if ! _contains($child, @left) ;
434             }
435             }
436 0         0 return 0;
437             }
438              
439             package # this should not be indexed by CPAN
440             XML::XSH2::Parser::_Runtime::Production;
441              
442             sub describe ($;$)
443             {
444 0 0   0   0 return join ' ', map { $_->describe($_[1]) or () } @{$_[0]->{items}};
  0         0  
  0         0  
445             }
446              
447             sub new ($$;$$)
448             {
449 0     0   0 my ($self, $line, $uncommit, $error) = @_;
450 0   0     0 my $class = ref($self) || $self;
451              
452 0         0 bless
453             {
454             "items" => [],
455             "uncommit" => $uncommit,
456             "error" => $error,
457             "line" => $line,
458             strcount => 0,
459             patcount => 0,
460             dircount => 0,
461             actcount => 0,
462             }, $class;
463             }
464              
465             sub expected ($)
466             {
467 0     0   0 my $itemcount = scalar @{$_[0]->{"items"}};
  0         0  
468 0 0       0 return ($itemcount) ? $_[0]->{"items"}[0]->describe(1) : '';
469             }
470              
471             sub hasleftmost ($$)
472             {
473 0     0   0 my ($self, $ref) = @_;
474 0 0       0 return ${$self->{"items"}}[0] eq $ref if scalar @{$self->{"items"}};
  0         0  
  0         0  
475 0         0 return 0;
476             }
477              
478             sub isempty($)
479             {
480 0     0   0 my $self = shift;
481 0         0 return 0 == @{$self->{"items"}};
  0         0  
482             }
483              
484             sub leftmostsubrule($)
485             {
486 0     0   0 my $self = shift;
487              
488 0 0       0 if ( $#{$self->{"items"}} >= 0 )
  0         0  
489             {
490 0         0 my $subrule = $self->{"items"}[0]->issubrule();
491 0 0       0 return $subrule if defined $subrule;
492             }
493              
494 0         0 return ();
495             }
496              
497             sub checkleftmost($)
498             {
499 0     0   0 my @items = @{$_[0]->{"items"}};
  0         0  
500 0 0 0     0 if (@items==1 && ref($items[0]) =~ /\AXML::XSH2::Parser::_Runtime::Error/
    0 0        
    0 0        
      0        
      0        
      0        
501             && $items[0]->{commitonly} )
502             {
503 0         0 XML::XSH2::Parser::_Runtime::_warn(2,"Lone in production treated
504             as ");
505 0         0 XML::XSH2::Parser::_Runtime::_hint("A production consisting of a single
506             conditional directive would
507             normally succeed (with the value zero) if the
508             rule is not 'commited' when it is
509             tried. Since you almost certainly wanted
510             ' ' XML::XSH2::Parser::_Runtime
511             supplied it for you.");
512 0         0 push @{$_[0]->{items}},
  0         0  
513             XML::XSH2::Parser::_Runtime::UncondReject->new(0,0,'');
514             }
515             elsif (@items==1 && ($items[0]->describe||"") =~ /
516             {
517             # Do nothing
518             }
519             elsif (@items &&
520             ( ref($items[0]) =~ /\AXML::XSH2::Parser::_Runtime::UncondReject/
521             || ($items[0]->describe||"") =~ /
522             ))
523             {
524 0         0 XML::XSH2::Parser::_Runtime::_warn(1,"Optimizing away production: [". $_[0]->describe ."]");
525 0 0       0 my $what = $items[0]->describe =~ /
    0          
526             ? "a (which acts like an unconditional during parsing)"
527             : $items[0]->describe =~ /
528             ? "an (which acts like an unconditional during parsing)"
529             : "an unconditional ";
530 0 0       0 my $caveat = $items[0]->describe =~ /
531             ? " after the specified variable was set up"
532             : "";
533 0 0       0 my $advice = @items > 1
534             ? "However, there were also other (useless) items after the leading "
535             . $items[0]->describe
536             . ", so you may have been expecting some other behaviour."
537             : "You can safely ignore this message.";
538 0         0 XML::XSH2::Parser::_Runtime::_hint("The production starts with $what. That means that the
539             production can never successfully match, so it was
540             optimized out of the final parser$caveat. $advice");
541 0         0 return 0;
542             }
543 0         0 return 1;
544             }
545              
546             sub changesskip($)
547             {
548 0     0   0 my $item;
549 0         0 foreach $item (@{$_[0]->{"items"}})
  0         0  
550             {
551 0 0       0 if (ref($item) =~ /XML::XSH2::Parser::_Runtime::(Action|Directive)/)
552             {
553 0 0       0 return 1 if $item->{code} =~ /\$skip\s*=/;
554             }
555             }
556 0         0 return 0;
557             }
558              
559             sub adddirective
560             {
561 0     0   0 my ( $self, $whichop, $line, $name ) = @_;
562 0         0 push @{$self->{op}},
563             { type=>$whichop, line=>$line, name=>$name,
564 0         0 offset=> scalar(@{$self->{items}}) };
  0         0  
565             }
566              
567             sub addscore
568             {
569 0     0   0 my ( $self, $code, $lookahead, $line ) = @_;
570             $self->additem(XML::XSH2::Parser::_Runtime::Directive->new(
571             "local \$^W;
572             my \$thisscore = do { $code } + 0;
573             if (!defined(\$score) || \$thisscore>\$score)
574             { \$score=\$thisscore; \$score_return=\$item[-1]; }
575             undef;", $lookahead, $line,"") )
576 0 0       0 unless $self->{items}[-1]->describe =~ /
577 0         0 return 1;
578             }
579              
580             sub check_pending
581             {
582 0     0   0 my ( $self, $line ) = @_;
583 0 0       0 if ($self->{op})
584             {
585 0         0 while (my $next = pop @{$self->{op}})
  0         0  
586             {
587 0         0 XML::XSH2::Parser::_Runtime::_error("Incomplete <$next->{type}op:...>.", $line);
588 0         0 XML::XSH2::Parser::_Runtime::_hint(
589             "The current production ended without completing the
590             <$next->{type}op:...> directive that started near line
591             $next->{line}. Did you forget the closing '>'?");
592             }
593             }
594 0         0 return 1;
595             }
596              
597             sub enddirective
598             {
599 0     0   0 my ( $self, $line, $minrep, $maxrep ) = @_;
600 0 0       0 unless ($self->{op})
601             {
602 0         0 XML::XSH2::Parser::_Runtime::_error("Unmatched > found.", $line);
603 0         0 XML::XSH2::Parser::_Runtime::_hint(
604             "A '>' angle bracket was encountered, which typically
605             indicates the end of a directive. However no suitable
606             preceding directive was encountered. Typically this
607             indicates either a extra '>' in the grammar, or a
608             problem inside the previous directive.");
609 0         0 return;
610             }
611 0         0 my $op = pop @{$self->{op}};
  0         0  
612 0         0 my $span = @{$self->{items}} - $op->{offset};
  0         0  
613 0 0       0 if ($op->{type} =~ /left|right/)
614             {
615 0 0       0 if ($span != 3)
616             {
617 0         0 XML::XSH2::Parser::_Runtime::_error(
618             "Incorrect <$op->{type}op:...> specification:
619             expected 3 args, but found $span instead", $line);
620 0         0 XML::XSH2::Parser::_Runtime::_hint(
621             "The <$op->{type}op:...> directive requires a
622             sequence of exactly three elements. For example:
623             <$op->{type}op:leftarg /op/ rightarg>");
624             }
625             else
626             {
627 0         0 push @{$self->{items}},
628             XML::XSH2::Parser::_Runtime::Operator->new(
629 0         0 $op->{type}, $minrep, $maxrep, splice(@{$self->{"items"}}, -3));
  0         0  
630 0         0 $self->{items}[-1]->sethashname($self);
631 0         0 $self->{items}[-1]{name} = $op->{name};
632             }
633             }
634             }
635              
636             sub prevwasreturn
637             {
638 0     0   0 my ( $self, $line ) = @_;
639 0 0       0 unless (@{$self->{items}})
  0         0  
640             {
641 0         0 XML::XSH2::Parser::_Runtime::_error(
642             "Incorrect specification:
643             expected item missing", $line);
644 0         0 XML::XSH2::Parser::_Runtime::_hint(
645             "The directive requires a
646             sequence of at least one item. For example:
647             ");
648 0         0 return;
649             }
650 0         0 push @{$self->{items}},
  0         0  
651             XML::XSH2::Parser::_Runtime::Result->new();
652             }
653              
654             sub additem
655             {
656 0     0   0 my ( $self, $item ) = @_;
657 0         0 $item->sethashname($self);
658 0         0 push @{$self->{"items"}}, $item;
  0         0  
659 0         0 return $item;
660             }
661              
662             sub _duplicate_itempos
663             {
664 0     0   0 my ($src) = @_;
665 0         0 my $dst = {};
666              
667 0         0 foreach (keys %$src)
668             {
669 0         0 %{$dst->{$_}} = %{$src->{$_}};
  0         0  
  0         0  
670             }
671 0         0 $dst;
672             }
673              
674             sub _update_itempos
675             {
676 0     0   0 my ($dst, $src, $typekeys, $poskeys) = @_;
677              
678 0 0       0 my @typekeys = 'ARRAY' eq ref $typekeys ?
679             @$typekeys :
680             keys %$src;
681              
682 0         0 foreach my $k (keys %$src)
683             {
684 0 0       0 if ('ARRAY' eq ref $poskeys)
685             {
686 0         0 @{$dst->{$k}}{@$poskeys} = @{$src->{$k}}{@$poskeys};
  0         0  
  0         0  
687             }
688             else
689             {
690 0         0 %{$dst->{$k}} = %{$src->{$k}};
  0         0  
  0         0  
691             }
692             }
693             }
694              
695             sub preitempos
696             {
697             return q
698 0     0   0 {
699             push @itempos, {'offset' => {'from'=>$thisoffset, 'to'=>undef},
700             'line' => {'from'=>$thisline, 'to'=>undef},
701             'column' => {'from'=>$thiscolumn, 'to'=>undef} };
702             }
703             }
704              
705             sub incitempos
706             {
707             return q
708 0     0   0 {
709             $itempos[$#itempos]{'offset'}{'from'} += length($lastsep);
710             $itempos[$#itempos]{'line'}{'from'} = $thisline;
711             $itempos[$#itempos]{'column'}{'from'} = $thiscolumn;
712             }
713             }
714              
715             sub unincitempos
716             {
717             # the next incitempos will properly set these two fields, but
718             # {'offset'}{'from'} needs to be decreased by length($lastsep)
719             # $itempos[$#itempos]{'line'}{'from'}
720             # $itempos[$#itempos]{'column'}{'from'}
721             return q
722 0     0   0 {
723             $itempos[$#itempos]{'offset'}{'from'} -= length($lastsep) if defined $lastsep;
724             }
725             }
726              
727             sub postitempos
728             {
729             return q
730 0     0   0 {
731             $itempos[$#itempos]{'offset'}{'to'} = $prevoffset;
732             $itempos[$#itempos]{'line'}{'to'} = $prevline;
733             $itempos[$#itempos]{'column'}{'to'} = $prevcolumn;
734             }
735             }
736              
737             sub code($$$$)
738             {
739 0     0   0 my ($self,$namespace,$rule,$parser) = @_;
740             my $code =
741             '
742             while (!$_matched'
743             . (defined $self->{"uncommit"} ? '' : ' && !$commit')
744             . ')
745             {
746             ' .
747             ($self->changesskip()
748             ? 'local $skip = defined($skip) ? $skip : $XML::XSH2::Parser::_Runtime::skip;'
749             : '') .'
750             XML::XSH2::Parser::_Runtime::_trace(q{Trying production: ['
751             . $self->describe . ']},
752             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
753             q{' . $rule ->{name}. '},
754             $tracelevel)
755             if defined $::RD_TRACE;
756             my $thisprod = $thisrule->{"prods"}[' . $self->{"number"} . '];
757             ' . (defined $self->{"error"} ? '' : '$text = $_[1];' ) . '
758             my $_savetext;
759             @item = (q{' . $rule->{"name"} . '});
760 0 0       0 %item = (__RULE__ => q{' . $rule->{"name"} . '});
    0          
    0          
761             my $repcount = 0;
762              
763             ';
764             $code .=
765             ' my @itempos = ({});
766 0 0       0 ' if $parser->{_check}{itempos};
767              
768 0         0 my $item;
769             my $i;
770              
771 0         0 for ($i = 0; $i < @{$self->{"items"}}; $i++)
  0         0  
772             {
773 0         0 $item = ${$self->{items}}[$i];
  0         0  
774              
775 0 0       0 $code .= preitempos() if $parser->{_check}{itempos};
776              
777 0         0 $code .= $item->code($namespace,$rule,$parser->{_check});
778              
779 0 0       0 $code .= postitempos() if $parser->{_check}{itempos};
780              
781             }
782              
783 0 0 0     0 if ($parser->{_AUTOACTION} && defined($item) && !$item->isa("XML::XSH2::Parser::_Runtime::Action"))
    0 0        
      0        
      0        
784             {
785 0         0 $code .= $parser->{_AUTOACTION}->code($namespace,$rule);
786 0 0       0 XML::XSH2::Parser::_Runtime::_warn(1,"Autogenerating action in rule
787             \"$rule->{name}\":
788             $parser->{_AUTOACTION}{code}")
789             and
790             XML::XSH2::Parser::_Runtime::_hint("The \$::RD_AUTOACTION was defined,
791             so any production not ending in an
792             explicit action has the specified
793             \"auto-action\" automatically
794             appended.");
795             }
796             elsif ($parser->{_AUTOTREE} && defined($item) && !$item->isa("XML::XSH2::Parser::_Runtime::Action"))
797             {
798 0 0 0     0 if ($i==1 && $item->isterminal)
799             {
800 0         0 $code .= $parser->{_AUTOTREE}{TERMINAL}->code($namespace,$rule);
801             }
802             else
803             {
804 0         0 $code .= $parser->{_AUTOTREE}{NODE}->code($namespace,$rule);
805             }
806 0 0       0 XML::XSH2::Parser::_Runtime::_warn(1,"Autogenerating tree-building action in rule
807             \"$rule->{name}\"")
808             and
809             XML::XSH2::Parser::_Runtime::_hint("The directive was specified,
810             so any production not ending
811             in an explicit action has
812             some parse-tree building code
813             automatically appended.");
814             }
815              
816             $code .=
817             '
818             XML::XSH2::Parser::_Runtime::_trace(q{>>'.XML::XSH2::Parser::_Runtime::_matchtracemessage($self).' production: ['
819             . $self->describe . ']<<},
820             XML::XSH2::Parser::_Runtime::_tracefirst($text),
821             q{' . $rule->{name} . '},
822             $tracelevel)
823             if defined $::RD_TRACE;
824              
825 0 0       0 ' . ( $parser->{_check}{itempos} ? '
826             if ( defined($_itempos) )
827             {
828             XML::XSH2::Parser::_Runtime::Production::_update_itempos($_itempos, $itempos[ 1], undef, [qw(from)]);
829             XML::XSH2::Parser::_Runtime::Production::_update_itempos($_itempos, $itempos[-1], undef, [qw(to)]);
830             }
831             ' : '' ) . '
832              
833             $_matched = 1;
834             last;
835             }
836              
837             ';
838 0         0 return $code;
839             }
840              
841             1;
842              
843             package # this should not be indexed by CPAN
844             XML::XSH2::Parser::_Runtime::Action;
845              
846 0     0   0 sub describe { undef }
847              
848 0     0   0 sub sethashname { $_[0]->{hashname} = '__ACTION' . ++$_[1]->{actcount} .'__'; }
849              
850             sub new
851             {
852 0   0 0   0 my $class = ref($_[0]) || $_[0];
853 0         0 bless
854             {
855             "code" => $_[1],
856             "lookahead" => $_[2],
857             "line" => $_[3],
858             }, $class;
859             }
860              
861 0     0   0 sub issubrule { undef }
862 0     0   0 sub isterminal { 0 }
863              
864             sub code($$$$)
865             {
866 0     0   0 my ($self, $namespace, $rule) = @_;
867              
868             '
869             XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
870             XML::XSH2::Parser::_Runtime::_tracefirst($text),
871             q{' . $rule->{name} . '},
872             $tracelevel)
873             if defined $::RD_TRACE;
874             ' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) .'
875              
876             $_tok = ($_noactions) ? 0 : do ' . $self->{"code"} . ';
877             ' . ($self->{"lookahead"}<0?'if':'unless') . ' (defined $_tok)
878             {
879             XML::XSH2::Parser::_Runtime::_trace(q{<<'.XML::XSH2::Parser::_Runtime::_matchtracemessage($self,1).' action>> (return value: [undef])})
880             if defined $::RD_TRACE;
881             last;
882             }
883             XML::XSH2::Parser::_Runtime::_trace(q{>>'.XML::XSH2::Parser::_Runtime::_matchtracemessage($self).' action<< (return value: [}
884             . $_tok . q{])},
885             XML::XSH2::Parser::_Runtime::_tracefirst($text))
886             if defined $::RD_TRACE;
887             push @item, $_tok;
888             ' . ($self->{line}>=0 ? '$item{'. $self->{hashname} .'}=$_tok;' : '' ) .'
889 0 0       0 ' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .'
    0          
    0          
    0          
890             '
891             }
892              
893              
894             1;
895              
896             package # this should not be indexed by CPAN
897             XML::XSH2::Parser::_Runtime::Directive;
898              
899 0     0   0 sub sethashname { $_[0]->{hashname} = '__DIRECTIVE' . ++$_[1]->{dircount} . '__'; }
900              
901 0     0   0 sub issubrule { undef }
902 0     0   0 sub isterminal { 0 }
903 0 0   0   0 sub describe { $_[1] ? '' : $_[0]->{name} }
904              
905             sub new ($$$$$)
906             {
907 0   0 0   0 my $class = ref($_[0]) || $_[0];
908 0         0 bless
909             {
910             "code" => $_[1],
911             "lookahead" => $_[2],
912             "line" => $_[3],
913             "name" => $_[4],
914             }, $class;
915             }
916              
917             sub code($$$$)
918             {
919 0     0   0 my ($self, $namespace, $rule) = @_;
920              
921             '
922             ' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) .'
923              
924             XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: ['
925             . $self->describe . ']},
926             XML::XSH2::Parser::_Runtime::_tracefirst($text),
927             q{' . $rule->{name} . '},
928             $tracelevel)
929             if defined $::RD_TRACE; ' .'
930             $_tok = do { ' . $self->{"code"} . ' };
931             if (defined($_tok))
932             {
933             XML::XSH2::Parser::_Runtime::_trace(q{>>'.XML::XSH2::Parser::_Runtime::_matchtracemessage($self).' directive<< (return value: [}
934             . $_tok . q{])},
935             XML::XSH2::Parser::_Runtime::_tracefirst($text))
936             if defined $::RD_TRACE;
937             }
938             else
939             {
940             XML::XSH2::Parser::_Runtime::_trace(q{<<'.XML::XSH2::Parser::_Runtime::_matchtracemessage($self,1).' directive>>},
941             XML::XSH2::Parser::_Runtime::_tracefirst($text))
942             if defined $::RD_TRACE;
943             }
944             ' . ($self->{"lookahead"} ? '$text = $_savetext and ' : '' ) .'
945             last '
946             . ($self->{"lookahead"}<0?'if':'unless') . ' defined $_tok;
947             push @item, $item{'.$self->{hashname}.'}=$_tok;
948 0 0       0 ' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .'
    0          
    0          
    0          
949             '
950             }
951              
952             1;
953              
954             package # this should not be indexed by CPAN
955             XML::XSH2::Parser::_Runtime::UncondReject;
956              
957 0     0   0 sub issubrule { undef }
958 0     0   0 sub isterminal { 0 }
959 0 0   0   0 sub describe { $_[1] ? '' : $_[0]->{name} }
960 0     0   0 sub sethashname { $_[0]->{hashname} = '__DIRECTIVE' . ++$_[1]->{dircount} . '__'; }
961              
962             sub new ($$$;$)
963             {
964 0   0 0   0 my $class = ref($_[0]) || $_[0];
965 0         0 bless
966             {
967             "lookahead" => $_[1],
968             "line" => $_[2],
969             "name" => $_[3],
970             }, $class;
971             }
972              
973             # MARK, YOU MAY WANT TO OPTIMIZE THIS.
974              
975              
976             sub code($$$$)
977             {
978 0     0   0 my ($self, $namespace, $rule) = @_;
979              
980             '
981             XML::XSH2::Parser::_Runtime::_trace(q{>>Rejecting production<< (found '
982             . $self->describe . ')},
983             XML::XSH2::Parser::_Runtime::_tracefirst($text),
984             q{' . $rule->{name} . '},
985             $tracelevel)
986             if defined $::RD_TRACE;
987             undef $return;
988             ' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) .'
989              
990             $_tok = undef;
991             ' . ($self->{"lookahead"} ? '$text = $_savetext and ' : '' ) .'
992             last '
993 0 0       0 . ($self->{"lookahead"}<0?'if':'unless') . ' defined $_tok;
    0          
    0          
994             '
995             }
996              
997             1;
998              
999             package # this should not be indexed by CPAN
1000             XML::XSH2::Parser::_Runtime::Error;
1001              
1002 0     0   0 sub issubrule { undef }
1003 0     0   0 sub isterminal { 0 }
1004 0 0   0   0 sub describe { $_[1] ? '' : $_[0]->{commitonly} ? '' : '' }
    0          
1005 0     0   0 sub sethashname { $_[0]->{hashname} = '__DIRECTIVE' . ++$_[1]->{dircount} . '__'; }
1006              
1007             sub new ($$$$$)
1008             {
1009 0   0 0   0 my $class = ref($_[0]) || $_[0];
1010 0         0 bless
1011             {
1012             "msg" => $_[1],
1013             "lookahead" => $_[2],
1014             "commitonly" => $_[3],
1015             "line" => $_[4],
1016             }, $class;
1017             }
1018              
1019             sub code($$$$)
1020             {
1021 0     0   0 my ($self, $namespace, $rule) = @_;
1022              
1023 0         0 my $action = '';
1024              
1025 0 0       0 if ($self->{"msg"}) # ERROR MESSAGE SUPPLIED
1026             {
1027             #WAS: $action .= "XML::XSH2::Parser::_Runtime::_error(qq{$self->{msg}}" . ',$thisline);';
1028 0         0 $action .= 'push @{$thisparser->{errors}}, [qq{'.$self->{msg}.'},$thisline];';
1029              
1030             }
1031             else # GENERATE ERROR MESSAGE DURING PARSE
1032             {
1033 0         0 $action .= '
1034             my $rule = $item[0];
1035             $rule =~ s/_/ /g;
1036             #WAS: XML::XSH2::Parser::_Runtime::_error("Invalid $rule: " . $expectation->message() ,$thisline);
1037             push @{$thisparser->{errors}}, ["Invalid $rule: " . $expectation->message() ,$thisline];
1038             ';
1039             }
1040              
1041             my $dir =
1042             new XML::XSH2::Parser::_Runtime::Directive('if (' .
1043             ($self->{"commitonly"} ? '$commit' : '1') .
1044             ") { do {$action} unless ".' $_noactions; undef } else {0}',
1045 0 0       0 $self->{"lookahead"},0,$self->describe);
1046 0         0 $dir->{hashname} = $self->{hashname};
1047 0         0 return $dir->code($namespace, $rule, 0);
1048             }
1049              
1050             1;
1051              
1052             package # this should not be indexed by CPAN
1053             XML::XSH2::Parser::_Runtime::Token;
1054              
1055 0     0   0 sub sethashname { $_[0]->{hashname} = '__PATTERN' . ++$_[1]->{patcount} . '__'; }
1056              
1057 0     0   0 sub issubrule { undef }
1058 0     0   0 sub isterminal { 1 }
1059 0     0   0 sub describe ($) { shift->{'description'}}
1060              
1061              
1062             # ARGS ARE: $self, $pattern, $left_delim, $modifiers, $lookahead, $linenum
1063             sub new ($$$$$$)
1064             {
1065 0   0 0   0 my $class = ref($_[0]) || $_[0];
1066 0         0 my $pattern = $_[1];
1067 0         0 my $pat = $_[1];
1068 0         0 my $ldel = $_[2];
1069 0         0 my $rdel = $ldel;
1070 0         0 $rdel =~ tr/{[(/;
1071              
1072 0         0 my $mod = $_[3];
1073              
1074 0         0 my $desc;
1075              
1076 0 0       0 if ($ldel eq '/') { $desc = "$ldel$pattern$rdel$mod" }
  0         0  
1077 0         0 else { $desc = "m$ldel$pattern$rdel$mod" }
1078 0         0 $desc =~ s/\\/\\\\/g;
1079 0         0 $desc =~ s/\$$/\\\$/g;
1080 0         0 $desc =~ s/}/\\}/g;
1081 0         0 $desc =~ s/{/\\{/g;
1082              
1083 0 0 0     0 if (!eval "no strict;
1084             local \$SIG{__WARN__} = sub {0};
1085             '' =~ m$ldel$pattern$rdel$mod" and $@)
1086             {
1087 0         0 XML::XSH2::Parser::_Runtime::_warn(3, "Token pattern \"m$ldel$pattern$rdel$mod\"
1088             may not be a valid regular expression",
1089             $_[5]);
1090 0         0 $@ =~ s/ at \(eval.*/./;
1091 0         0 XML::XSH2::Parser::_Runtime::_hint($@);
1092             }
1093              
1094             # QUIETLY PREVENT (WELL-INTENTIONED) CALAMITY
1095 0         0 $mod =~ s/[gc]//g;
1096 0         0 $pattern =~ s/(\A|[^\\])\\G/$1/g;
1097              
1098 0         0 bless
1099             {
1100             "pattern" => $pattern,
1101             "ldelim" => $ldel,
1102             "rdelim" => $rdel,
1103             "mod" => $mod,
1104             "lookahead" => $_[4],
1105             "line" => $_[5],
1106             "description" => $desc,
1107             }, $class;
1108             }
1109              
1110              
1111             sub code($$$$$)
1112             {
1113 0     0   0 my ($self, $namespace, $rule, $check) = @_;
1114 0         0 my $ldel = $self->{"ldelim"};
1115 0         0 my $rdel = $self->{"rdelim"};
1116 0         0 my $sdel = $ldel;
1117 0         0 my $mod = $self->{"mod"};
1118              
1119 0         0 $sdel =~ s/[[{(<]/{}/;
1120              
1121             my $code = '
1122             XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [' . $self->describe
1123             . ']}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
1124             q{' . $rule->{name} . '},
1125             $tracelevel)
1126             if defined $::RD_TRACE;
1127             undef $lastsep;
1128             $expectation->is(q{' . ($rule->hasleftmost($self) ? ''
1129             : $self->describe ) . '})->at($text);
1130             ' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) . '
1131              
1132             ' . ($self->{"lookahead"}<0?'if':'unless')
1133             . ' ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and '
1134             . ($check->{itempos}? 'do {'.XML::XSH2::Parser::_Runtime::Production::incitempos().' 1} and ' : '')
1135             . ' $text =~ m' . $ldel . '\A(?:' . $self->{"pattern"} . ')' . $rdel . $mod . ')
1136             {
1137             '.($self->{"lookahead"} ? '$text = $_savetext;' : '$text = $lastsep . $text if defined $lastsep;') .
1138             ($check->{itempos} ? XML::XSH2::Parser::_Runtime::Production::unincitempos() : '') . '
1139             $expectation->failed();
1140             XML::XSH2::Parser::_Runtime::_trace(q{<>},
1141             XML::XSH2::Parser::_Runtime::_tracefirst($text))
1142             if defined $::RD_TRACE;
1143              
1144             last;
1145             }
1146             $current_match = substr($text, $-[0], $+[0] - $-[0]);
1147             substr($text,0,length($current_match),q{});
1148             XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
1149             . $current_match . q{])},
1150             XML::XSH2::Parser::_Runtime::_tracefirst($text))
1151             if defined $::RD_TRACE;
1152             push @item, $item{'.$self->{hashname}.'}=$current_match;
1153 0 0       0 ' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .'
    0          
    0          
    0          
    0          
    0          
    0          
1154             ';
1155              
1156 0         0 return $code;
1157             }
1158              
1159             1;
1160              
1161             package # this should not be indexed by CPAN
1162             XML::XSH2::Parser::_Runtime::Literal;
1163              
1164 0     0   0 sub sethashname { $_[0]->{hashname} = '__STRING' . ++$_[1]->{strcount} . '__'; }
1165              
1166 0     0   0 sub issubrule { undef }
1167 0     0   0 sub isterminal { 1 }
1168 0     0   0 sub describe ($) { shift->{'description'} }
1169              
1170             sub new ($$$$)
1171             {
1172 0   0 0   0 my $class = ref($_[0]) || $_[0];
1173              
1174 0         0 my $pattern = $_[1];
1175              
1176 0         0 my $desc = $pattern;
1177 0         0 $desc=~s/\\/\\\\/g;
1178 0         0 $desc=~s/}/\\}/g;
1179 0         0 $desc=~s/{/\\{/g;
1180              
1181 0         0 bless
1182             {
1183             "pattern" => $pattern,
1184             "lookahead" => $_[2],
1185             "line" => $_[3],
1186             "description" => "'$desc'",
1187             }, $class;
1188             }
1189              
1190              
1191             sub code($$$$)
1192             {
1193 0     0   0 my ($self, $namespace, $rule, $check) = @_;
1194              
1195             my $code = '
1196             XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [' . $self->describe
1197             . ']},
1198             XML::XSH2::Parser::_Runtime::_tracefirst($text),
1199             q{' . $rule->{name} . '},
1200             $tracelevel)
1201             if defined $::RD_TRACE;
1202             undef $lastsep;
1203             $expectation->is(q{' . ($rule->hasleftmost($self) ? ''
1204             : $self->describe ) . '})->at($text);
1205             ' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) . '
1206              
1207             ' . ($self->{"lookahead"}<0?'if':'unless')
1208             . ' ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and '
1209             . ($check->{itempos}? 'do {'.XML::XSH2::Parser::_Runtime::Production::incitempos().' 1} and ' : '')
1210             . ' $text =~ m/\A' . quotemeta($self->{"pattern"}) . '/)
1211             {
1212             '.($self->{"lookahead"} ? '$text = $_savetext;' : '$text = $lastsep . $text if defined $lastsep;').'
1213             '. ($check->{itempos} ? XML::XSH2::Parser::_Runtime::Production::unincitempos() : '') . '
1214             $expectation->failed();
1215             XML::XSH2::Parser::_Runtime::_trace(qq{<>},
1216             XML::XSH2::Parser::_Runtime::_tracefirst($text))
1217             if defined $::RD_TRACE;
1218             last;
1219             }
1220             $current_match = substr($text, $-[0], $+[0] - $-[0]);
1221             substr($text,0,length($current_match),q{});
1222             XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
1223             . $current_match . q{])},
1224             XML::XSH2::Parser::_Runtime::_tracefirst($text))
1225             if defined $::RD_TRACE;
1226             push @item, $item{'.$self->{hashname}.'}=$current_match;
1227 0 0       0 ' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .'
    0          
    0          
    0          
    0          
    0          
    0          
1228             ';
1229              
1230 0         0 return $code;
1231             }
1232              
1233             1;
1234              
1235             package # this should not be indexed by CPAN
1236             XML::XSH2::Parser::_Runtime::InterpLit;
1237              
1238 0     0   0 sub sethashname { $_[0]->{hashname} = '__STRING' . ++$_[1]->{strcount} . '__'; }
1239              
1240 0     0   0 sub issubrule { undef }
1241 0     0   0 sub isterminal { 1 }
1242 0     0   0 sub describe ($) { shift->{'description'} }
1243              
1244             sub new ($$$$)
1245             {
1246 0   0 0   0 my $class = ref($_[0]) || $_[0];
1247              
1248 0         0 my $pattern = $_[1];
1249 0         0 $pattern =~ s#/#\\/#g;
1250              
1251 0         0 my $desc = $pattern;
1252 0         0 $desc=~s/\\/\\\\/g;
1253 0         0 $desc=~s/}/\\}/g;
1254 0         0 $desc=~s/{/\\{/g;
1255              
1256 0         0 bless
1257             {
1258             "pattern" => $pattern,
1259             "lookahead" => $_[2],
1260             "line" => $_[3],
1261             "description" => "'$desc'",
1262             }, $class;
1263             }
1264              
1265             sub code($$$$)
1266             {
1267 0     0   0 my ($self, $namespace, $rule, $check) = @_;
1268              
1269             my $code = '
1270             XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [' . $self->describe
1271             . ']},
1272             XML::XSH2::Parser::_Runtime::_tracefirst($text),
1273             q{' . $rule->{name} . '},
1274             $tracelevel)
1275             if defined $::RD_TRACE;
1276             undef $lastsep;
1277             $expectation->is(q{' . ($rule->hasleftmost($self) ? ''
1278             : $self->describe ) . '})->at($text);
1279             ' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) . '
1280              
1281             ' . ($self->{"lookahead"}<0?'if':'unless')
1282             . ' ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and '
1283             . ($check->{itempos}? 'do {'.XML::XSH2::Parser::_Runtime::Production::incitempos().' 1} and ' : '')
1284             . ' do { $_tok = "' . $self->{"pattern"} . '"; 1 } and
1285             substr($text,0,length($_tok)) eq $_tok and
1286             do { substr($text,0,length($_tok)) = ""; 1; }
1287             )
1288             {
1289             '.($self->{"lookahead"} ? '$text = $_savetext;' : '$text = $lastsep . $text if defined $lastsep;').'
1290             '. ($check->{itempos} ? XML::XSH2::Parser::_Runtime::Production::unincitempos() : '') . '
1291             $expectation->failed();
1292             XML::XSH2::Parser::_Runtime::_trace(q{<>},
1293             XML::XSH2::Parser::_Runtime::_tracefirst($text))
1294             if defined $::RD_TRACE;
1295             last;
1296             }
1297             XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
1298             . $_tok . q{])},
1299             XML::XSH2::Parser::_Runtime::_tracefirst($text))
1300             if defined $::RD_TRACE;
1301             push @item, $item{'.$self->{hashname}.'}=$_tok;
1302 0 0       0 ' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .'
    0          
    0          
    0          
    0          
    0          
    0          
1303             ';
1304              
1305 0         0 return $code;
1306             }
1307              
1308             1;
1309              
1310             package # this should not be indexed by CPAN
1311             XML::XSH2::Parser::_Runtime::Subrule;
1312              
1313 0     0   0 sub issubrule ($) { return $_[0]->{"subrule"} }
1314 0     0   0 sub isterminal { 0 }
1315       0     sub sethashname {}
1316              
1317             sub describe ($)
1318             {
1319 0   0 0   0 my $desc = $_[0]->{"implicit"} || $_[0]->{"subrule"};
1320 0 0       0 $desc = "" if $_[0]->{"matchrule"};
1321 0         0 return $desc;
1322             }
1323              
1324             sub callsyntax($$)
1325             {
1326 0 0   0   0 if ($_[0]->{"matchrule"})
1327             {
1328 0         0 return "&{'$_[1]'.qq{$_[0]->{subrule}}}";
1329             }
1330             else
1331             {
1332 0         0 return $_[1].$_[0]->{"subrule"};
1333             }
1334             }
1335              
1336             sub new ($$$$;$$$)
1337             {
1338 0   0 0   0 my $class = ref($_[0]) || $_[0];
1339 0   0     0 bless
      0        
1340             {
1341             "subrule" => $_[1],
1342             "lookahead" => $_[2],
1343             "line" => $_[3],
1344             "implicit" => $_[4] || undef,
1345             "matchrule" => $_[5],
1346             "argcode" => $_[6] || undef,
1347             }, $class;
1348             }
1349              
1350              
1351             sub code($$$$)
1352             {
1353 0     0   0 my ($self, $namespace, $rule, $check) = @_;
1354              
1355             '
1356             XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [' . $self->{"subrule"} . ']},
1357             XML::XSH2::Parser::_Runtime::_tracefirst($text),
1358             q{' . $rule->{"name"} . '},
1359             $tracelevel)
1360             if defined $::RD_TRACE;
1361             if (1) { no strict qw{refs};
1362             $expectation->is(' . ($rule->hasleftmost($self) ? 'q{}'
1363             # WAS : 'qq{'.$self->describe.'}' ) . ')->at($text);
1364             : 'q{'.$self->describe.'}' ) . ')->at($text);
1365             ' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' )
1366             . ($self->{"lookahead"}<0?'if':'unless')
1367             . ' (defined ($_tok = '
1368             . $self->callsyntax($namespace.'::')
1369             . '($thisparser,$text,$repeating,'
1370             . ($self->{"lookahead"}?'1':'$_noactions')
1371             . ($self->{argcode} ? ",sub { return $self->{argcode} }"
1372             : ',sub { \\@arg }')
1373             . ($check->{"itempos"}?',$itempos[$#itempos]':',undef')
1374             . ')))
1375             {
1376             '.($self->{"lookahead"} ? '$text = $_savetext;' : '').'
1377             XML::XSH2::Parser::_Runtime::_trace(q{<<'.XML::XSH2::Parser::_Runtime::_matchtracemessage($self,1).' subrule: ['
1378             . $self->{subrule} . ']>>},
1379             XML::XSH2::Parser::_Runtime::_tracefirst($text),
1380             q{' . $rule->{"name"} .'},
1381             $tracelevel)
1382             if defined $::RD_TRACE;
1383             $expectation->failed();
1384             last;
1385             }
1386             XML::XSH2::Parser::_Runtime::_trace(q{>>'.XML::XSH2::Parser::_Runtime::_matchtracemessage($self).' subrule: ['
1387             . $self->{subrule} . ']<< (return value: [}
1388             . $_tok . q{]},
1389              
1390             XML::XSH2::Parser::_Runtime::_tracefirst($text),
1391             q{' . $rule->{"name"} .'},
1392             $tracelevel)
1393             if defined $::RD_TRACE;
1394             $item{q{' . $self->{subrule} . '}} = $_tok;
1395             push @item, $_tok;
1396 0 0       0 ' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .'
    0          
    0          
    0          
    0          
    0          
    0          
    0          
1397             }
1398             '
1399             }
1400              
1401             package # this should not be indexed by CPAN
1402             XML::XSH2::Parser::_Runtime::Repetition;
1403              
1404 0     0   0 sub issubrule ($) { return $_[0]->{"subrule"} }
1405 0     0   0 sub isterminal { 0 }
1406       0     sub sethashname { }
1407              
1408             sub describe ($)
1409             {
1410 0   0 0   0 my $desc = $_[0]->{"expected"} || $_[0]->{"subrule"};
1411 0 0       0 $desc = "" if $_[0]->{"matchrule"};
1412 0         0 return $desc;
1413             }
1414              
1415             sub callsyntax($$)
1416             {
1417 0 0   0   0 if ($_[0]->{matchrule})
1418 0         0 { return "sub { goto &{''.qq{$_[1]$_[0]->{subrule}}} }"; }
1419             else
1420 0         0 { return "\\&$_[1]$_[0]->{subrule}"; }
1421             }
1422              
1423             sub new ($$$$$$$$$$)
1424             {
1425 0     0   0 my ($self, $subrule, $repspec, $min, $max, $lookahead, $line, $parser, $matchrule, $argcode) = @_;
1426 0   0     0 my $class = ref($self) || $self;
1427 0 0       0 ($max, $min) = ( $min, $max) if ($max<$min);
1428              
1429 0         0 my $desc;
1430 0 0       0 if ($subrule=~/\A_alternation_\d+_of_production_\d+_of_rule/)
1431 0         0 { $desc = $parser->{"rules"}{$subrule}->expected }
1432              
1433 0 0       0 if ($lookahead)
1434             {
1435 0 0       0 if ($min>0)
1436             {
1437 0         0 return new XML::XSH2::Parser::_Runtime::Subrule($subrule,$lookahead,$line,$desc,$matchrule,$argcode);
1438             }
1439             else
1440             {
1441 0         0 XML::XSH2::Parser::_Runtime::_error("Not symbol (\"!\") before
1442             \"$subrule\" doesn't make
1443             sense.",$line);
1444 0         0 XML::XSH2::Parser::_Runtime::_hint("Lookahead for negated optional
1445             repetitions (such as
1446             \"!$subrule($repspec)\" can never
1447             succeed, since optional items always
1448             match (zero times at worst).
1449             Did you mean a single \"!$subrule\",
1450             instead?");
1451             }
1452             }
1453             bless
1454             {
1455 0   0     0 "subrule" => $subrule,
1456             "repspec" => $repspec,
1457             "min" => $min,
1458             "max" => $max,
1459             "lookahead" => $lookahead,
1460             "line" => $line,
1461             "expected" => $desc,
1462             "argcode" => $argcode || undef,
1463             "matchrule" => $matchrule,
1464             }, $class;
1465             }
1466              
1467             sub code($$$$)
1468             {
1469 0     0   0 my ($self, $namespace, $rule, $check) = @_;
1470              
1471             my ($subrule, $repspec, $min, $max, $lookahead) =
1472 0         0 @{$self}{ qw{subrule repspec min max lookahead} };
  0         0  
1473              
1474             '
1475             XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [' . $self->describe . ']},
1476             XML::XSH2::Parser::_Runtime::_tracefirst($text),
1477             q{' . $rule->{"name"} . '},
1478             $tracelevel)
1479             if defined $::RD_TRACE;
1480             $expectation->is(' . ($rule->hasleftmost($self) ? 'q{}'
1481             # WAS : 'qq{'.$self->describe.'}' ) . ')->at($text);
1482             : 'q{'.$self->describe.'}' ) . ')->at($text);
1483             ' . ($self->{"lookahead"} ? '$_savetext = $text;' : '' ) .'
1484             unless (defined ($_tok = $thisparser->_parserepeat($text, '
1485             . $self->callsyntax($namespace.'::')
1486             . ', ' . $min . ', ' . $max . ', '
1487             . ($self->{"lookahead"}?'1':'$_noactions')
1488             . ',$expectation,'
1489             . ($self->{argcode} ? "sub { return $self->{argcode} }"
1490             : 'sub { \\@arg }')
1491             . ($check->{"itempos"}?',$itempos[$#itempos]':',undef')
1492             . ')))
1493             {
1494             XML::XSH2::Parser::_Runtime::_trace(q{<<'.XML::XSH2::Parser::_Runtime::_matchtracemessage($self,1).' repeated subrule: ['
1495             . $self->describe . ']>>},
1496             XML::XSH2::Parser::_Runtime::_tracefirst($text),
1497             q{' . $rule->{"name"} .'},
1498             $tracelevel)
1499             if defined $::RD_TRACE;
1500             last;
1501             }
1502             XML::XSH2::Parser::_Runtime::_trace(q{>>'.XML::XSH2::Parser::_Runtime::_matchtracemessage($self).' repeated subrule: ['
1503             . $self->{subrule} . ']<< (}
1504             . @$_tok . q{ times)},
1505              
1506             XML::XSH2::Parser::_Runtime::_tracefirst($text),
1507             q{' . $rule->{"name"} .'},
1508             $tracelevel)
1509             if defined $::RD_TRACE;
1510             $item{q{' . "$self->{subrule}($self->{repspec})" . '}} = $_tok;
1511             push @item, $_tok;
1512 0 0       0 ' . ($self->{"lookahead"} ? '$text = $_savetext;' : '' ) .'
    0          
    0          
    0          
    0          
    0          
1513              
1514             '
1515             }
1516              
1517             package # this should not be indexed by CPAN
1518             XML::XSH2::Parser::_Runtime::Result;
1519              
1520 0     0   0 sub issubrule { 0 }
1521 0     0   0 sub isterminal { 0 }
1522 0     0   0 sub describe { '' }
1523              
1524             sub new
1525             {
1526 0     0   0 my ($class, $pos) = @_;
1527              
1528 0         0 bless {}, $class;
1529             }
1530              
1531             sub code($$$$)
1532             {
1533 0     0   0 my ($self, $namespace, $rule) = @_;
1534              
1535 0         0 '
1536             $return = $item[-1];
1537             ';
1538             }
1539              
1540             package # this should not be indexed by CPAN
1541             XML::XSH2::Parser::_Runtime::Operator;
1542              
1543             my @opertype = ( " non-optional", "n optional" );
1544              
1545 0     0   0 sub issubrule { 0 }
1546 0     0   0 sub isterminal { 0 }
1547              
1548 0     0   0 sub describe { $_[0]->{"expected"} }
1549 0     0   0 sub sethashname { $_[0]->{hashname} = '__DIRECTIVE' . ++$_[1]->{dircount} . '__'; }
1550              
1551              
1552             sub new
1553             {
1554 0     0   0 my ($class, $type, $minrep, $maxrep, $leftarg, $op, $rightarg) = @_;
1555              
1556 0         0 bless
1557             {
1558             "type" => "${type}op",
1559             "leftarg" => $leftarg,
1560             "op" => $op,
1561             "min" => $minrep,
1562             "max" => $maxrep,
1563             "rightarg" => $rightarg,
1564             "expected" => "<${type}op: ".$leftarg->describe." ".$op->describe." ".$rightarg->describe.">",
1565             }, $class;
1566             }
1567              
1568             sub code($$$$)
1569             {
1570 0     0   0 my ($self, $namespace, $rule, $check) = @_;
1571              
1572 0         0 my @codeargs = @_[1..$#_];
1573              
1574             my ($leftarg, $op, $rightarg) =
1575 0         0 @{$self}{ qw{leftarg op rightarg} };
  0         0  
1576              
1577             my $code = '
1578             XML::XSH2::Parser::_Runtime::_trace(q{Trying operator: [' . $self->describe . ']},
1579             XML::XSH2::Parser::_Runtime::_tracefirst($text),
1580 0 0       0 q{' . $rule->{"name"} . '},
1581             $tracelevel)
1582             if defined $::RD_TRACE;
1583             $expectation->is(' . ($rule->hasleftmost($self) ? 'q{}'
1584             # WAS : 'qq{'.$self->describe.'}' ) . ')->at($text);
1585             : 'q{'.$self->describe.'}' ) . ')->at($text);
1586              
1587             $_tok = undef;
1588             OPLOOP: while (1)
1589             {
1590             $repcount = 0;
1591             my @item;
1592             my %item;
1593             ';
1594              
1595             $code .= '
1596             my $_itempos = $itempos[-1];
1597             my $itemposfirst;
1598 0 0       0 ' if $check->{itempos};
1599              
1600 0 0       0 if ($self->{type} eq "leftop" )
1601             {
1602 0         0 $code .= '
1603             # MATCH LEFTARG
1604             ' . $leftarg->code(@codeargs) . '
1605              
1606             ';
1607              
1608             $code .= '
1609             if (defined($_itempos) and !defined($itemposfirst))
1610             {
1611             $itemposfirst = XML::XSH2::Parser::_Runtime::Production::_duplicate_itempos($_itempos);
1612             }
1613 0 0       0 ' if $check->{itempos};
1614              
1615             $code .= '
1616             $repcount++;
1617              
1618             my $savetext = $text;
1619             my $backtrack;
1620              
1621             # MATCH (OP RIGHTARG)(s)
1622             while ($repcount < ' . $self->{max} . ')
1623             {
1624             $backtrack = 0;
1625             ' . $op->code(@codeargs) . '
1626             ' . ($op->isterminal() ? 'pop @item;' : '$backtrack=1;' ) . '
1627             ' . (ref($op) eq 'XML::XSH2::Parser::_Runtime::Token'
1628 0 0 0     0 ? 'if (defined $1) {push @item, $item{'.($self->{name}||$self->{hashname}).'}=$1; $backtrack=1;}'
    0          
1629             : "" ) . '
1630             ' . $rightarg->code(@codeargs) . '
1631             $savetext = $text;
1632             $repcount++;
1633             }
1634             $text = $savetext;
1635             pop @item if $backtrack;
1636              
1637             ';
1638             }
1639             else
1640             {
1641             $code .= '
1642             my $savetext = $text;
1643             my $backtrack;
1644             # MATCH (LEFTARG OP)(s)
1645 0         0 while ($repcount < ' . $self->{max} . ')
1646             {
1647             $backtrack = 0;
1648             ' . $leftarg->code(@codeargs) . '
1649             ';
1650             $code .= '
1651             if (defined($_itempos) and !defined($itemposfirst))
1652             {
1653             $itemposfirst = XML::XSH2::Parser::_Runtime::Production::_duplicate_itempos($_itempos);
1654             }
1655 0 0       0 ' if $check->{itempos};
1656              
1657             $code .= '
1658             $repcount++;
1659             $backtrack = 1;
1660             ' . $op->code(@codeargs) . '
1661             $savetext = $text;
1662             ' . ($op->isterminal() ? 'pop @item;' : "" ) . '
1663 0 0 0     0 ' . (ref($op) eq 'XML::XSH2::Parser::_Runtime::Token' ? 'do { push @item, $item{'.($self->{name}||$self->{hashname}).'}=$1; } if defined $1;' : "" ) . '
    0          
1664             }
1665             $text = $savetext;
1666             pop @item if $backtrack;
1667              
1668             # MATCH RIGHTARG
1669             ' . $rightarg->code(@codeargs) . '
1670             $repcount++;
1671             ';
1672             }
1673              
1674 0 0       0 $code .= 'unless (@item) { undef $_tok; last }' unless $self->{min}==0;
1675              
1676 0         0 $code .= '
1677             $_tok = [ @item ];
1678             ';
1679              
1680              
1681             $code .= '
1682             if (defined $itemposfirst)
1683             {
1684             XML::XSH2::Parser::_Runtime::Production::_update_itempos(
1685             $_itempos, $itemposfirst, undef, [qw(from)]);
1686             }
1687 0 0       0 ' if $check->{itempos};
1688              
1689 0         0 $code .= '
1690             last;
1691             } # end of OPLOOP
1692             ';
1693              
1694             $code .= '
1695             unless ($repcount>='.$self->{min}.')
1696             {
1697             XML::XSH2::Parser::_Runtime::_trace(q{<<'.XML::XSH2::Parser::_Runtime::_matchtracemessage($self,1).' operator: ['
1698             . $self->describe
1699             . ']>>},
1700             XML::XSH2::Parser::_Runtime::_tracefirst($text),
1701             q{' . $rule->{"name"} .'},
1702             $tracelevel)
1703             if defined $::RD_TRACE;
1704             $expectation->failed();
1705             last;
1706             }
1707             XML::XSH2::Parser::_Runtime::_trace(q{>>'.XML::XSH2::Parser::_Runtime::_matchtracemessage($self).' operator: ['
1708             . $self->describe
1709             . ']<< (return value: [}
1710             . qq{@{$_tok||[]}} . q{]},
1711             XML::XSH2::Parser::_Runtime::_tracefirst($text),
1712             q{' . $rule->{"name"} .'},
1713             $tracelevel)
1714             if defined $::RD_TRACE;
1715              
1716 0   0     0 push @item, $item{'.($self->{name}||$self->{hashname}).'}=$_tok||[];
1717             ';
1718              
1719 0         0 return $code;
1720             }
1721              
1722              
1723             package # this should not be indexed by CPAN
1724             XML::XSH2::Parser::_Runtime::Expectation;
1725              
1726             sub new ($)
1727             {
1728 31925     31925   122767 bless {
1729             "failed" => 0,
1730             "expected" => "",
1731             "unexpected" => "",
1732             "lastexpected" => "",
1733             "lastunexpected" => "",
1734             "defexpected" => $_[1],
1735             };
1736             }
1737              
1738             sub is ($$)
1739             {
1740 72858     72858   115430 $_[0]->{lastexpected} = $_[1]; return $_[0];
  72858         162922  
1741             }
1742              
1743             sub at ($$)
1744             {
1745 113475     113475   174604 $_[0]->{lastunexpected} = $_[1]; return $_[0];
  113475         137723  
1746             }
1747              
1748             sub failed ($)
1749             {
1750 40669 100   40669   85173 return unless $_[0]->{lastexpected};
1751 460 50       1234 $_[0]->{expected} = $_[0]->{lastexpected} unless $_[0]->{failed};
1752 460 50       1198 $_[0]->{unexpected} = $_[0]->{lastunexpected} unless $_[0]->{failed};
1753 460         745 $_[0]->{failed} = 1;
1754             }
1755              
1756             sub message ($)
1757             {
1758 0     0   0 my ($self) = @_;
1759 0 0       0 $self->{expected} = $self->{defexpected} unless $self->{expected};
1760 0         0 $self->{expected} =~ s/_/ /g;
1761 0 0 0     0 if (!$self->{unexpected} || $self->{unexpected} =~ /\A\s*\Z/s)
1762             {
1763 0         0 return "Was expecting $self->{expected}";
1764             }
1765             else
1766             {
1767 0         0 $self->{unexpected} =~ /\s*(.*)/;
1768 0         0 return "Was expecting $self->{expected} but found \"$1\" instead";
1769             }
1770             }
1771              
1772             1;
1773              
1774             package # this should not be indexed by CPAN
1775             XML::XSH2::Parser::_Runtime;
1776              
1777 8     8   116 use Carp;
  8         27  
  8         654  
1778 8     8   53 use vars qw ( $AUTOLOAD $VERSION $_FILENAME);
  8         19  
  8         3856  
1779              
1780             my $ERRORS = 0;
1781              
1782             our $VERSION = # Hide from PAUSE
1783             '1.967015';
1784             $VERSION = eval $VERSION;
1785             $_FILENAME=__FILE__;
1786              
1787             # BUILDING A PARSER
1788              
1789             my $nextnamespace = "namespace000001";
1790              
1791             sub _nextnamespace()
1792             {
1793 0     0   0 return "XML::XSH2::Parser::_Runtime::" . $nextnamespace++;
1794             }
1795              
1796             # ARGS ARE: $class, $grammar, $compiling, $namespace
1797             sub new ($$$$)
1798             {
1799 0   0 0   0 my $class = ref($_[0]) || $_[0];
1800 0         0 local $XML::XSH2::Parser::_Runtime::compiling = $_[2];
1801 0 0       0 my $name_space_name = defined $_[3]
1802             ? "XML::XSH2::Parser::_Runtime::".$_[3]
1803             : _nextnamespace();
1804 0         0 my $self =
1805             {
1806             "rules" => {},
1807             "namespace" => $name_space_name,
1808             "startcode" => '',
1809             "localvars" => '',
1810             "_AUTOACTION" => undef,
1811             "_AUTOTREE" => undef,
1812              
1813             # Precompiled parsers used to set _precompiled, but that
1814             # wasn't present in some versions of XML::XSH2::Parser::_Runtime used to
1815             # build precompiled parsers. Instead, set a new
1816             # _not_precompiled flag, which is remove from future
1817             # Precompiled parsers at build time.
1818             "_not_precompiled" => 1,
1819             };
1820              
1821              
1822 0 0       0 if ($::RD_AUTOACTION) {
1823 0         0 my $sourcecode = $::RD_AUTOACTION;
1824 0 0       0 $sourcecode = "{ $sourcecode }"
1825             unless $sourcecode =~ /\A\s*\{.*\}\s*\Z/;
1826             $self->{_check}{itempos} =
1827 0         0 $sourcecode =~ /\@itempos\b|\$itempos\s*\[/;
1828             $self->{_AUTOACTION}
1829 0         0 = new XML::XSH2::Parser::_Runtime::Action($sourcecode,0,-1)
1830             }
1831              
1832 0         0 bless $self, $class;
1833 0         0 return $self->Replace($_[1])
1834             }
1835              
1836             sub Compile($$$$) {
1837 0     0   0 die "Compilation of XML::XSH2::Parser::_Runtime grammars not yet implemented\n";
1838             }
1839              
1840             sub DESTROY {
1841 0     0   0 my ($self) = @_;
1842 0         0 my $namespace = $self->{namespace};
1843 0         0 $namespace =~ s/XML::XSH2::Parser::_Runtime:://;
1844 0 0       0 if ($self->{_not_precompiled}) {
1845             # BEGIN WORKAROUND
1846             # Perl has a bug that creates a circular reference between
1847             # @ISA and that variable's stash:
1848             # https://rt.perl.org/rt3/Ticket/Display.html?id=92708
1849             # Emptying the array before deleting the stash seems to
1850             # prevent the leak. Once the ticket above has been resolved,
1851             # these two lines can be removed.
1852 8     8   70 no strict 'refs';
  8         16  
  8         77524  
1853 0         0 @{$self->{namespace} . '::ISA'} = ();
  0         0  
1854             # END WORKAROUND
1855              
1856             # Some grammars may contain circular references between rules,
1857             # such as:
1858             # a: 'ID' | b
1859             # b: '(' a ')'
1860             # Unless these references are broken, the subs stay around on
1861             # stash deletion below. Iterate through the stash entries and
1862             # for each defined code reference, set it to reference sub {}
1863             # instead.
1864             {
1865 0         0 local $^W; # avoid 'sub redefined' warnings.
  0         0  
1866 0     0   0 my $blank_sub = sub {};
1867 0         0 while (my ($name, $glob) = each %{"XML::XSH2::Parser::_Runtime::$namespace\::"}) {
  0         0  
1868 0 0       0 *$glob = $blank_sub if defined &$glob;
1869             }
1870             }
1871              
1872             # Delete the namespace's stash
1873 0         0 delete $XML::XSH2::Parser::_Runtime::{$namespace.'::'};
1874             }
1875             }
1876              
1877             # BUILDING A GRAMMAR....
1878              
1879             # ARGS ARE: $self, $grammar, $isimplicit, $isleftop
1880             sub Replace ($$)
1881             {
1882             # set $replace = 1 for _generate
1883 0     0   0 splice(@_, 2, 0, 1);
1884              
1885 0         0 return _generate(@_);
1886             }
1887              
1888             # ARGS ARE: $self, $grammar, $isimplicit, $isleftop
1889             sub Extend ($$)
1890             {
1891             # set $replace = 0 for _generate
1892 0     0   0 splice(@_, 2, 0, 0);
1893              
1894 0         0 return _generate(@_);
1895             }
1896              
1897             sub _no_rule ($$;$)
1898             {
1899 0     0   0 _error("Ruleless $_[0] at start of grammar.",$_[1]);
1900 0 0       0 my $desc = $_[2] ? "\"$_[2]\"" : "";
1901 0         0 _hint("You need to define a rule for the $_[0] $desc
1902             to be part of.");
1903             }
1904              
1905             my $NEGLOOKAHEAD = '\G(\s*\.\.\.\!)';
1906             my $POSLOOKAHEAD = '\G(\s*\.\.\.)';
1907             my $RULE = '\G\s*(\w+)[ \t]*:';
1908             my $PROD = '\G\s*([|])';
1909             my $TOKEN = q{\G\s*/((\\\\/|\\\\\\\\|[^/])*)/([cgimsox]*)};
1910             my $MTOKEN = q{\G\s*(m\s*[^\w\s])};
1911             my $LITERAL = q{\G\s*'((\\\\['\\\\]|[^'])*)'};
1912             my $INTERPLIT = q{\G\s*"((\\\\["\\\\]|[^"])*)"};
1913             my $SUBRULE = '\G\s*(\w+)';
1914             my $MATCHRULE = '\G(\s*
1915             my $SIMPLEPAT = '((\\s+/[^/\\\\]*(?:\\\\.[^/\\\\]*)*/)?)';
1916             my $OPTIONAL = '\G\((\?)'.$SIMPLEPAT.'\)';
1917             my $ANY = '\G\((s\?)'.$SIMPLEPAT.'\)';
1918             my $MANY = '\G\((s|\.\.)'.$SIMPLEPAT.'\)';
1919             my $EXACTLY = '\G\(([1-9]\d*)'.$SIMPLEPAT.'\)';
1920             my $BETWEEN = '\G\((\d+)\.\.([1-9]\d*)'.$SIMPLEPAT.'\)';
1921             my $ATLEAST = '\G\((\d+)\.\.'.$SIMPLEPAT.'\)';
1922             my $ATMOST = '\G\(\.\.([1-9]\d*)'.$SIMPLEPAT.'\)';
1923             my $BADREP = '\G\((-?\d+)?\.\.(-?\d+)?'.$SIMPLEPAT.'\)';
1924             my $ACTION = '\G\s*\{';
1925             my $IMPLICITSUBRULE = '\G\s*\(';
1926             my $COMMENT = '\G\s*(#.*)';
1927             my $COMMITMK = '\G\s*';
1928             my $UNCOMMITMK = '\G\s*';
1929             my $QUOTELIKEMK = '\G\s*';
1930             my $CODEBLOCKMK = '\G\s*{}]+))?>';
1931             my $VARIABLEMK = '\G\s*';
1932             my $NOCHECKMK = '\G\s*';
1933             my $AUTOACTIONPATMK = '\G\s*
1934             my $AUTOTREEMK = '\G\s*';
1935             my $AUTOSTUBMK = '\G\s*';
1936             my $AUTORULEMK = '\G\s*';
1937             my $REJECTMK = '\G\s*';
1938             my $CONDREJECTMK = '\G\s*
1939             my $SCOREMK = '\G\s*
1940             my $AUTOSCOREMK = '\G\s*
1941             my $SKIPMK = '\G\s*
1942             my $OPMK = '\G\s*<(left|right)op(?:=(\'.*?\'))?:';
1943             my $ENDDIRECTIVEMK = '\G\s*>';
1944             my $RESYNCMK = '\G\s*';
1945             my $RESYNCPATMK = '\G\s*
1946             my $RULEVARPATMK = '\G\s*
1947             my $DEFERPATMK = '\G\s*
1948             my $TOKENPATMK = '\G\s*
1949             my $AUTOERRORMK = '\G\s*';
1950             my $MSGERRORMK = '\G\s*
1951             my $NOCHECK = '\G\s*';
1952             my $WARNMK = '\G\s*';
1953             my $HINTMK = '\G\s*';
1954             my $TRACEBUILDMK = '\G\s*';
1955             my $TRACEPARSEMK = '\G\s*';
1956             my $UNCOMMITPROD = $PROD.'\s*
1957             my $ERRORPROD = $PROD.'\s*
1958             my $LONECOLON = '\G\s*:';
1959             my $OTHER = '\G\s*([^\s]+)';
1960              
1961             my @lines = 0;
1962              
1963             sub _generate
1964             {
1965 0     0   0 my ($self, $grammar, $replace, $isimplicit, $isleftop) = (@_, 0);
1966              
1967 0         0 my $aftererror = 0;
1968 0         0 my $lookahead = 0;
1969 0         0 my $lookaheadspec = "";
1970 0         0 my $must_pop_lines;
1971 0 0       0 if (! $lines[-1]) {
1972 0         0 push @lines, _linecount($grammar) ;
1973 0         0 $must_pop_lines = 1;
1974             }
1975             $self->{_check}{itempos} = ($grammar =~ /\@itempos\b|\$itempos\s*\[/)
1976 0 0       0 unless $self->{_check}{itempos};
1977 0         0 for (qw(thisoffset thiscolumn prevline prevoffset prevcolumn))
1978             {
1979             $self->{_check}{$_} =
1980             ($grammar =~ /\$$_/) || $self->{_check}{itempos}
1981 0 0 0     0 unless $self->{_check}{$_};
1982             }
1983 0         0 my $line;
1984              
1985 0         0 my $rule = undef;
1986 0         0 my $prod = undef;
1987 0         0 my $item = undef;
1988 0         0 my $lastgreedy = '';
1989 0         0 pos $grammar = 0;
1990 0         0 study $grammar;
1991              
1992 0         0 local $::RD_HINT = $::RD_HINT;
1993 0         0 local $::RD_WARN = $::RD_WARN;
1994 0         0 local $::RD_TRACE = $::RD_TRACE;
1995 0         0 local $::RD_CHECK = $::RD_CHECK;
1996              
1997 0         0 while (pos $grammar < length $grammar)
1998             {
1999 0         0 $line = $lines[-1] - _linecount($grammar) + 1;
2000 0         0 my $commitonly;
2001 0         0 my $code = "";
2002 0         0 my @components = ();
2003 0 0 0     0 if ($grammar =~ m/$COMMENT/gco)
    0 0        
    0 0        
    0 0        
    0 0        
    0 0        
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
2004             {
2005 0         0 _parse("a comment",0,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2006 0         0 next;
2007             }
2008             elsif ($grammar =~ m/$NEGLOOKAHEAD/gco)
2009             {
2010 0         0 _parse("a negative lookahead",$aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2011 0 0       0 $lookahead = $lookahead ? -$lookahead : -1;
2012 0         0 $lookaheadspec .= $1;
2013 0         0 next; # SKIP LOOKAHEAD RESET AT END OF while LOOP
2014             }
2015             elsif ($grammar =~ m/$POSLOOKAHEAD/gco)
2016             {
2017 0         0 _parse("a positive lookahead",$aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2018 0 0       0 $lookahead = $lookahead ? $lookahead : 1;
2019 0         0 $lookaheadspec .= $1;
2020 0         0 next; # SKIP LOOKAHEAD RESET AT END OF while LOOP
2021             }
2022             elsif ($grammar =~ m/(?=$ACTION)/gco
2023 0         0 and do { ($code) = extract_codeblock($grammar); $code })
  0         0  
2024             {
2025 0         0 _parse("an action", $aftererror, $line, $code);
2026 0         0 $item = new XML::XSH2::Parser::_Runtime::Action($code,$lookahead,$line);
2027 0 0 0     0 $prod and $prod->additem($item)
2028             or $self->_addstartcode($code);
2029             }
2030             elsif ($grammar =~ m/(?=$IMPLICITSUBRULE)/gco
2031 0         0 and do { ($code) = extract_codeblock($grammar,'{([',undef,'(',1);
2032 0         0 $code })
2033             {
2034 0         0 $code =~ s/\A\s*\(|\)\Z//g;
2035 0         0 _parse("an implicit subrule", $aftererror, $line,
2036             "( $code )");
2037 0         0 my $implicit = $rule->nextimplicit;
2038             return undef
2039 0 0       0 if !$self->_generate("$implicit : $code",$replace,1);
2040 0         0 my $pos = pos $grammar;
2041 0         0 substr($grammar,$pos,0,$implicit);
2042 0         0 pos $grammar = $pos;;
2043             }
2044             elsif ($grammar =~ m/$ENDDIRECTIVEMK/gco)
2045             {
2046              
2047             # EXTRACT TRAILING REPETITION SPECIFIER (IF ANY)
2048              
2049 0         0 my ($minrep,$maxrep) = (1,$MAXREP);
2050 0 0       0 if ($grammar =~ m/\G[(]/gc)
2051             {
2052 0         0 pos($grammar)--;
2053              
2054 0 0       0 if ($grammar =~ m/$OPTIONAL/gco)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
2055 0         0 { ($minrep, $maxrep) = (0,1) }
2056             elsif ($grammar =~ m/$ANY/gco)
2057 0         0 { $minrep = 0 }
2058             elsif ($grammar =~ m/$EXACTLY/gco)
2059 0         0 { ($minrep, $maxrep) = ($1,$1) }
2060             elsif ($grammar =~ m/$BETWEEN/gco)
2061 0         0 { ($minrep, $maxrep) = ($1,$2) }
2062             elsif ($grammar =~ m/$ATLEAST/gco)
2063 0         0 { $minrep = $1 }
2064             elsif ($grammar =~ m/$ATMOST/gco)
2065 0         0 { $maxrep = $1 }
2066             elsif ($grammar =~ m/$MANY/gco)
2067             { }
2068             elsif ($grammar =~ m/$BADREP/gco)
2069             {
2070 0         0 _parse("an invalid repetition specifier", 0,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2071 0         0 _error("Incorrect specification of a repeated directive",
2072             $line);
2073 0         0 _hint("Repeated directives cannot have
2074             a maximum repetition of zero, nor can they have
2075             negative components in their ranges.");
2076             }
2077             }
2078              
2079 0 0       0 $prod && $prod->enddirective($line,$minrep,$maxrep);
2080             }
2081             elsif ($grammar =~ m/\G\s*<[^m]/gc)
2082             {
2083 0         0 pos($grammar)-=2;
2084              
2085 0 0 0     0 if ($grammar =~ m/$OPMK/gco)
    0 0        
    0 0        
    0 0        
    0 0        
    0 0        
    0 0        
    0 0        
    0 0        
    0 0        
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
2086             {
2087             # $DB::single=1;
2088 0         0 _parse("a $1-associative operator directive", $aftererror, $line, "<$1op:...>");
2089 0   0     0 $prod->adddirective($1, $line,$2||'');
2090             }
2091             elsif ($grammar =~ m/$UNCOMMITMK/gco)
2092             {
2093 0         0 _parse("an uncommit marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2094 0         0 $item = new XML::XSH2::Parser::_Runtime::Directive('$commit=0;1',
2095             $lookahead,$line,"");
2096 0 0 0     0 $prod and $prod->additem($item)
2097             or _no_rule("",$line);
2098             }
2099             elsif ($grammar =~ m/$QUOTELIKEMK/gco)
2100             {
2101 0         0 _parse("an perl quotelike marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2102 0         0 $item = new XML::XSH2::Parser::_Runtime::Directive(
2103             'my ($match,@res);
2104             ($match,$text,undef,@res) =
2105             Text::Balanced::extract_quotelike($text,$skip);
2106             $match ? \@res : undef;
2107             ', $lookahead,$line,"");
2108 0 0 0     0 $prod and $prod->additem($item)
2109             or _no_rule("",$line);
2110             }
2111             elsif ($grammar =~ m/$CODEBLOCKMK/gco)
2112             {
2113 0   0     0 my $outer = $1||"{}";
2114 0         0 _parse("an perl codeblock marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2115 0         0 $item = new XML::XSH2::Parser::_Runtime::Directive(
2116             'Text::Balanced::extract_codeblock($text,undef,$skip,\''.$outer.'\');
2117             ', $lookahead,$line,"");
2118 0 0 0     0 $prod and $prod->additem($item)
2119             or _no_rule("",$line);
2120             }
2121             elsif ($grammar =~ m/$VARIABLEMK/gco)
2122             {
2123 0         0 _parse("an perl variable marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2124 0         0 $item = new XML::XSH2::Parser::_Runtime::Directive(
2125             'Text::Balanced::extract_variable($text,$skip);
2126             ', $lookahead,$line,"");
2127 0 0 0     0 $prod and $prod->additem($item)
2128             or _no_rule("",$line);
2129             }
2130             elsif ($grammar =~ m/$NOCHECKMK/gco)
2131             {
2132 0         0 _parse("a disable checking marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2133 0 0       0 if ($rule)
2134             {
2135 0         0 _error(" directive not at start of grammar", $line);
2136 0         0 _hint("The directive can only
2137             be specified at the start of a
2138             grammar (before the first rule
2139             is defined.");
2140             }
2141             else
2142             {
2143 0         0 local $::RD_CHECK = 1;
2144             }
2145             }
2146             elsif ($grammar =~ m/$AUTOSTUBMK/gco)
2147             {
2148 0         0 _parse("an autostub marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2149 0         0 $::RD_AUTOSTUB = "";
2150             }
2151             elsif ($grammar =~ m/$AUTORULEMK/gco)
2152             {
2153 0         0 _parse("an autorule marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2154 0         0 $::RD_AUTOSTUB = $1;
2155             }
2156             elsif ($grammar =~ m/$AUTOTREEMK/gco)
2157             {
2158 0 0       0 my $base = defined($1) ? $1 : "";
2159 0         0 my $current_match = substr($grammar, $-[0], $+[0] - $-[0]);
2160 0 0 0     0 $base .= "::" if $base && $base !~ /::$/;
2161 0         0 _parse("an autotree marker", $aftererror,$line, $current_match);
2162 0 0       0 if ($rule)
2163             {
2164 0         0 _error(" directive not at start of grammar", $line);
2165 0         0 _hint("The directive can only
2166             be specified at the start of a
2167             grammar (before the first rule
2168             is defined.");
2169             }
2170             else
2171             {
2172 0         0 undef $self->{_AUTOACTION};
2173             $self->{_AUTOTREE}{NODE}
2174 0         0 = new XML::XSH2::Parser::_Runtime::Action(q({bless \%item, ').$base.q('.$item[0]}),0,-1);
2175             $self->{_AUTOTREE}{TERMINAL}
2176 0         0 = new XML::XSH2::Parser::_Runtime::Action(q({bless {__VALUE__=>$item[1]}, ').$base.q('.$item[0]}),0,-1);
2177             }
2178             }
2179              
2180             elsif ($grammar =~ m/$REJECTMK/gco)
2181             {
2182 0         0 _parse("an reject marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2183 0         0 $item = new XML::XSH2::Parser::_Runtime::UncondReject($lookahead,$line,"");
2184 0 0 0     0 $prod and $prod->additem($item)
2185             or _no_rule("",$line);
2186             }
2187             elsif ($grammar =~ m/(?=$CONDREJECTMK)/gco
2188 0         0 and do { ($code) = extract_codeblock($grammar,'{',undef,'<');
2189 0         0 $code })
2190             {
2191 0         0 _parse("a (conditional) reject marker", $aftererror,$line, $code );
2192 0         0 $code =~ /\A\s*\Z/s;
2193 0         0 my $cond = $1;
2194 0         0 $item = new XML::XSH2::Parser::_Runtime::Directive(
2195             "($1) ? undef : 1", $lookahead,$line,"");
2196 0 0 0     0 $prod and $prod->additem($item)
2197             or _no_rule("",$line);
2198             }
2199             elsif ($grammar =~ m/(?=$SCOREMK)/gco
2200 0         0 and do { ($code) = extract_codeblock($grammar,'{',undef,'<');
2201 0         0 $code })
2202             {
2203 0         0 _parse("a score marker", $aftererror,$line, $code );
2204 0         0 $code =~ /\A\s*\Z/s;
2205 0 0 0     0 $prod and $prod->addscore($1, $lookahead, $line)
2206             or _no_rule($code,$line);
2207             }
2208             elsif ($grammar =~ m/(?=$AUTOSCOREMK)/gco
2209 0         0 and do { ($code) = extract_codeblock($grammar,'{',undef,'<');
2210 0         0 $code;
2211             } )
2212             {
2213 0         0 _parse("an autoscore specifier", $aftererror,$line,$code);
2214 0         0 $code =~ /\A\s*\Z/s;
2215              
2216 0 0 0     0 $rule and $rule->addautoscore($1,$self)
2217             or _no_rule($code,$line);
2218              
2219 0         0 $item = new XML::XSH2::Parser::_Runtime::UncondReject($lookahead,$line,$code);
2220 0 0 0     0 $prod and $prod->additem($item)
2221             or _no_rule($code,$line);
2222             }
2223             elsif ($grammar =~ m/$RESYNCMK/gco)
2224             {
2225 0         0 _parse("a resync to newline marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2226 0         0 $item = new XML::XSH2::Parser::_Runtime::Directive(
2227             'if ($text =~ s/(\A[^\n]*\n)//) { $return = 0; $1; } else { undef }',
2228             $lookahead,$line,"");
2229 0 0 0     0 $prod and $prod->additem($item)
2230             or _no_rule("",$line);
2231             }
2232             elsif ($grammar =~ m/(?=$RESYNCPATMK)/gco
2233 0         0 and do { ($code) = extract_bracketed($grammar,'<');
2234 0         0 $code })
2235             {
2236 0         0 _parse("a resync with pattern marker", $aftererror,$line, $code );
2237 0         0 $code =~ /\A\s*\Z/s;
2238 0         0 $item = new XML::XSH2::Parser::_Runtime::Directive(
2239             'if ($text =~ s/(\A'.$1.')//) { $return = 0; $1; } else { undef }',
2240             $lookahead,$line,$code);
2241 0 0 0     0 $prod and $prod->additem($item)
2242             or _no_rule($code,$line);
2243             }
2244             elsif ($grammar =~ m/(?=$SKIPMK)/gco
2245 0         0 and do { ($code) = extract_codeblock($grammar,'<');
2246 0         0 $code })
2247             {
2248 0         0 _parse("a skip marker", $aftererror,$line, $code );
2249 0         0 $code =~ /\A\s*\Z/s;
2250 0 0       0 if ($rule) {
2251 0         0 $item = new XML::XSH2::Parser::_Runtime::Directive(
2252             'my $oldskip = $skip; $skip='.$1.'; $oldskip',
2253             $lookahead,$line,$code);
2254 0 0 0     0 $prod and $prod->additem($item)
2255             or _no_rule($code,$line);
2256             } else {
2257             #global directive
2258 0         0 $self->{skip} = $1;
2259             }
2260             }
2261             elsif ($grammar =~ m/(?=$RULEVARPATMK)/gco
2262 0         0 and do { ($code) = extract_codeblock($grammar,'{',undef,'<');
2263 0         0 $code;
2264             } )
2265             {
2266 0         0 _parse("a rule variable specifier", $aftererror,$line,$code);
2267 0         0 $code =~ /\A\s*\Z/s;
2268              
2269 0 0 0     0 $rule and $rule->addvar($1,$self)
2270             or _no_rule($code,$line);
2271              
2272 0         0 $item = new XML::XSH2::Parser::_Runtime::UncondReject($lookahead,$line,$code);
2273 0 0 0     0 $prod and $prod->additem($item)
2274             or _no_rule($code,$line);
2275             }
2276             elsif ($grammar =~ m/(?=$AUTOACTIONPATMK)/gco
2277 0         0 and do { ($code) = extract_codeblock($grammar,'{',undef,'<');
2278 0         0 $code;
2279             } )
2280             {
2281 0         0 _parse("an autoaction specifier", $aftererror,$line,$code);
2282 0         0 $code =~ s/\A\s*\Z/$1/s;
2283 0 0       0 if ($code =~ /\A\s*[^{]|[^}]\s*\Z/) {
2284 0         0 $code = "{ $code }"
2285             }
2286             $self->{_check}{itempos} =
2287 0         0 $code =~ /\@itempos\b|\$itempos\s*\[/;
2288             $self->{_AUTOACTION}
2289 0         0 = new XML::XSH2::Parser::_Runtime::Action($code,0,-$line)
2290             }
2291             elsif ($grammar =~ m/(?=$DEFERPATMK)/gco
2292 0         0 and do { ($code) = extract_codeblock($grammar,'{',undef,'<');
2293 0         0 $code;
2294             } )
2295             {
2296 0         0 _parse("a deferred action specifier", $aftererror,$line,$code);
2297 0         0 $code =~ s/\A\s*\Z/$1/s;
2298 0 0       0 if ($code =~ /\A\s*[^{]|[^}]\s*\Z/)
2299             {
2300 0         0 $code = "{ $code }"
2301             }
2302              
2303 0         0 $item = new XML::XSH2::Parser::_Runtime::Directive(
2304             "push \@{\$thisparser->{deferred}}, sub $code;",
2305             $lookahead,$line,"");
2306 0 0 0     0 $prod and $prod->additem($item)
2307             or _no_rule("",$line);
2308              
2309 0         0 $self->{deferrable} = 1;
2310             }
2311             elsif ($grammar =~ m/(?=$TOKENPATMK)/gco
2312 0         0 and do { ($code) = extract_codeblock($grammar,'{',undef,'<');
2313 0         0 $code;
2314             } )
2315             {
2316 0         0 _parse("a token constructor", $aftererror,$line,$code);
2317 0         0 $code =~ s/\A\s*\Z/$1/s;
2318              
2319 0   0     0 my $types = eval 'no strict; local $SIG{__WARN__} = sub {0}; my @arr=('.$code.'); @arr' || ();
2320 0 0       0 if (!$types)
2321             {
2322 0         0 _error("Incorrect token specification: \"$@\"", $line);
2323 0         0 _hint("The directive requires a list
2324             of one or more strings representing possible
2325             types of the specified token. For example:
2326             ");
2327             }
2328             else
2329             {
2330 0         0 $item = new XML::XSH2::Parser::_Runtime::Directive(
2331             'no strict;
2332             $return = { text => $item[-1] };
2333             @{$return->{type}}{'.$code.'} = (1..'.$types.');',
2334             $lookahead,$line,"");
2335 0 0 0     0 $prod and $prod->additem($item)
2336             or _no_rule("",$line);
2337             }
2338             }
2339             elsif ($grammar =~ m/$COMMITMK/gco)
2340             {
2341 0         0 _parse("an commit marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2342 0         0 $item = new XML::XSH2::Parser::_Runtime::Directive('$commit = 1',
2343             $lookahead,$line,"");
2344 0 0 0     0 $prod and $prod->additem($item)
2345             or _no_rule("",$line);
2346             }
2347             elsif ($grammar =~ m/$NOCHECKMK/gco) {
2348 0         0 _parse("an hint request", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2349 0         0 $::RD_CHECK = 0;
2350             }
2351             elsif ($grammar =~ m/$HINTMK/gco) {
2352 0         0 _parse("an hint request", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2353 0         0 $::RD_HINT = $self->{__HINT__} = 1;
2354             }
2355             elsif ($grammar =~ m/$WARNMK/gco) {
2356 0         0 _parse("an warning request", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2357 0 0       0 $::RD_WARN = $self->{__WARN__} = $1 ? $2+0 : 1;
2358             }
2359             elsif ($grammar =~ m/$TRACEBUILDMK/gco) {
2360 0         0 _parse("an grammar build trace request", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2361 0 0       0 $::RD_TRACE = $1 ? $2+0 : 1;
2362             }
2363             elsif ($grammar =~ m/$TRACEPARSEMK/gco) {
2364 0         0 _parse("an parse trace request", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2365 0 0       0 $self->{__TRACE__} = $1 ? $2+0 : 1;
2366             }
2367             elsif ($grammar =~ m/$AUTOERRORMK/gco)
2368             {
2369 0         0 $commitonly = $1;
2370 0         0 _parse("an error marker", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2371 0         0 $item = new XML::XSH2::Parser::_Runtime::Error('',$lookahead,$1,$line);
2372 0 0 0     0 $prod and $prod->additem($item)
2373             or _no_rule("",$line);
2374 0         0 $aftererror = !$commitonly;
2375             }
2376             elsif ($grammar =~ m/(?=$MSGERRORMK)/gco
2377 0         0 and do { $commitonly = $1;
2378 0         0 ($code) = extract_bracketed($grammar,'<');
2379 0         0 $code })
2380             {
2381 0         0 _parse("an error marker", $aftererror,$line,$code);
2382 0         0 $code =~ /\A\s*\Z/s;
2383 0         0 $item = new XML::XSH2::Parser::_Runtime::Error($1,$lookahead,$commitonly,$line);
2384 0 0 0     0 $prod and $prod->additem($item)
2385             or _no_rule("$code",$line);
2386 0         0 $aftererror = !$commitonly;
2387             }
2388 0         0 elsif (do { $commitonly = $1;
2389 0         0 ($code) = extract_bracketed($grammar,'<');
2390 0         0 $code })
2391             {
2392 0 0       0 if ($code =~ /^<[A-Z_]+>$/)
2393             {
2394 0         0 _error("Token items are not yet
2395             supported: \"$code\"",
2396             $line);
2397 0         0 _hint("Items like $code that consist of angle
2398             brackets enclosing a sequence of
2399             uppercase characters will eventually
2400             be used to specify pre-lexed tokens
2401             in a grammar. That functionality is not
2402             yet implemented. Or did you misspell
2403             \"$code\"?");
2404             }
2405             else
2406             {
2407 0         0 _error("Untranslatable item encountered: \"$code\"",
2408             $line);
2409 0         0 _hint("Did you misspell \"$code\"
2410             or forget to comment it out?");
2411             }
2412             }
2413             }
2414             elsif ($grammar =~ m/$RULE/gco)
2415             {
2416 0 0       0 _parseunneg("a rule declaration", 0,
2417             $lookahead,$line, substr($grammar, $-[0], $+[0] - $-[0]) ) or next;
2418 0         0 my $rulename = $1;
2419 0 0       0 if ($rulename =~ /Replace|Extend|Precompile|PrecompiledRuntime|Save/ )
2420             {
2421 0 0       0 _warn(2,"Rule \"$rulename\" hidden by method
2422             XML::XSH2::Parser::_Runtime::$rulename",$line)
2423             and
2424             _hint("The rule named \"$rulename\" cannot be directly
2425             called through the XML::XSH2::Parser::_Runtime object
2426             for this grammar (although it may still
2427             be used as a subrule of other rules).
2428             It can't be directly called because
2429             XML::XSH2::Parser::_Runtime::$rulename is already defined (it
2430             is the standard method of all
2431             parsers).");
2432             }
2433 0         0 $rule = new XML::XSH2::Parser::_Runtime::Rule($rulename,$self,$line,$replace);
2434 0 0       0 $prod->check_pending($line) if $prod;
2435 0         0 $prod = $rule->addprod( new XML::XSH2::Parser::_Runtime::Production );
2436 0         0 $aftererror = 0;
2437             }
2438             elsif ($grammar =~ m/$UNCOMMITPROD/gco)
2439             {
2440 0         0 pos($grammar)-=9;
2441 0 0       0 _parseunneg("a new (uncommitted) production",
2442             0, $lookahead, $line, substr($grammar, $-[0], $+[0] - $-[0]) ) or next;
2443              
2444 0 0       0 $prod->check_pending($line) if $prod;
2445 0         0 $prod = new XML::XSH2::Parser::_Runtime::Production($line,1);
2446 0 0 0     0 $rule and $rule->addprod($prod)
2447             or _no_rule("",$line);
2448 0         0 $aftererror = 0;
2449             }
2450             elsif ($grammar =~ m/$ERRORPROD/gco)
2451             {
2452 0         0 pos($grammar)-=6;
2453 0 0       0 _parseunneg("a new (error) production", $aftererror,
2454             $lookahead,$line, substr($grammar, $-[0], $+[0] - $-[0]) ) or next;
2455 0 0       0 $prod->check_pending($line) if $prod;
2456 0         0 $prod = new XML::XSH2::Parser::_Runtime::Production($line,0,1);
2457 0 0 0     0 $rule and $rule->addprod($prod)
2458             or _no_rule("",$line);
2459 0         0 $aftererror = 0;
2460             }
2461             elsif ($grammar =~ m/$PROD/gco)
2462             {
2463 0 0       0 _parseunneg("a new production", 0,
2464             $lookahead,$line, substr($grammar, $-[0], $+[0] - $-[0]) ) or next;
2465 0 0 0     0 $rule
      0        
      0        
2466             and (!$prod || $prod->check_pending($line))
2467             and $prod = $rule->addprod(new XML::XSH2::Parser::_Runtime::Production($line))
2468             or _no_rule("production",$line);
2469 0         0 $aftererror = 0;
2470             }
2471             elsif ($grammar =~ m/$LITERAL/gco)
2472             {
2473 0         0 my $literal = $1;
2474 0         0 ($code = $literal) =~ s/\\\\/\\/g;
2475 0         0 _parse("a literal terminal", $aftererror,$line,$literal);
2476 0         0 $item = new XML::XSH2::Parser::_Runtime::Literal($code,$lookahead,$line);
2477 0 0 0     0 $prod and $prod->additem($item)
2478             or _no_rule("literal terminal",$line,"'$literal'");
2479             }
2480             elsif ($grammar =~ m/$INTERPLIT/gco)
2481             {
2482 0         0 _parse("an interpolated literal terminal", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2483 0         0 $item = new XML::XSH2::Parser::_Runtime::InterpLit($1,$lookahead,$line);
2484 0 0 0     0 $prod and $prod->additem($item)
2485             or _no_rule("interpolated literal terminal",$line,"'$1'");
2486             }
2487             elsif ($grammar =~ m/$TOKEN/gco)
2488             {
2489 0         0 _parse("a /../ pattern terminal", $aftererror,$line, substr($grammar, $-[0], $+[0] - $-[0]) );
2490 0 0       0 $item = new XML::XSH2::Parser::_Runtime::Token($1,'/',$3?$3:'',$lookahead,$line);
2491 0 0 0     0 $prod and $prod->additem($item)
2492             or _no_rule("pattern terminal",$line,"/$1/");
2493             }
2494             elsif ($grammar =~ m/(?=$MTOKEN)/gco
2495 0         0 and do { ($code, undef, @components)
2496             = extract_quotelike($grammar);
2497 0         0 $code }
2498             )
2499              
2500             {
2501 0         0 _parse("an m/../ pattern terminal", $aftererror,$line,$code);
2502 0         0 $item = new XML::XSH2::Parser::_Runtime::Token(@components[3,2,8],
2503             $lookahead,$line);
2504 0 0 0     0 $prod and $prod->additem($item)
2505             or _no_rule("pattern terminal",$line,$code);
2506             }
2507             elsif ($grammar =~ m/(?=$MATCHRULE)/gco
2508 0         0 and do { ($code) = extract_bracketed($grammar,'<');
2509 0         0 $code
2510             }
2511             or $grammar =~ m/$SUBRULE/gco
2512             and $code = $1)
2513             {
2514 0         0 my $name = $code;
2515 0         0 my $matchrule = 0;
2516 0 0       0 if (substr($name,0,1) eq '<')
2517             {
2518 0         0 $name =~ s/$MATCHRULE\s*//;
2519 0         0 $name =~ s/\s*>\Z//;
2520 0         0 $matchrule = 1;
2521             }
2522              
2523             # EXTRACT TRAILING ARG LIST (IF ANY)
2524              
2525 0   0     0 my ($argcode) = extract_codeblock($grammar, "[]",'') || '';
2526              
2527             # EXTRACT TRAILING REPETITION SPECIFIER (IF ANY)
2528              
2529 0 0       0 if ($grammar =~ m/\G[(]/gc)
2530             {
2531 0         0 pos($grammar)--;
2532              
2533 0 0       0 if ($grammar =~ m/$OPTIONAL/gco)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
2534             {
2535 0         0 _parse("an zero-or-one subrule match", $aftererror,$line,"$code$argcode($1)");
2536 0         0 $item = new XML::XSH2::Parser::_Runtime::Repetition($name,$1,0,1,
2537             $lookahead,$line,
2538             $self,
2539             $matchrule,
2540             $argcode);
2541 0 0 0     0 $prod and $prod->additem($item)
2542             or _no_rule("repetition",$line,"$code$argcode($1)");
2543              
2544 0 0 0     0 !$matchrule and $rule and $rule->addcall($name);
2545             }
2546             elsif ($grammar =~ m/$ANY/gco)
2547             {
2548 0         0 _parse("a zero-or-more subrule match", $aftererror,$line,"$code$argcode($1)");
2549 0 0       0 if ($2)
2550             {
2551 0         0 my $pos = pos $grammar;
2552 0         0 substr($grammar,$pos,0,
2553             "(s?) ");
2554              
2555 0         0 pos $grammar = $pos;
2556             }
2557             else
2558             {
2559 0         0 $item = new XML::XSH2::Parser::_Runtime::Repetition($name,$1,0,$MAXREP,
2560             $lookahead,$line,
2561             $self,
2562             $matchrule,
2563             $argcode);
2564 0 0 0     0 $prod and $prod->additem($item)
2565             or _no_rule("repetition",$line,"$code$argcode($1)");
2566              
2567 0 0 0     0 !$matchrule and $rule and $rule->addcall($name);
2568              
2569 0 0       0 _check_insatiable($name,$1,$grammar,$line) if $::RD_CHECK;
2570             }
2571             }
2572             elsif ($grammar =~ m/$MANY/gco)
2573             {
2574 0         0 _parse("a one-or-more subrule match", $aftererror,$line,"$code$argcode($1)");
2575 0 0       0 if ($2)
2576             {
2577             # $DB::single=1;
2578 0         0 my $pos = pos $grammar;
2579 0         0 substr($grammar,$pos,0,
2580             " ");
2581              
2582 0         0 pos $grammar = $pos;
2583             }
2584             else
2585             {
2586 0         0 $item = new XML::XSH2::Parser::_Runtime::Repetition($name,$1,1,$MAXREP,
2587             $lookahead,$line,
2588             $self,
2589             $matchrule,
2590             $argcode);
2591              
2592 0 0 0     0 $prod and $prod->additem($item)
2593             or _no_rule("repetition",$line,"$code$argcode($1)");
2594              
2595 0 0 0     0 !$matchrule and $rule and $rule->addcall($name);
2596              
2597 0 0       0 _check_insatiable($name,$1,$grammar,$line) if $::RD_CHECK;
2598             }
2599             }
2600             elsif ($grammar =~ m/$EXACTLY/gco)
2601             {
2602 0         0 _parse("an exactly-$1-times subrule match", $aftererror,$line,"$code$argcode($1)");
2603 0 0       0 if ($2)
2604             {
2605 0         0 my $pos = pos $grammar;
2606 0         0 substr($grammar,$pos,0,
2607             "($1) ");
2608              
2609 0         0 pos $grammar = $pos;
2610             }
2611             else
2612             {
2613 0         0 $item = new XML::XSH2::Parser::_Runtime::Repetition($name,$1,$1,$1,
2614             $lookahead,$line,
2615             $self,
2616             $matchrule,
2617             $argcode);
2618 0 0 0     0 $prod and $prod->additem($item)
2619             or _no_rule("repetition",$line,"$code$argcode($1)");
2620              
2621 0 0 0     0 !$matchrule and $rule and $rule->addcall($name);
2622             }
2623             }
2624             elsif ($grammar =~ m/$BETWEEN/gco)
2625             {
2626 0         0 _parse("a $1-to-$2 subrule match", $aftererror,$line,"$code$argcode($1..$2)");
2627 0 0       0 if ($3)
2628             {
2629 0         0 my $pos = pos $grammar;
2630 0         0 substr($grammar,$pos,0,
2631             "($1..$2) ");
2632              
2633 0         0 pos $grammar = $pos;
2634             }
2635             else
2636             {
2637 0         0 $item = new XML::XSH2::Parser::_Runtime::Repetition($name,"$1..$2",$1,$2,
2638             $lookahead,$line,
2639             $self,
2640             $matchrule,
2641             $argcode);
2642 0 0 0     0 $prod and $prod->additem($item)
2643             or _no_rule("repetition",$line,"$code$argcode($1..$2)");
2644              
2645 0 0 0     0 !$matchrule and $rule and $rule->addcall($name);
2646             }
2647             }
2648             elsif ($grammar =~ m/$ATLEAST/gco)
2649             {
2650 0         0 _parse("a $1-or-more subrule match", $aftererror,$line,"$code$argcode($1..)");
2651 0 0       0 if ($2)
2652             {
2653 0         0 my $pos = pos $grammar;
2654 0         0 substr($grammar,$pos,0,
2655             "($1..) ");
2656              
2657 0         0 pos $grammar = $pos;
2658             }
2659             else
2660             {
2661 0         0 $item = new XML::XSH2::Parser::_Runtime::Repetition($name,"$1..",$1,$MAXREP,
2662             $lookahead,$line,
2663             $self,
2664             $matchrule,
2665             $argcode);
2666 0 0 0     0 $prod and $prod->additem($item)
2667             or _no_rule("repetition",$line,"$code$argcode($1..)");
2668              
2669 0 0 0     0 !$matchrule and $rule and $rule->addcall($name);
2670 0 0       0 _check_insatiable($name,"$1..",$grammar,$line) if $::RD_CHECK;
2671             }
2672             }
2673             elsif ($grammar =~ m/$ATMOST/gco)
2674             {
2675 0         0 _parse("a one-to-$1 subrule match", $aftererror,$line,"$code$argcode(..$1)");
2676 0 0       0 if ($2)
2677             {
2678 0         0 my $pos = pos $grammar;
2679 0         0 substr($grammar,$pos,0,
2680             "(..$1) ");
2681              
2682 0         0 pos $grammar = $pos;
2683             }
2684             else
2685             {
2686 0         0 $item = new XML::XSH2::Parser::_Runtime::Repetition($name,"..$1",1,$1,
2687             $lookahead,$line,
2688             $self,
2689             $matchrule,
2690             $argcode);
2691 0 0 0     0 $prod and $prod->additem($item)
2692             or _no_rule("repetition",$line,"$code$argcode(..$1)");
2693              
2694 0 0 0     0 !$matchrule and $rule and $rule->addcall($name);
2695             }
2696             }
2697             elsif ($grammar =~ m/$BADREP/gco)
2698             {
2699 0         0 my $current_match = substr($grammar, $-[0], $+[0] - $-[0]);
2700 0         0 _parse("an subrule match with invalid repetition specifier", 0,$line, $current_match);
2701 0         0 _error("Incorrect specification of a repeated subrule",
2702             $line);
2703 0         0 _hint("Repeated subrules like \"$code$argcode$current_match\" cannot have
2704             a maximum repetition of zero, nor can they have
2705             negative components in their ranges.");
2706             }
2707             }
2708             else
2709             {
2710 0         0 _parse("a subrule match", $aftererror,$line,$code);
2711 0         0 my $desc;
2712 0 0       0 if ($name=~/\A_alternation_\d+_of_production_\d+_of_rule/)
2713 0         0 { $desc = $self->{"rules"}{$name}->expected }
2714 0         0 $item = new XML::XSH2::Parser::_Runtime::Subrule($name,
2715             $lookahead,
2716             $line,
2717             $desc,
2718             $matchrule,
2719             $argcode);
2720              
2721 0 0 0     0 $prod and $prod->additem($item)
2722             or _no_rule("(sub)rule",$line,$name);
2723              
2724 0 0 0     0 !$matchrule and $rule and $rule->addcall($name);
2725             }
2726             }
2727             elsif ($grammar =~ m/$LONECOLON/gco )
2728             {
2729 0         0 _error("Unexpected colon encountered", $line);
2730 0         0 _hint("Did you mean \"|\" (to start a new production)?
2731             Or perhaps you forgot that the colon
2732             in a rule definition must be
2733             on the same line as the rule name?");
2734             }
2735             elsif ($grammar =~ m/$ACTION/gco ) # BAD ACTION, ALREADY FAILED
2736             {
2737 0         0 _error("Malformed action encountered",
2738             $line);
2739 0         0 _hint("Did you forget the closing curly bracket
2740             or is there a syntax error in the action?");
2741             }
2742             elsif ($grammar =~ m/$OTHER/gco )
2743             {
2744 0         0 _error("Untranslatable item encountered: \"$1\"",
2745             $line);
2746 0         0 _hint("Did you misspell \"$1\"
2747             or forget to comment it out?");
2748             }
2749              
2750 0 0       0 if ($lookaheadspec =~ tr /././ > 3)
2751             {
2752 0         0 $lookaheadspec =~ s/\A\s+//;
2753 0 0       0 $lookahead = $lookahead<0
2754             ? 'a negative lookahead ("...!")'
2755             : 'a positive lookahead ("...")' ;
2756 0 0       0 _warn(1,"Found two or more lookahead specifiers in a
2757             row.",$line)
2758             and
2759             _hint("Multiple positive and/or negative lookaheads
2760             are simply multiplied together to produce a
2761             single positive or negative lookahead
2762             specification. In this case the sequence
2763             \"$lookaheadspec\" was reduced to $lookahead.
2764             Was this your intention?");
2765             }
2766 0         0 $lookahead = 0;
2767 0         0 $lookaheadspec = "";
2768              
2769 0         0 $grammar =~ m/\G\s+/gc;
2770             }
2771              
2772 0 0       0 if ($must_pop_lines) {
2773 0         0 pop @lines;
2774             }
2775              
2776 0 0 0     0 unless ($ERRORS or $isimplicit or !$::RD_CHECK)
      0        
2777             {
2778 0         0 $self->_check_grammar();
2779             }
2780              
2781 0 0 0     0 unless ($ERRORS or $isimplicit or $XML::XSH2::Parser::_Runtime::compiling)
      0        
2782             {
2783 0         0 my $code = $self->_code();
2784 0 0       0 if (defined $::RD_TRACE)
2785             {
2786 0 0       0 my $mode = ($nextnamespace eq "namespace000002") ? '>' : '>>';
2787 0         0 print STDERR "printing code (", length($code),") to RD_TRACE\n";
2788 0         0 local *TRACE_FILE;
2789 0 0 0     0 open TRACE_FILE, $mode, "RD_TRACE"
2790             and print TRACE_FILE "my \$ERRORS;\n$code"
2791             and close TRACE_FILE;
2792             }
2793              
2794 0 0       0 unless ( eval "$code 1" )
2795             {
2796 0         0 _error("Internal error in generated parser code!");
2797 0         0 $@ =~ s/at grammar/in grammar at/;
2798 0         0 _hint($@);
2799             }
2800             }
2801              
2802 0 0 0     0 if ($ERRORS and !_verbosity("HINT"))
2803             {
2804 0 0       0 local $::RD_HINT = defined $::RD_HINT ? $::RD_HINT : 1;
2805 0         0 _hint('Set $::RD_HINT (or -RD_HINT if you\'re using "perl -s")
2806             for hints on fixing these problems. Use $::RD_HINT = 0
2807             to disable this message.');
2808             }
2809 0 0       0 if ($ERRORS) { $ERRORS=0; return }
  0         0  
  0         0  
2810 0         0 return $self;
2811             }
2812              
2813              
2814             sub _addstartcode($$)
2815             {
2816 0     0   0 my ($self, $code) = @_;
2817 0         0 $code =~ s/\A\s*\{(.*)\}\Z/$1/s;
2818              
2819 0         0 $self->{"startcode"} .= "$code;\n";
2820             }
2821              
2822             # CHECK FOR GRAMMAR PROBLEMS....
2823              
2824             sub _check_insatiable($$$$)
2825             {
2826 0     0   0 my ($subrule,$repspec,$grammar,$line) = @_;
2827 0         0 pos($grammar)=pos($_[2]);
2828 0 0 0     0 return if $grammar =~ m/$OPTIONAL/gco || $grammar =~ m/$ANY/gco;
2829 0         0 my $min = 1;
2830 0 0 0     0 if ( $grammar =~ m/$MANY/gco
      0        
      0        
      0        
      0        
      0        
      0        
2831             || $grammar =~ m/$EXACTLY/gco
2832             || $grammar =~ m/$ATMOST/gco
2833 0         0 || $grammar =~ m/$BETWEEN/gco && do { $min=$2; 1 }
  0         0  
2834 0         0 || $grammar =~ m/$ATLEAST/gco && do { $min=$2; 1 }
  0         0  
2835             || $grammar =~ m/$SUBRULE(?!\s*:)/gco
2836             )
2837             {
2838 0 0 0     0 return unless $1 eq $subrule && $min > 0;
2839 0         0 my $current_match = substr($grammar, $-[0], $+[0] - $-[0]);
2840 0 0       0 _warn(3,"Subrule sequence \"$subrule($repspec) $current_match\" will
2841             (almost certainly) fail.",$line)
2842             and
2843             _hint("Unless subrule \"$subrule\" performs some cunning
2844             lookahead, the repetition \"$subrule($repspec)\" will
2845             insatiably consume as many matches of \"$subrule\" as it
2846             can, leaving none to match the \"$current_match\" that follows.");
2847             }
2848             }
2849              
2850             sub _check_grammar ($)
2851             {
2852 0     0   0 my $self = shift;
2853 0         0 my $rules = $self->{"rules"};
2854 0         0 my $rule;
2855 0         0 foreach $rule ( values %$rules )
2856             {
2857 0 0       0 next if ! $rule->{"changed"};
2858              
2859             # CHECK FOR UNDEFINED RULES
2860              
2861 0         0 my $call;
2862 0         0 foreach $call ( @{$rule->{"calls"}} )
  0         0  
2863             {
2864 0 0 0     0 if (!defined ${$rules}{$call}
  0         0  
2865 0         0 &&!defined &{"XML::XSH2::Parser::_Runtime::$call"})
2866             {
2867 0 0       0 if (!defined $::RD_AUTOSTUB)
2868             {
2869 0 0       0 _warn(3,"Undefined (sub)rule \"$call\"
2870             used in a production.")
2871             and
2872             _hint("Will you be providing this rule
2873             later, or did you perhaps
2874             misspell \"$call\"? Otherwise
2875             it will be treated as an
2876             immediate .");
2877 0         0 eval "sub $self->{namespace}::$call {undef}";
2878             }
2879             else # EXPERIMENTAL
2880             {
2881 0         0 my $rule = qq{'$call'};
2882 0 0 0     0 if ($::RD_AUTOSTUB and $::RD_AUTOSTUB ne "1") {
2883 0         0 $rule = $::RD_AUTOSTUB;
2884             }
2885 0 0       0 _warn(1,"Autogenerating rule: $call")
2886             and
2887             _hint("A call was made to a subrule
2888             named \"$call\", but no such
2889             rule was specified. However,
2890             since \$::RD_AUTOSTUB
2891             was defined, a rule stub
2892             ($call : $rule) was
2893             automatically created.");
2894              
2895 0         0 $self->_generate("$call: $rule",0,1);
2896             }
2897             }
2898             }
2899              
2900             # CHECK FOR LEFT RECURSION
2901              
2902 0 0       0 if ($rule->isleftrec($rules))
2903             {
2904 0         0 _error("Rule \"$rule->{name}\" is left-recursive.");
2905 0         0 _hint("Redesign the grammar so it's not left-recursive.
2906             That will probably mean you need to re-implement
2907             repetitions using the '(s)' notation.
2908             For example: \"$rule->{name}(s)\".");
2909 0         0 next;
2910             }
2911              
2912             # CHECK FOR PRODUCTIONS FOLLOWING EMPTY PRODUCTIONS
2913             {
2914 0         0 my $hasempty;
  0         0  
2915             my $prod;
2916 0         0 foreach $prod ( @{$rule->{"prods"}} ) {
  0         0  
2917 0 0       0 if ($hasempty) {
2918 0         0 _error("Production " . $prod->describe . " for \"$rule->{name}\"
2919             will never be reached (preceding empty production will
2920             always match first).");
2921 0         0 _hint("Reorder the grammar so that the empty production
2922             is last in the list or productions.");
2923 0         0 last;
2924             }
2925 0   0     0 $hasempty ||= $prod->isempty();
2926             }
2927             }
2928             }
2929             }
2930              
2931             # GENERATE ACTUAL PARSER CODE
2932              
2933             sub _code($)
2934             {
2935 0     0   0 my $self = shift;
2936             my $initial_skip = defined($self->{skip}) ?
2937 0 0       0 '$skip = ' . $self->{skip} . ';' :
2938             $self->_dump([$skip],[qw(skip)]);
2939              
2940 0         0 my $code = qq!
2941             package # this should not be indexed by CPAN
2942             $self->{namespace};
2943             use strict;
2944             use vars qw(\$skip \$AUTOLOAD $self->{localvars} );
2945             \@$self->{namespace}\::ISA = ();
2946             $initial_skip
2947             $self->{startcode}
2948              
2949             {
2950             local \$SIG{__WARN__} = sub {0};
2951             # PRETEND TO BE IN XML::XSH2::Parser::_Runtime NAMESPACE
2952             *$self->{namespace}::AUTOLOAD = sub
2953             {
2954             no strict 'refs';
2955             !
2956             # This generated code uses ${"AUTOLOAD"} rather than $AUTOLOAD in
2957             # order to avoid the circular reference documented here:
2958             # https://rt.perl.org/rt3/Public/Bug/Display.html?id=110248
2959             # As a result of the investigation of
2960             # https://rt.cpan.org/Ticket/Display.html?id=53710
2961             . qq!
2962             \${"AUTOLOAD"} =~ s/^$self->{namespace}/XML::XSH2::Parser::_Runtime/;
2963             goto &{\${"AUTOLOAD"}};
2964             }
2965             }
2966              
2967             !;
2968 0         0 $code .= "push \@$self->{namespace}\::ISA, 'XML::XSH2::Parser::_Runtime';";
2969 0         0 $self->{"startcode"} = '';
2970              
2971 0         0 my $rule;
2972             # sort the rules to ensure the output is reproducible
2973 0         0 foreach $rule ( sort { $a->{name} cmp $b->{name} }
  0         0  
2974 0         0 values %{$self->{"rules"}} )
2975             {
2976 0 0       0 if ($rule->{"changed"})
2977             {
2978 0         0 $code .= $rule->code($self->{"namespace"},$self);
2979 0         0 $rule->{"changed"} = 0;
2980             }
2981             }
2982              
2983 0         0 return $code;
2984             }
2985              
2986             # A wrapper for Data::Dumper->Dump, which localizes some variables to
2987             # keep the output in a form suitable for XML::XSH2::Parser::_Runtime.
2988             #
2989             # List of variables and their defaults taken from
2990             # $Data::Dumper::VERSION == 2.158
2991              
2992             sub _dump {
2993 0     0   0 require Data::Dumper;
2994              
2995             #
2996             # Allow the user's settings to persist for some features in case
2997             # RD_TRACE is set. These shouldn't affect the eval()-ability of
2998             # the resulting parser.
2999             #
3000              
3001             #local $Data::Dumper::Indent = 2;
3002             #local $Data::Dumper::Useqq = 0;
3003             #local $Data::Dumper::Quotekeys = 1;
3004             #local $Data::Dumper::Useperl = 0;
3005              
3006             #
3007             # These may affect whether the output is valid perl code for
3008             # eval(), and must be controlled. Set them to their default
3009             # values.
3010             #
3011              
3012 0         0 local $Data::Dumper::Purity = 0;
3013 0         0 local $Data::Dumper::Pad = "";
3014 0         0 local $Data::Dumper::Varname = "VAR";
3015 0         0 local $Data::Dumper::Terse = 0;
3016 0         0 local $Data::Dumper::Freezer = "";
3017 0         0 local $Data::Dumper::Toaster = "";
3018 0         0 local $Data::Dumper::Deepcopy = 0;
3019 0         0 local $Data::Dumper::Bless = "bless";
3020 0         0 local $Data::Dumper::Maxdepth = 0;
3021 0         0 local $Data::Dumper::Pair = ' => ';
3022 0         0 local $Data::Dumper::Deparse = 0;
3023 0         0 local $Data::Dumper::Sparseseen = 0;
3024              
3025             #
3026             # Modify the below options from their defaults.
3027             #
3028              
3029             # Sort the keys to ensure the output is reproducible
3030 0         0 local $Data::Dumper::Sortkeys = 1;
3031              
3032             # Don't stop recursing
3033 0         0 local $Data::Dumper::Maxrecurse = 0;
3034              
3035 0         0 return Data::Dumper->Dump(@_[1..$#_]);
3036             }
3037              
3038             # EXECUTING A PARSE....
3039              
3040             sub AUTOLOAD # ($parser, $text; $linenum, @args)
3041             {
3042 574 50   574   2134 croak "Could not find method: $AUTOLOAD\n" unless ref $_[0];
3043 574   33     1825 my $class = ref($_[0]) || $_[0];
3044 574 50       2078 my $text = ref($_[1]) eq 'SCALAR' ? ${$_[1]} : "$_[1]";
  0         0  
3045 574         1680 $_[0]->{lastlinenum} = _linecount($text);
3046 574 50 0     1998 $_[0]->{lastlinenum} += ($_[2]||0) if @_ > 2;
3047 574         1169 $_[0]->{offsetlinenum} = $_[0]->{lastlinenum};
3048 574         1559 $_[0]->{fulltext} = $text;
3049 574         1313 $_[0]->{fulltextlen} = length $text;
3050 574         2486 $_[0]->{linecounter_cache} = {};
3051 574         1744 $_[0]->{deferred} = [];
3052 574         1366 $_[0]->{errors} = [];
3053 574         1989 my @args = @_[3..$#_];
3054 574     574   2787 my $args = sub { [ @args ] };
  574         1514  
3055              
3056 574         4883 $AUTOLOAD =~ s/$class/$_[0]->{namespace}/;
3057 8     8   114 no strict "refs";
  8         31  
  8         18962  
3058              
3059 574   33     2333 local $::RD_WARN = $::RD_WARN || $_[0]->{__WARN__};
3060 574   66     1699 local $::RD_HINT = $::RD_HINT || $_[0]->{__HINT__};
3061 574   33     2897 local $::RD_TRACE = $::RD_TRACE || $_[0]->{__TRACE__};
3062              
3063 574 50       4737 croak "Unknown starting rule ($AUTOLOAD) called\n"
3064             unless defined &$AUTOLOAD;
3065 574         1322 my $retval = &{$AUTOLOAD}(
  574         3031  
3066             $_[0], # $parser
3067             $text, # $text
3068             undef, # $repeating
3069             undef, # $_noactions
3070             $args, # \@args
3071             undef, # $_itempos
3072             );
3073              
3074              
3075 574 50       1546 if (defined $retval)
3076             {
3077 574         874 foreach ( @{$_[0]->{deferred}} ) { &$_; }
  574         2085  
  0         0  
3078             }
3079             else
3080             {
3081 0         0 foreach ( @{$_[0]->{errors}} ) { _error(@$_); }
  0         0  
  0         0  
3082             }
3083              
3084 574 50       1808 if (ref $_[1] eq 'SCALAR') { ${$_[1]} = $text }
  0         0  
  0         0  
3085              
3086 574         922 $ERRORS = 0;
3087 574         3880 return $retval;
3088             }
3089              
3090             sub _parserepeat($$$$$$$$$) # RETURNS A REF TO AN ARRAY OF MATCHES
3091             {
3092 6638     6638   18980 my ($parser, $text, $prod, $min, $max, $_noactions, $expectation, $argcode, $_itempos) = @_;
3093 6638         9410 my @tokens = ();
3094              
3095 6638         9035 my $itemposfirst;
3096             my $reps;
3097 6638         15321 for ($reps=0; $reps<$max;)
3098             {
3099 8692         19959 $expectation->at($text);
3100 8692         12602 my $_savetext = $text;
3101 8692         15996 my $prevtextlen = length $text;
3102 8692         10951 my $_tok;
3103 8692 100       21310 if (! defined ($_tok = &$prod($parser,$text,1,$_noactions,$argcode,$_itempos)))
3104             {
3105 5145         9419 $text = $_savetext;
3106 5145         7775 last;
3107             }
3108              
3109 3547 50 33     9648 if (defined($_itempos) and !defined($itemposfirst))
3110             {
3111 0         0 $itemposfirst = XML::XSH2::Parser::_Runtime::Production::_duplicate_itempos($_itempos);
3112             }
3113              
3114 3547 50       8422 push @tokens, $_tok if defined $_tok;
3115 3547 100 66     17296 last if ++$reps >= $min and $prevtextlen == length $text;
3116             }
3117              
3118 6638 50       12995 do { $expectation->failed(); return undef} if $reps<$min;
  0         0  
  0         0  
3119              
3120 6638 50       11138 if (defined $itemposfirst)
3121             {
3122 0         0 XML::XSH2::Parser::_Runtime::Production::_update_itempos($_itempos, $itemposfirst, undef, [qw(from)]);
3123             }
3124              
3125 6638         11155 $_[1] = $text;
3126 6638         23527 return [@tokens];
3127             }
3128              
3129             sub set_autoflush {
3130 0     0   0 my $orig_selected = select $_[0];
3131 0         0 $| = 1;
3132 0         0 select $orig_selected;
3133 0         0 return;
3134             }
3135              
3136             # ERROR REPORTING....
3137              
3138             sub _write_ERROR {
3139 0     0   0 my ($errorprefix, $errortext) = @_;
3140 0 0       0 return if $errortext !~ /\S/;
3141 0         0 $errorprefix =~ s/\s+\Z//;
3142 0         0 local $^A = q{};
3143              
3144 0         0 formline(<<'END_FORMAT', $errorprefix, $errortext);
3145             @>>>>>>>>>>>>>>>>>>>>: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
3146             END_FORMAT
3147 0         0 formline(<<'END_FORMAT', $errortext);
3148             ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
3149             END_FORMAT
3150 0         0 print {*STDERR} $^A;
  0         0  
3151             }
3152              
3153             # TRACING
3154              
3155             my $TRACE_FORMAT = <<'END_FORMAT';
3156             @>|@|||||||||@^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<|
3157             | ~~ |^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<|
3158             END_FORMAT
3159              
3160             my $TRACECONTEXT_FORMAT = <<'END_FORMAT';
3161             @>|@|||||||||@ |^<<<<<<<<<<<<<<<<<<<<<<<<<<<
3162             | ~~ | |^<<<<<<<<<<<<<<<<<<<<<<<<<<<
3163             END_FORMAT
3164              
3165             sub _write_TRACE {
3166 0     0   0 my ($tracelevel, $tracerulename, $tracemsg) = @_;
3167 0 0       0 return if $tracemsg !~ /\S/;
3168 0         0 $tracemsg =~ s/\s*\Z//;
3169 0         0 local $^A = q{};
3170 0         0 my $bar = '|';
3171 0         0 formline($TRACE_FORMAT, $tracelevel, $tracerulename, $bar, $tracemsg, $tracemsg);
3172 0         0 print {*STDERR} $^A;
  0         0  
3173             }
3174              
3175             sub _write_TRACECONTEXT {
3176 0     0   0 my ($tracelevel, $tracerulename, $tracecontext) = @_;
3177 0 0       0 return if $tracecontext !~ /\S/;
3178 0         0 $tracecontext =~ s/\s*\Z//;
3179 0         0 local $^A = q{};
3180 0         0 my $bar = '|';
3181 0         0 formline($TRACECONTEXT_FORMAT, $tracelevel, $tracerulename, $bar, $tracecontext, $tracecontext);
3182 0         0 print {*STDERR} $^A;
  0         0  
3183             }
3184              
3185             sub _verbosity($)
3186             {
3187 0 0 0 0   0 defined $::RD_TRACE
      0        
      0        
      0        
      0        
      0        
      0        
      0        
3188             or defined $::RD_HINT and $::RD_HINT and $_[0] =~ /ERRORS|WARN|HINT/
3189             or defined $::RD_WARN and $::RD_WARN and $_[0] =~ /ERRORS|WARN/
3190             or defined $::RD_ERRORS and $::RD_ERRORS and $_[0] =~ /ERRORS/
3191             }
3192              
3193             sub _error($;$)
3194             {
3195 0     0   0 $ERRORS++;
3196 0 0       0 return 0 if ! _verbosity("ERRORS");
3197 0         0 my $errortext = $_[0];
3198 0 0       0 my $errorprefix = "ERROR" . ($_[1] ? " (line $_[1])" : "");
3199 0         0 $errortext =~ s/\s+/ /g;
3200 0 0       0 print {*STDERR} "\n" if _verbosity("WARN");
  0         0  
3201 0         0 _write_ERROR($errorprefix, $errortext);
3202 0         0 return 1;
3203             }
3204              
3205             sub _warn($$;$)
3206             {
3207 0 0 0 0   0 return 0 unless _verbosity("WARN") && ($::RD_HINT || $_[0] >= ($::RD_WARN||1));
      0        
3208 0         0 my $errortext = $_[1];
3209 0 0       0 my $errorprefix = "Warning" . ($_[2] ? " (line $_[2])" : "");
3210 0 0       0 print {*STDERR} "\n" if _verbosity("HINT");
  0         0  
3211 0         0 $errortext =~ s/\s+/ /g;
3212 0         0 _write_ERROR($errorprefix, $errortext);
3213 0         0 return 1;
3214             }
3215              
3216             sub _hint($)
3217             {
3218 0 0   0   0 return 0 unless $::RD_HINT;
3219 0         0 my $errortext = $_[0];
3220 0 0       0 my $errorprefix = "Hint" . ($_[1] ? " (line $_[1])" : "");
3221 0         0 $errortext =~ s/\s+/ /g;
3222 0         0 _write_ERROR($errorprefix, $errortext);
3223 0         0 return 1;
3224             }
3225              
3226             sub _tracemax($)
3227             {
3228 0 0 0 0   0 if (defined $::RD_TRACE
      0        
      0        
3229             && $::RD_TRACE =~ /\d+/
3230             && $::RD_TRACE>1
3231             && $::RD_TRACE+10
3232             {
3233 0         0 my $count = length($_[0]) - $::RD_TRACE;
3234 0         0 return substr($_[0],0,$::RD_TRACE/2)
3235             . "...<$count>..."
3236             . substr($_[0],-$::RD_TRACE/2);
3237             }
3238             else
3239             {
3240 0         0 return substr($_[0],0,500);
3241             }
3242             }
3243              
3244             sub _tracefirst($)
3245             {
3246 0 0 0 0   0 if (defined $::RD_TRACE
      0        
      0        
3247             && $::RD_TRACE =~ /\d+/
3248             && $::RD_TRACE>1
3249             && $::RD_TRACE+10
3250             {
3251 0         0 my $count = length($_[0]) - $::RD_TRACE;
3252 0         0 return substr($_[0],0,$::RD_TRACE) . "...<+$count>";
3253             }
3254             else
3255             {
3256 0         0 return substr($_[0],0,500);
3257             }
3258             }
3259              
3260             my $lastcontext = '';
3261             my $lastrulename = '';
3262             my $lastlevel = '';
3263              
3264             sub _trace($;$$$)
3265             {
3266 0     0   0 my $tracemsg = $_[0];
3267 0   0     0 my $tracecontext = $_[1]||$lastcontext;
3268 0   0     0 my $tracerulename = $_[2]||$lastrulename;
3269 0   0     0 my $tracelevel = $_[3]||$lastlevel;
3270 0 0       0 if ($tracerulename) { $lastrulename = $tracerulename }
  0         0  
3271 0 0       0 if ($tracelevel) { $lastlevel = $tracelevel }
  0         0  
3272              
3273 0         0 $tracecontext =~ s/\n/\\n/g;
3274 0         0 $tracecontext =~ s/\s+/ /g;
3275 0         0 $tracerulename = qq{$tracerulename};
3276 0         0 _write_TRACE($tracelevel, $tracerulename, $tracemsg);
3277 0 0       0 if ($tracecontext ne $lastcontext)
3278             {
3279 0 0       0 if ($tracecontext)
3280             {
3281 0         0 $lastcontext = _tracefirst($tracecontext);
3282 0         0 $tracecontext = qq{"$tracecontext"};
3283             }
3284             else
3285             {
3286 0         0 $tracecontext = qq{};
3287             }
3288 0         0 _write_TRACECONTEXT($tracelevel, $tracerulename, $tracecontext);
3289             }
3290             }
3291              
3292             sub _matchtracemessage
3293             {
3294 0     0   0 my ($self, $reject) = @_;
3295              
3296 0         0 my $prefix = '';
3297 0         0 my $postfix = '';
3298 0         0 my $matched = not $reject;
3299 0         0 my @t = ("Matched", "Didn't match");
3300 0 0 0     0 if (exists $self->{lookahead} and $self->{lookahead})
3301             {
3302 0 0       0 $postfix = $reject ? "(reject)" : "(keep)";
3303 0         0 $prefix = "...";
3304 0 0       0 if ($self->{lookahead} < 0)
3305             {
3306 0         0 $prefix .= '!';
3307 0         0 $matched = not $matched;
3308             }
3309             }
3310 0 0       0 $prefix . ($matched ? $t[0] : $t[1]) . $postfix;
3311             }
3312              
3313             sub _parseunneg($$$$$)
3314             {
3315 0     0   0 _parse($_[0],$_[1],$_[3],$_[4]);
3316 0 0       0 if ($_[2]<0)
3317             {
3318 0         0 _error("Can't negate \"$_[4]\".",$_[3]);
3319 0         0 _hint("You can't negate $_[0]. Remove the \"...!\" before
3320             \"$_[4]\".");
3321 0         0 return 0;
3322             }
3323 0         0 return 1;
3324             }
3325              
3326             sub _parse($$$$)
3327             {
3328 0     0   0 my $what = $_[3];
3329 0         0 $what =~ s/^\s+//;
3330 0 0       0 if ($_[1])
3331             {
3332 0 0       0 _warn(3,"Found $_[0] ($what) after an unconditional ",$_[2])
3333             and
3334             _hint("An unconditional always causes the
3335             production containing it to immediately fail.
3336             \u$_[0] that follows an
3337             will never be reached. Did you mean to use
3338             instead?");
3339             }
3340              
3341 0 0       0 return if ! _verbosity("TRACE");
3342 0         0 my $errortext = "Treating \"$what\" as $_[0]";
3343 0         0 my $errorprefix = "XML::XSH2::Parser::_Runtime";
3344 0         0 $errortext =~ s/\s+/ /g;
3345 0         0 _write_ERROR($errorprefix, $errortext);
3346             }
3347              
3348             sub _linecount($) {
3349 2391   50 2391   16675 scalar substr($_[0], pos $_[0]||0) =~ tr/\n//
3350             }
3351              
3352              
3353             package # this should not be indexed by CPAN
3354             main;
3355              
3356 8     8   84 use vars qw ( $RD_ERRORS $RD_WARN $RD_HINT $RD_TRACE $RD_CHECK );
  8         30  
  8         1067  
3357             $::RD_CHECK = 1;
3358             $::RD_ERRORS = 1;
3359             $::RD_WARN = 3;
3360              
3361             1;
3362              
3363             }
3364             package XML::XSH2::Parser;
3365             { my $ERRORS;
3366              
3367              
3368             package XML::XSH2::Parser::_Runtime::XML::XSH2::Parser;
3369 8     8   61 use strict;
  8         25  
  8         284  
3370 8     8   50 use vars qw($skip $AUTOLOAD );
  8         20  
  8         864  
3371             @XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::ISA = ();
3372             $skip = '(\\s|\\n|#[^\\n]*)*';
3373              
3374              
3375              
3376             {
3377             local $SIG{__WARN__} = sub {0};
3378             # PRETEND TO BE IN XML::XSH2::Parser::_Runtime NAMESPACE
3379             *XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::AUTOLOAD = sub
3380             {
3381 8     8   59 no strict 'refs';
  8         18  
  8         1097  
3382              
3383 0     0   0 ${"AUTOLOAD"} =~ s/^XML::XSH2::Parser::_Runtime::XML::XSH2::Parser/XML::XSH2::Parser::_Runtime/;
  0         0  
3384 0         0 goto &{${"AUTOLOAD"}};
  0         0  
  0         0  
3385             }
3386             }
3387              
3388             push @XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::ISA, 'XML::XSH2::Parser::_Runtime';
3389             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
3390             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::ID
3391             {
3392 10     10   25 my $thisparser = $_[0];
3393 8     8   60 use vars q{$tracelevel};
  8         32  
  8         7017  
3394 10   50     46 local $tracelevel = ($tracelevel||0)+1;
3395 10         34 $ERRORS = 0;
3396 10         33 my $thisrule = $thisparser->{"rules"}{"ID"};
3397              
3398 10 50       43 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [ID]},
3399             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
3400             q{ID},
3401             $tracelevel)
3402             if defined $::RD_TRACE;
3403              
3404            
3405 10         18 my $err_at = @{$thisparser->{errors}};
  10         23  
3406              
3407 10         44 my $score;
3408             my $score_return;
3409 10         0 my $_tok;
3410 10         18 my $return = undef;
3411 10         16 my $_matched=0;
3412 10         19 my $commit=0;
3413 10         29 my @item = ();
3414 10         18 my %item = ();
3415 10         23 my $repeating = $_[2];
3416 10         17 my $_noactions = $_[3];
3417 10 50       119 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  10         21  
  10         23  
3418 10         32 my $_itempos = $_[5];
3419 10 50       52 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
3420 10         50 my $text;
3421             my $lastsep;
3422 10         0 my $current_match;
3423 10         41 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/[a-zA-Z_][a-zA-Z0-9_]*/});
3424 10         41 $expectation->at($_[1]);
3425            
3426 10         26 my $thisoffset;
3427 10         47 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
3428            
3429 10         23 my $thiscolumn;
3430 10         34 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
3431            
3432 10         28 my $thisline;
3433 10         36 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
3434              
3435            
3436              
3437 10   33     93 while (!$_matched && !$commit)
3438             {
3439            
3440 10 50       41 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/[a-zA-Z_][a-zA-Z0-9_]*/]},
3441             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
3442             q{ID},
3443             $tracelevel)
3444             if defined $::RD_TRACE;
3445 10         42 my $thisprod = $thisrule->{"prods"}[0];
3446 10         24 $text = $_[1];
3447 10         17 my $_savetext;
3448 10         37 @item = (q{ID});
3449 10         41 %item = (__RULE__ => q{ID});
3450 10         18 my $repcount = 0;
3451              
3452              
3453 10 50       34 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/[a-zA-Z_][a-zA-Z0-9_]*/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
3454             q{ID},
3455             $tracelevel)
3456             if defined $::RD_TRACE;
3457 10         19 undef $lastsep;
3458 10         30 $expectation->is(q{})->at($text);
3459            
3460              
3461 10 50 33     274 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:[a-zA-Z_][a-zA-Z0-9_]*)/)
  10 50       164  
3462             {
3463 0 0       0 $text = $lastsep . $text if defined $lastsep;
3464 0         0 $expectation->failed();
3465 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
3466             XML::XSH2::Parser::_Runtime::_tracefirst($text))
3467             if defined $::RD_TRACE;
3468              
3469 0         0 last;
3470             }
3471 10         83 $current_match = substr($text, $-[0], $+[0] - $-[0]);
3472 10         51 substr($text,0,length($current_match),q{});
3473 10 50       44 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
3474             . $current_match . q{])},
3475             XML::XSH2::Parser::_Runtime::_tracefirst($text))
3476             if defined $::RD_TRACE;
3477 10         53 push @item, $item{__PATTERN1__}=$current_match;
3478            
3479              
3480 10 50       29 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/[a-zA-Z_][a-zA-Z0-9_]*/]<<},
3481             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3482             q{ID},
3483             $tracelevel)
3484             if defined $::RD_TRACE;
3485              
3486              
3487              
3488 10         17 $_matched = 1;
3489 10         24 last;
3490             }
3491              
3492              
3493 10 50 33     49 unless ( $_matched || defined($score) )
3494             {
3495            
3496              
3497 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
3498 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
3499             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
3500             q{ID},
3501             $tracelevel)
3502             if defined $::RD_TRACE;
3503 0         0 return undef;
3504             }
3505 10 50 33     82 if (!defined($return) && defined($score))
3506             {
3507 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
3508             q{ID},
3509             $tracelevel)
3510             if defined $::RD_TRACE;
3511 0         0 $return = $score_return;
3512             }
3513 10         21 splice @{$thisparser->{errors}}, $err_at;
  10         31  
3514 10 50       42 $return = $item[$#item] unless defined $return;
3515 10 50       31 if (defined $::RD_TRACE)
3516             {
3517 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
3518             $return . q{])}, "",
3519             q{ID},
3520             $tracelevel);
3521 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
3522             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
3523             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3524             , q{ID},
3525             $tracelevel)
3526             }
3527 10         27 $_[1] = $text;
3528 10         89 return $return;
3529             }
3530              
3531             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
3532             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::_alternation_1_of_production_10_of_rule_command
3533             {
3534 2     2   11 my $thisparser = $_[0];
3535 8     8   69 use vars q{$tracelevel};
  8         28  
  8         7756  
3536 2   50     10 local $tracelevel = ($tracelevel||0)+1;
3537 2         4 $ERRORS = 0;
3538 2         6 my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_10_of_rule_command"};
3539              
3540 2 50       7 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [_alternation_1_of_production_10_of_rule_command]},
3541             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
3542             q{_alternation_1_of_production_10_of_rule_command},
3543             $tracelevel)
3544             if defined $::RD_TRACE;
3545              
3546            
3547 2         4 my $err_at = @{$thisparser->{errors}};
  2         6  
3548              
3549 2         8 my $score;
3550             my $score_return;
3551 2         0 my $_tok;
3552 2         4 my $return = undef;
3553 2         5 my $_matched=0;
3554 2         3 my $commit=0;
3555 2         4 my @item = ();
3556 2         5 my %item = ();
3557 2         5 my $repeating = $_[2];
3558 2         5 my $_noactions = $_[3];
3559 2 50       7 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  2         1197  
  2         10  
3560 2         5 my $_itempos = $_[5];
3561 2 50       8 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
3562 2         7 my $text;
3563             my $lastsep;
3564 2         0 my $current_match;
3565 2         7 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/--input-file|:f/, or /--input-pipe|:p/, or /--input-string|:s/, or /--output-file|:F/, or /--output-encoding|:E/, or /--output-pipe|:P/, or /--output-string|:S/, or /--no-output|:N/});
3566 2         9 $expectation->at($_[1]);
3567            
3568 2         4 my $thisoffset;
3569 2         9 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
3570            
3571 2         5 my $thiscolumn;
3572 2         9 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
3573            
3574 2         4 my $thisline;
3575 2         9 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
3576              
3577            
3578              
3579 2   33     21 while (!$_matched && !$commit)
3580             {
3581            
3582 2 50       9 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/--input-file|:f/, or /--input-pipe|:p/, or /--input-string|:s/, or /--output-file|:F/, or /--output-encoding|:E/, or /--output-pipe|:P/, or /--output-string|:S/, or /--no-output|:N/]},
3583             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
3584             q{_alternation_1_of_production_10_of_rule_command},
3585             $tracelevel)
3586             if defined $::RD_TRACE;
3587 2         8 my $thisprod = $thisrule->{"prods"}[0];
3588 2         5 $text = $_[1];
3589 2         4 my $_savetext;
3590 2         11 @item = (q{_alternation_1_of_production_10_of_rule_command});
3591 2         7 %item = (__RULE__ => q{_alternation_1_of_production_10_of_rule_command});
3592 2         4 my $repcount = 0;
3593              
3594              
3595 2 50       8 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [/--input-file|:f/, or /--input-pipe|:p/, or /--input-string|:s/, or /--output-file|:F/, or /--output-encoding|:E/, or /--output-pipe|:P/, or /--output-string|:S/, or /--no-output|:N/]},
3596             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3597             q{_alternation_1_of_production_10_of_rule_command},
3598             $tracelevel)
3599             if defined $::RD_TRACE;
3600 2         8 $expectation->is(q{})->at($text);
3601            
3602 2 50   6   27 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command, 0, 100000000, $_noactions,$expectation,sub { \@arg },undef)))
  6         13  
3603             {
3604 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
3605             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3606             q{_alternation_1_of_production_10_of_rule_command},
3607             $tracelevel)
3608             if defined $::RD_TRACE;
3609 0         0 last;
3610             }
3611 2 50       10 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command]<< (}
3612             . @$_tok . q{ times)},
3613              
3614             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3615             q{_alternation_1_of_production_10_of_rule_command},
3616             $tracelevel)
3617             if defined $::RD_TRACE;
3618 2         7 $item{q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command(s?)}} = $_tok;
3619 2         4 push @item, $_tok;
3620            
3621              
3622              
3623 2 50       6 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
3624             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3625             q{_alternation_1_of_production_10_of_rule_command},
3626             $tracelevel)
3627             if defined $::RD_TRACE;
3628            
3629              
3630 2 50       7 $_tok = ($_noactions) ? 0 : do { [ map { @$_ } @{$item[1]} ] };
  2         4  
  4         13  
  2         7  
3631 2 50       6 unless (defined $_tok)
3632             {
3633 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
3634             if defined $::RD_TRACE;
3635 0         0 last;
3636             }
3637 2 50       7 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
3638             . $_tok . q{])},
3639             XML::XSH2::Parser::_Runtime::_tracefirst($text))
3640             if defined $::RD_TRACE;
3641 2         4 push @item, $_tok;
3642 2         5 $item{__ACTION1__}=$_tok;
3643            
3644              
3645 2 50       6 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/--input-file|:f/, or /--input-pipe|:p/, or /--input-string|:s/, or /--output-file|:F/, or /--output-encoding|:E/, or /--output-pipe|:P/, or /--output-string|:S/, or /--no-output|:N/]<<},
3646             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3647             q{_alternation_1_of_production_10_of_rule_command},
3648             $tracelevel)
3649             if defined $::RD_TRACE;
3650              
3651              
3652              
3653 2         4 $_matched = 1;
3654 2         5 last;
3655             }
3656              
3657              
3658 2 50 33     9 unless ( $_matched || defined($score) )
3659             {
3660            
3661              
3662 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
3663 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
3664             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
3665             q{_alternation_1_of_production_10_of_rule_command},
3666             $tracelevel)
3667             if defined $::RD_TRACE;
3668 0         0 return undef;
3669             }
3670 2 50 33     19 if (!defined($return) && defined($score))
3671             {
3672 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
3673             q{_alternation_1_of_production_10_of_rule_command},
3674             $tracelevel)
3675             if defined $::RD_TRACE;
3676 0         0 $return = $score_return;
3677             }
3678 2         10 splice @{$thisparser->{errors}}, $err_at;
  2         6  
3679 2 50       9 $return = $item[$#item] unless defined $return;
3680 2 50       6 if (defined $::RD_TRACE)
3681             {
3682 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
3683             $return . q{])}, "",
3684             q{_alternation_1_of_production_10_of_rule_command},
3685             $tracelevel);
3686 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
3687             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
3688             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3689             , q{_alternation_1_of_production_10_of_rule_command},
3690             $tracelevel)
3691             }
3692 2         6 $_[1] = $text;
3693 2         18 return $return;
3694             }
3695              
3696             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
3697             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command
3698             {
3699 6     6   20 my $thisparser = $_[0];
3700 8     8   76 use vars q{$tracelevel};
  8         19  
  8         4995  
3701 6   50     18 local $tracelevel = ($tracelevel||0)+1;
3702 6         8 $ERRORS = 0;
3703 6         15 my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command"};
3704              
3705 6 50       17 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command]},
3706             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
3707             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3708             $tracelevel)
3709             if defined $::RD_TRACE;
3710              
3711            
3712 6         9 my $err_at = @{$thisparser->{errors}};
  6         14  
3713              
3714 6         14 my $score;
3715             my $score_return;
3716 6         0 my $_tok;
3717 6         9 my $return = undef;
3718 6         8 my $_matched=0;
3719 6         9 my $commit=0;
3720 6         11 my @item = ();
3721 6         11 my %item = ();
3722 6         9 my $repeating = $_[2];
3723 6         9 my $_noactions = $_[3];
3724 6 50       14 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  6         8  
  6         14  
3725 6         8 my $_itempos = $_[5];
3726 6 50       20 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
3727 6         13 my $text;
3728             my $lastsep;
3729 6         0 my $current_match;
3730 6         17 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/--input-file|:f/, or /--input-pipe|:p/, or /--input-string|:s/, or /--output-file|:F/, or /--output-encoding|:E/, or /--output-pipe|:P/, or /--output-string|:S/, or /--no-output|:N/});
3731 6         18 $expectation->at($_[1]);
3732            
3733 6         9 my $thisoffset;
3734 6         28 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
3735            
3736 6         12 my $thiscolumn;
3737 6         19 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
3738            
3739 6         17 my $thisline;
3740 6         18 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
3741              
3742            
3743              
3744 6   33     31 while (!$_matched && !$commit)
3745             {
3746            
3747 6 50       13 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/--input-file|:f/ filename]},
3748             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
3749             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3750             $tracelevel)
3751             if defined $::RD_TRACE;
3752 6         16 my $thisprod = $thisrule->{"prods"}[0];
3753 6         13 $text = $_[1];
3754 6         8 my $_savetext;
3755 6         20 @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
3756 6         22 %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
3757 6         12 my $repcount = 0;
3758              
3759              
3760 6 50       17 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/--input-file|:f/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
3761             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3762             $tracelevel)
3763             if defined $::RD_TRACE;
3764 6         11 undef $lastsep;
3765 6         15 $expectation->is(q{})->at($text);
3766            
3767              
3768 6 50 33     96 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:--input-file|:f)/)
  6 50       86  
3769             {
3770 6 50       22 $text = $lastsep . $text if defined $lastsep;
3771 6         19 $expectation->failed();
3772 6 50       12 XML::XSH2::Parser::_Runtime::_trace(q{<>},
3773             XML::XSH2::Parser::_Runtime::_tracefirst($text))
3774             if defined $::RD_TRACE;
3775              
3776 6         747 last;
3777             }
3778 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
3779 0         0 substr($text,0,length($current_match),q{});
3780 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
3781             . $current_match . q{])},
3782             XML::XSH2::Parser::_Runtime::_tracefirst($text))
3783             if defined $::RD_TRACE;
3784 0         0 push @item, $item{__PATTERN1__}=$current_match;
3785            
3786              
3787 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [filename]},
3788             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3789             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3790             $tracelevel)
3791             if defined $::RD_TRACE;
3792 8     8   68 if (1) { no strict qw{refs};
  8         19  
  8         4962  
  0         0  
3793 0         0 $expectation->is(q{filename})->at($text);
3794 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::filename($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
3795             {
3796            
3797 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
3798             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3799             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3800             $tracelevel)
3801             if defined $::RD_TRACE;
3802 0         0 $expectation->failed();
3803 0         0 last;
3804             }
3805 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [filename]<< (return value: [}
3806             . $_tok . q{]},
3807              
3808             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3809             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3810             $tracelevel)
3811             if defined $::RD_TRACE;
3812 0         0 $item{q{filename}} = $_tok;
3813 0         0 push @item, $_tok;
3814            
3815             }
3816              
3817 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
3818             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3819             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3820             $tracelevel)
3821             if defined $::RD_TRACE;
3822            
3823              
3824 0 0       0 $_tok = ($_noactions) ? 0 : do { [ 'string/input-file' => $item[2] ] };
  0         0  
3825 0 0       0 unless (defined $_tok)
3826             {
3827 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
3828             if defined $::RD_TRACE;
3829 0         0 last;
3830             }
3831 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
3832             . $_tok . q{])},
3833             XML::XSH2::Parser::_Runtime::_tracefirst($text))
3834             if defined $::RD_TRACE;
3835 0         0 push @item, $_tok;
3836 0         0 $item{__ACTION1__}=$_tok;
3837            
3838              
3839 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/--input-file|:f/ filename]<<},
3840             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3841             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3842             $tracelevel)
3843             if defined $::RD_TRACE;
3844              
3845              
3846              
3847 0         0 $_matched = 1;
3848 0         0 last;
3849             }
3850              
3851              
3852 6   33     32 while (!$_matched && !$commit)
3853             {
3854            
3855 6 50       14 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/--input-pipe|:p/ filename]},
3856             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
3857             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3858             $tracelevel)
3859             if defined $::RD_TRACE;
3860 6         14 my $thisprod = $thisrule->{"prods"}[1];
3861 6         10 $text = $_[1];
3862 6         11 my $_savetext;
3863 6         14 @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
3864 6         21 %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
3865 6         41 my $repcount = 0;
3866              
3867              
3868 6 50       14 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/--input-pipe|:p/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
3869             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3870             $tracelevel)
3871             if defined $::RD_TRACE;
3872 6         11 undef $lastsep;
3873 6         14 $expectation->is(q{})->at($text);
3874            
3875              
3876 6 50 66     71 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:--input-pipe|:p)/)
  6 100       73  
3877             {
3878 5 50       17 $text = $lastsep . $text if defined $lastsep;
3879 5         15 $expectation->failed();
3880 5 50       14 XML::XSH2::Parser::_Runtime::_trace(q{<>},
3881             XML::XSH2::Parser::_Runtime::_tracefirst($text))
3882             if defined $::RD_TRACE;
3883              
3884 5         11 last;
3885             }
3886 1         6 $current_match = substr($text, $-[0], $+[0] - $-[0]);
3887 1         4 substr($text,0,length($current_match),q{});
3888 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
3889             . $current_match . q{])},
3890             XML::XSH2::Parser::_Runtime::_tracefirst($text))
3891             if defined $::RD_TRACE;
3892 1         4 push @item, $item{__PATTERN1__}=$current_match;
3893            
3894              
3895 1 50       5 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [filename]},
3896             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3897             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3898             $tracelevel)
3899             if defined $::RD_TRACE;
3900 8     8   67 if (1) { no strict qw{refs};
  8         20  
  8         4794  
  1         2  
3901 1         3 $expectation->is(q{filename})->at($text);
3902 1 50   1   20 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::filename($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1         4  
3903             {
3904            
3905 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
3906             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3907             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3908             $tracelevel)
3909             if defined $::RD_TRACE;
3910 0         0 $expectation->failed();
3911 0         0 last;
3912             }
3913 1 50       7 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [filename]<< (return value: [}
3914             . $_tok . q{]},
3915              
3916             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3917             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3918             $tracelevel)
3919             if defined $::RD_TRACE;
3920 1         9 $item{q{filename}} = $_tok;
3921 1         5 push @item, $_tok;
3922            
3923             }
3924              
3925 1 50       5 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
3926             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3927             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3928             $tracelevel)
3929             if defined $::RD_TRACE;
3930            
3931              
3932 1 50       4 $_tok = ($_noactions) ? 0 : do { [ 'string/input-pipe' => $item[2] ] };
  1         4  
3933 1 50       4 unless (defined $_tok)
3934             {
3935 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
3936             if defined $::RD_TRACE;
3937 0         0 last;
3938             }
3939 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
3940             . $_tok . q{])},
3941             XML::XSH2::Parser::_Runtime::_tracefirst($text))
3942             if defined $::RD_TRACE;
3943 1         3 push @item, $_tok;
3944 1         3 $item{__ACTION1__}=$_tok;
3945            
3946              
3947 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/--input-pipe|:p/ filename]<<},
3948             XML::XSH2::Parser::_Runtime::_tracefirst($text),
3949             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3950             $tracelevel)
3951             if defined $::RD_TRACE;
3952              
3953              
3954              
3955 1         3 $_matched = 1;
3956 1         2 last;
3957             }
3958              
3959              
3960 6   66     33 while (!$_matched && !$commit)
3961             {
3962            
3963 5 50       13 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/--input-string|:s/ exp]},
3964             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
3965             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3966             $tracelevel)
3967             if defined $::RD_TRACE;
3968 5         10 my $thisprod = $thisrule->{"prods"}[2];
3969 5         12 $text = $_[1];
3970 5         7 my $_savetext;
3971 5         16 @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
3972 5         15 %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
3973 5         8 my $repcount = 0;
3974              
3975              
3976 5 50       11 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/--input-string|:s/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
3977             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
3978             $tracelevel)
3979             if defined $::RD_TRACE;
3980 5         11 undef $lastsep;
3981 5         13 $expectation->is(q{})->at($text);
3982            
3983              
3984 5 50 66     59 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:--input-string|:s)/)
  5 100       63  
3985             {
3986 4 50       18 $text = $lastsep . $text if defined $lastsep;
3987 4         14 $expectation->failed();
3988 4 50       12 XML::XSH2::Parser::_Runtime::_trace(q{<>},
3989             XML::XSH2::Parser::_Runtime::_tracefirst($text))
3990             if defined $::RD_TRACE;
3991              
3992 4         8 last;
3993             }
3994 1         7 $current_match = substr($text, $-[0], $+[0] - $-[0]);
3995 1         4 substr($text,0,length($current_match),q{});
3996 1 50       5 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
3997             . $current_match . q{])},
3998             XML::XSH2::Parser::_Runtime::_tracefirst($text))
3999             if defined $::RD_TRACE;
4000 1         4 push @item, $item{__PATTERN1__}=$current_match;
4001            
4002              
4003 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
4004             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4005             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4006             $tracelevel)
4007             if defined $::RD_TRACE;
4008 8     8   72 if (1) { no strict qw{refs};
  8         18  
  8         5232  
  1         3  
4009 1         3 $expectation->is(q{exp})->at($text);
4010 1 50   1   16 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1         3  
4011             {
4012            
4013 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4014             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4015             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4016             $tracelevel)
4017             if defined $::RD_TRACE;
4018 0         0 $expectation->failed();
4019 0         0 last;
4020             }
4021 1 50       5 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
4022             . $_tok . q{]},
4023              
4024             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4025             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4026             $tracelevel)
4027             if defined $::RD_TRACE;
4028 1         3 $item{q{exp}} = $_tok;
4029 1         3 push @item, $_tok;
4030            
4031             }
4032              
4033 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
4034             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4035             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4036             $tracelevel)
4037             if defined $::RD_TRACE;
4038            
4039              
4040 1 50       3 $_tok = ($_noactions) ? 0 : do { [ 'exp/input-string' => $item[2] ] };
  1         3  
4041 1 50       5 unless (defined $_tok)
4042             {
4043 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
4044             if defined $::RD_TRACE;
4045 0         0 last;
4046             }
4047 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
4048             . $_tok . q{])},
4049             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4050             if defined $::RD_TRACE;
4051 1         2 push @item, $_tok;
4052 1         2 $item{__ACTION1__}=$_tok;
4053            
4054              
4055 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/--input-string|:s/ exp]<<},
4056             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4057             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4058             $tracelevel)
4059             if defined $::RD_TRACE;
4060              
4061              
4062              
4063 1         2 $_matched = 1;
4064 1         2 last;
4065             }
4066              
4067              
4068 6   66     30 while (!$_matched && !$commit)
4069             {
4070            
4071 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/--output-file|:F/ filename]},
4072             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4073             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4074             $tracelevel)
4075             if defined $::RD_TRACE;
4076 4         12 my $thisprod = $thisrule->{"prods"}[3];
4077 4         9 $text = $_[1];
4078 4         9 my $_savetext;
4079 4         10 @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
4080 4         11 %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
4081 4         9 my $repcount = 0;
4082              
4083              
4084 4 50       10 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/--output-file|:F/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
4085             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4086             $tracelevel)
4087             if defined $::RD_TRACE;
4088 4         7 undef $lastsep;
4089 4         15 $expectation->is(q{})->at($text);
4090            
4091              
4092 4 50 33     62 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:--output-file|:F)/)
  4 50       52  
4093             {
4094 4 50       13 $text = $lastsep . $text if defined $lastsep;
4095 4         14 $expectation->failed();
4096 4 50       9 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4097             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4098             if defined $::RD_TRACE;
4099              
4100 4         9 last;
4101             }
4102 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
4103 0         0 substr($text,0,length($current_match),q{});
4104 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
4105             . $current_match . q{])},
4106             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4107             if defined $::RD_TRACE;
4108 0         0 push @item, $item{__PATTERN1__}=$current_match;
4109            
4110              
4111 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [filename]},
4112             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4113             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4114             $tracelevel)
4115             if defined $::RD_TRACE;
4116 8     8   69 if (1) { no strict qw{refs};
  8         17  
  8         5276  
  0         0  
4117 0         0 $expectation->is(q{filename})->at($text);
4118 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::filename($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
4119             {
4120            
4121 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4122             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4123             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4124             $tracelevel)
4125             if defined $::RD_TRACE;
4126 0         0 $expectation->failed();
4127 0         0 last;
4128             }
4129 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [filename]<< (return value: [}
4130             . $_tok . q{]},
4131              
4132             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4133             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4134             $tracelevel)
4135             if defined $::RD_TRACE;
4136 0         0 $item{q{filename}} = $_tok;
4137 0         0 push @item, $_tok;
4138            
4139             }
4140              
4141 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
4142             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4143             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4144             $tracelevel)
4145             if defined $::RD_TRACE;
4146            
4147              
4148 0 0       0 $_tok = ($_noactions) ? 0 : do { [ 'string/output-file' => $item[2] ] };
  0         0  
4149 0 0       0 unless (defined $_tok)
4150             {
4151 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
4152             if defined $::RD_TRACE;
4153 0         0 last;
4154             }
4155 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
4156             . $_tok . q{])},
4157             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4158             if defined $::RD_TRACE;
4159 0         0 push @item, $_tok;
4160 0         0 $item{__ACTION1__}=$_tok;
4161            
4162              
4163 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/--output-file|:F/ filename]<<},
4164             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4165             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4166             $tracelevel)
4167             if defined $::RD_TRACE;
4168              
4169              
4170              
4171 0         0 $_matched = 1;
4172 0         0 last;
4173             }
4174              
4175              
4176 6   66     32 while (!$_matched && !$commit)
4177             {
4178            
4179 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/--output-encoding|:E/ enc_string]},
4180             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4181             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4182             $tracelevel)
4183             if defined $::RD_TRACE;
4184 4         11 my $thisprod = $thisrule->{"prods"}[4];
4185 4         7 $text = $_[1];
4186 4         7 my $_savetext;
4187 4         12 @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
4188 4         10 %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
4189 4         7 my $repcount = 0;
4190              
4191              
4192 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/--output-encoding|:E/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
4193             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4194             $tracelevel)
4195             if defined $::RD_TRACE;
4196 4         6 undef $lastsep;
4197 4         12 $expectation->is(q{})->at($text);
4198            
4199              
4200 4 50 33     52 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:--output-encoding|:E)/)
  4 50       50  
4201             {
4202 4 50       14 $text = $lastsep . $text if defined $lastsep;
4203 4         16 $expectation->failed();
4204 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4205             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4206             if defined $::RD_TRACE;
4207              
4208 4         9 last;
4209             }
4210 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
4211 0         0 substr($text,0,length($current_match),q{});
4212 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
4213             . $current_match . q{])},
4214             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4215             if defined $::RD_TRACE;
4216 0         0 push @item, $item{__PATTERN1__}=$current_match;
4217            
4218              
4219 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [enc_string]},
4220             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4221             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4222             $tracelevel)
4223             if defined $::RD_TRACE;
4224 8     8   65 if (1) { no strict qw{refs};
  8         18  
  8         5351  
  0         0  
4225 0         0 $expectation->is(q{enc_string})->at($text);
4226 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::enc_string($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
4227             {
4228            
4229 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4230             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4231             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4232             $tracelevel)
4233             if defined $::RD_TRACE;
4234 0         0 $expectation->failed();
4235 0         0 last;
4236             }
4237 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [enc_string]<< (return value: [}
4238             . $_tok . q{]},
4239              
4240             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4241             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4242             $tracelevel)
4243             if defined $::RD_TRACE;
4244 0         0 $item{q{enc_string}} = $_tok;
4245 0         0 push @item, $_tok;
4246            
4247             }
4248              
4249 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
4250             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4251             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4252             $tracelevel)
4253             if defined $::RD_TRACE;
4254            
4255              
4256 0 0       0 $_tok = ($_noactions) ? 0 : do { [ 'string/output-encoding' => $item[2] ] };
  0         0  
4257 0 0       0 unless (defined $_tok)
4258             {
4259 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
4260             if defined $::RD_TRACE;
4261 0         0 last;
4262             }
4263 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
4264             . $_tok . q{])},
4265             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4266             if defined $::RD_TRACE;
4267 0         0 push @item, $_tok;
4268 0         0 $item{__ACTION1__}=$_tok;
4269            
4270              
4271 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/--output-encoding|:E/ enc_string]<<},
4272             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4273             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4274             $tracelevel)
4275             if defined $::RD_TRACE;
4276              
4277              
4278              
4279 0         0 $_matched = 1;
4280 0         0 last;
4281             }
4282              
4283              
4284 6   66     33 while (!$_matched && !$commit)
4285             {
4286            
4287 4 50       12 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/--output-pipe|:P/ filename]},
4288             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4289             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4290             $tracelevel)
4291             if defined $::RD_TRACE;
4292 4         11 my $thisprod = $thisrule->{"prods"}[5];
4293 4         8 $text = $_[1];
4294 4         7 my $_savetext;
4295 4         11 @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
4296 4         11 %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
4297 4         6 my $repcount = 0;
4298              
4299              
4300 4 50       12 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/--output-pipe|:P/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
4301             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4302             $tracelevel)
4303             if defined $::RD_TRACE;
4304 4         8 undef $lastsep;
4305 4         9 $expectation->is(q{})->at($text);
4306            
4307              
4308 4 50 33     56 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:--output-pipe|:P)/)
  4 50       52  
4309             {
4310 4 50       20 $text = $lastsep . $text if defined $lastsep;
4311 4         13 $expectation->failed();
4312 4 50       10 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4313             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4314             if defined $::RD_TRACE;
4315              
4316 4         9 last;
4317             }
4318 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
4319 0         0 substr($text,0,length($current_match),q{});
4320 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
4321             . $current_match . q{])},
4322             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4323             if defined $::RD_TRACE;
4324 0         0 push @item, $item{__PATTERN1__}=$current_match;
4325            
4326              
4327 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [filename]},
4328             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4329             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4330             $tracelevel)
4331             if defined $::RD_TRACE;
4332 8     8   67 if (1) { no strict qw{refs};
  8         16  
  8         5378  
  0         0  
4333 0         0 $expectation->is(q{filename})->at($text);
4334 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::filename($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
4335             {
4336            
4337 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4338             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4339             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4340             $tracelevel)
4341             if defined $::RD_TRACE;
4342 0         0 $expectation->failed();
4343 0         0 last;
4344             }
4345 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [filename]<< (return value: [}
4346             . $_tok . q{]},
4347              
4348             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4349             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4350             $tracelevel)
4351             if defined $::RD_TRACE;
4352 0         0 $item{q{filename}} = $_tok;
4353 0         0 push @item, $_tok;
4354            
4355             }
4356              
4357 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
4358             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4359             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4360             $tracelevel)
4361             if defined $::RD_TRACE;
4362            
4363              
4364 0 0       0 $_tok = ($_noactions) ? 0 : do { [ 'string/output-pipe' => $item[2] ] };
  0         0  
4365 0 0       0 unless (defined $_tok)
4366             {
4367 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
4368             if defined $::RD_TRACE;
4369 0         0 last;
4370             }
4371 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
4372             . $_tok . q{])},
4373             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4374             if defined $::RD_TRACE;
4375 0         0 push @item, $_tok;
4376 0         0 $item{__ACTION1__}=$_tok;
4377            
4378              
4379 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/--output-pipe|:P/ filename]<<},
4380             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4381             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4382             $tracelevel)
4383             if defined $::RD_TRACE;
4384              
4385              
4386              
4387 0         0 $_matched = 1;
4388 0         0 last;
4389             }
4390              
4391              
4392 6   66     30 while (!$_matched && !$commit)
4393             {
4394            
4395 4 50       14 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/--output-string|:S/ exp]},
4396             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4397             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4398             $tracelevel)
4399             if defined $::RD_TRACE;
4400 4         10 my $thisprod = $thisrule->{"prods"}[6];
4401 4         9 $text = $_[1];
4402 4         6 my $_savetext;
4403 4         10 @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
4404 4         11 %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
4405 4         5 my $repcount = 0;
4406              
4407              
4408 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/--output-string|:S/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
4409             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4410             $tracelevel)
4411             if defined $::RD_TRACE;
4412 4         6 undef $lastsep;
4413 4         36 $expectation->is(q{})->at($text);
4414            
4415              
4416 4 50 33     55 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:--output-string|:S)/)
  4 50       55  
4417             {
4418 4 50       16 $text = $lastsep . $text if defined $lastsep;
4419 4         12 $expectation->failed();
4420 4 50       13 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4421             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4422             if defined $::RD_TRACE;
4423              
4424 4         10 last;
4425             }
4426 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
4427 0         0 substr($text,0,length($current_match),q{});
4428 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
4429             . $current_match . q{])},
4430             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4431             if defined $::RD_TRACE;
4432 0         0 push @item, $item{__PATTERN1__}=$current_match;
4433            
4434              
4435 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
4436             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4437             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4438             $tracelevel)
4439             if defined $::RD_TRACE;
4440 8     8   66 if (1) { no strict qw{refs};
  8         18  
  8         10575  
  0         0  
4441 0         0 $expectation->is(q{exp})->at($text);
4442 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
4443             {
4444            
4445 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4446             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4447             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4448             $tracelevel)
4449             if defined $::RD_TRACE;
4450 0         0 $expectation->failed();
4451 0         0 last;
4452             }
4453 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
4454             . $_tok . q{]},
4455              
4456             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4457             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4458             $tracelevel)
4459             if defined $::RD_TRACE;
4460 0         0 $item{q{exp}} = $_tok;
4461 0         0 push @item, $_tok;
4462            
4463             }
4464              
4465 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
4466             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4467             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4468             $tracelevel)
4469             if defined $::RD_TRACE;
4470            
4471              
4472 0 0       0 $_tok = ($_noactions) ? 0 : do { [ 'varname/output-string' => $item[2] ] };
  0         0  
4473 0 0       0 unless (defined $_tok)
4474             {
4475 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
4476             if defined $::RD_TRACE;
4477 0         0 last;
4478             }
4479 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
4480             . $_tok . q{])},
4481             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4482             if defined $::RD_TRACE;
4483 0         0 push @item, $_tok;
4484 0         0 $item{__ACTION1__}=$_tok;
4485            
4486              
4487 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/--output-string|:S/ exp]<<},
4488             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4489             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4490             $tracelevel)
4491             if defined $::RD_TRACE;
4492              
4493              
4494              
4495 0         0 $_matched = 1;
4496 0         0 last;
4497             }
4498              
4499              
4500 6   66     29 while (!$_matched && !$commit)
4501             {
4502            
4503 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/--no-output|:N/]},
4504             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4505             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4506             $tracelevel)
4507             if defined $::RD_TRACE;
4508 4         10 my $thisprod = $thisrule->{"prods"}[7];
4509 4         9 $text = $_[1];
4510 4         6 my $_savetext;
4511 4         10 @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
4512 4         12 %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command});
4513 4         7 my $repcount = 0;
4514              
4515              
4516 4 50       10 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/--no-output|:N/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
4517             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4518             $tracelevel)
4519             if defined $::RD_TRACE;
4520 4         6 undef $lastsep;
4521 4         12 $expectation->is(q{})->at($text);
4522            
4523              
4524 4 50 66     55 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:--no-output|:N)/)
  4 100       49  
4525             {
4526 2 50       8 $text = $lastsep . $text if defined $lastsep;
4527 2         7 $expectation->failed();
4528 2 50       6 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4529             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4530             if defined $::RD_TRACE;
4531              
4532 2         4 last;
4533             }
4534 2         17 $current_match = substr($text, $-[0], $+[0] - $-[0]);
4535 2         9 substr($text,0,length($current_match),q{});
4536 2 50       12 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
4537             . $current_match . q{])},
4538             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4539             if defined $::RD_TRACE;
4540 2         9 push @item, $item{__PATTERN1__}=$current_match;
4541            
4542              
4543 2 50       7 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
4544             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4545             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4546             $tracelevel)
4547             if defined $::RD_TRACE;
4548            
4549              
4550 2 50       7 $_tok = ($_noactions) ? 0 : do { [ '/no-output' => 1 ] };
  2         7  
4551 2 50       7 unless (defined $_tok)
4552             {
4553 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
4554             if defined $::RD_TRACE;
4555 0         0 last;
4556             }
4557 2 50       6 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
4558             . $_tok . q{])},
4559             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4560             if defined $::RD_TRACE;
4561 2         7 push @item, $_tok;
4562 2         5 $item{__ACTION1__}=$_tok;
4563            
4564              
4565 2 50       5 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/--no-output|:N/]<<},
4566             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4567             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4568             $tracelevel)
4569             if defined $::RD_TRACE;
4570              
4571              
4572              
4573 2         4 $_matched = 1;
4574 2         4 last;
4575             }
4576              
4577              
4578 6 100 66     34 unless ( $_matched || defined($score) )
4579             {
4580            
4581              
4582 2         8 $_[1] = $text; # NOT SURE THIS IS NEEDED
4583 2 50       6 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4584             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4585             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4586             $tracelevel)
4587             if defined $::RD_TRACE;
4588 2         17 return undef;
4589             }
4590 4 50 33     25 if (!defined($return) && defined($score))
4591             {
4592 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
4593             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4594             $tracelevel)
4595             if defined $::RD_TRACE;
4596 0         0 $return = $score_return;
4597             }
4598 4         9 splice @{$thisparser->{errors}}, $err_at;
  4         12  
4599 4 50       13 $return = $item[$#item] unless defined $return;
4600 4 50       12 if (defined $::RD_TRACE)
4601             {
4602 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
4603             $return . q{])}, "",
4604             q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4605             $tracelevel);
4606 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
4607             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
4608             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4609             , q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command},
4610             $tracelevel)
4611             }
4612 4         11 $_[1] = $text;
4613 4         32 return $return;
4614             }
4615              
4616             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
4617             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::_alternation_1_of_production_1_of_rule_local_var
4618             {
4619 23     23   69 my $thisparser = $_[0];
4620 8     8   71 use vars q{$tracelevel};
  8         20  
  8         6946  
4621 23   50     93 local $tracelevel = ($tracelevel||0)+1;
4622 23         44 $ERRORS = 0;
4623 23         72 my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_local_var"};
4624              
4625 23 50       76 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [_alternation_1_of_production_1_of_rule_local_var]},
4626             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4627             q{_alternation_1_of_production_1_of_rule_local_var},
4628             $tracelevel)
4629             if defined $::RD_TRACE;
4630              
4631            
4632 23         37 my $err_at = @{$thisparser->{errors}};
  23         60  
4633              
4634 23         69 my $score;
4635             my $score_return;
4636 23         0 my $_tok;
4637 23         53 my $return = undef;
4638 23         51 my $_matched=0;
4639 23         32 my $commit=0;
4640 23         62 my @item = ();
4641 23         54 my %item = ();
4642 23         46 my $repeating = $_[2];
4643 23         43 my $_noactions = $_[3];
4644 23 50       77 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  23         44  
  23         46  
4645 23         46 my $_itempos = $_[5];
4646 23 50       72 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
4647 23         74 my $text;
4648             my $lastsep;
4649 23         0 my $current_match;
4650 23         58 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(local|my)\\s/});
4651 23         71 $expectation->at($_[1]);
4652            
4653 23         38 my $thisoffset;
4654 23         91 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
4655            
4656 23         46 my $thiscolumn;
4657 23         67 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
4658            
4659 23         54 my $thisline;
4660 23         68 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
4661              
4662            
4663              
4664 23   33     155 while (!$_matched && !$commit)
4665             {
4666            
4667 23 50       94 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(local|my)\\s/]},
4668             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4669             q{_alternation_1_of_production_1_of_rule_local_var},
4670             $tracelevel)
4671             if defined $::RD_TRACE;
4672 23         77 my $thisprod = $thisrule->{"prods"}[0];
4673 23         53 $text = $_[1];
4674 23         37 my $_savetext;
4675 23         69 @item = (q{_alternation_1_of_production_1_of_rule_local_var});
4676 23         74 %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_local_var});
4677 23         44 my $repcount = 0;
4678              
4679              
4680 23 50       64 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(local|my)\\s/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
4681             q{_alternation_1_of_production_1_of_rule_local_var},
4682             $tracelevel)
4683             if defined $::RD_TRACE;
4684 23         53 undef $lastsep;
4685 23         78 $expectation->is(q{})->at($text);
4686            
4687              
4688 23 50 66     445 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(local|my)\s)/)
  23 100       352  
4689             {
4690 16 50       71 $text = $lastsep . $text if defined $lastsep;
4691 16         54 $expectation->failed();
4692 16 50       49 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4693             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4694             if defined $::RD_TRACE;
4695              
4696 16         37 last;
4697             }
4698 7         66 $current_match = substr($text, $-[0], $+[0] - $-[0]);
4699 7         35 substr($text,0,length($current_match),q{});
4700 7 50       32 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
4701             . $current_match . q{])},
4702             XML::XSH2::Parser::_Runtime::_tracefirst($text))
4703             if defined $::RD_TRACE;
4704 7         26 push @item, $item{__PATTERN1__}=$current_match;
4705            
4706              
4707 7 50       31 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(local|my)\\s/]<<},
4708             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4709             q{_alternation_1_of_production_1_of_rule_local_var},
4710             $tracelevel)
4711             if defined $::RD_TRACE;
4712              
4713              
4714              
4715 7         14 $_matched = 1;
4716 7         18 last;
4717             }
4718              
4719              
4720 23 100 66     145 unless ( $_matched || defined($score) )
4721             {
4722            
4723              
4724 16         41 $_[1] = $text; # NOT SURE THIS IS NEEDED
4725 16 50       46 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4726             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4727             q{_alternation_1_of_production_1_of_rule_local_var},
4728             $tracelevel)
4729             if defined $::RD_TRACE;
4730 16         112 return undef;
4731             }
4732 7 50 33     59 if (!defined($return) && defined($score))
4733             {
4734 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
4735             q{_alternation_1_of_production_1_of_rule_local_var},
4736             $tracelevel)
4737             if defined $::RD_TRACE;
4738 0         0 $return = $score_return;
4739             }
4740 7         24 splice @{$thisparser->{errors}}, $err_at;
  7         25  
4741 7 50       30 $return = $item[$#item] unless defined $return;
4742 7 50       22 if (defined $::RD_TRACE)
4743             {
4744 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
4745             $return . q{])}, "",
4746             q{_alternation_1_of_production_1_of_rule_local_var},
4747             $tracelevel);
4748 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
4749             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
4750             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4751             , q{_alternation_1_of_production_1_of_rule_local_var},
4752             $tracelevel)
4753             }
4754 7         20 $_[1] = $text;
4755 7         55 return $return;
4756             }
4757              
4758             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
4759             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::_alternation_1_of_production_1_of_rule_xpcont
4760             {
4761 931     931   1565 my $thisparser = $_[0];
4762 8     8   72 use vars q{$tracelevel};
  8         20  
  8         3462  
4763 931   50     2148 local $tracelevel = ($tracelevel||0)+1;
4764 931         1460 $ERRORS = 0;
4765 931         1824 my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_xpcont"};
4766              
4767 931 50       1808 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [_alternation_1_of_production_1_of_rule_xpcont]},
4768             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4769             q{_alternation_1_of_production_1_of_rule_xpcont},
4770             $tracelevel)
4771             if defined $::RD_TRACE;
4772              
4773            
4774 931         1234 my $err_at = @{$thisparser->{errors}};
  931         1501  
4775              
4776 931         2206 my $score;
4777             my $score_return;
4778 931         0 my $_tok;
4779 931         1469 my $return = undef;
4780 931         1267 my $_matched=0;
4781 931         1298 my $commit=0;
4782 931         1340 my @item = ();
4783 931         1358 my %item = ();
4784 931         1395 my $repeating = $_[2];
4785 931         1254 my $_noactions = $_[3];
4786 931 50       1735 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  931         1162  
  931         1533  
4787 931         1459 my $_itempos = $_[5];
4788 931 50       2130 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
4789 931         2058 my $text;
4790             my $lastsep;
4791 931         0 my $current_match;
4792 931         1832 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{xpfilters, or xpbrackets});
4793 931         2416 $expectation->at($_[1]);
4794            
4795 931         1261 my $thisoffset;
4796 931         2404 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
4797            
4798 931         1561 my $thiscolumn;
4799 931         2013 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
4800            
4801 931         1439 my $thisline;
4802 931         2022 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
4803              
4804            
4805              
4806 931   33     3889 while (!$_matched && !$commit)
4807             {
4808            
4809 931 50       1858 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xpfilters]},
4810             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4811             q{_alternation_1_of_production_1_of_rule_xpcont},
4812             $tracelevel)
4813             if defined $::RD_TRACE;
4814 931         1981 my $thisprod = $thisrule->{"prods"}[0];
4815 931         1655 $text = $_[1];
4816 931         1251 my $_savetext;
4817 931         1722 @item = (q{_alternation_1_of_production_1_of_rule_xpcont});
4818 931         1713 %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_xpcont});
4819 931         1284 my $repcount = 0;
4820              
4821              
4822 931 50       1733 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpfilters]},
4823             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4824             q{_alternation_1_of_production_1_of_rule_xpcont},
4825             $tracelevel)
4826             if defined $::RD_TRACE;
4827 8     8   64 if (1) { no strict qw{refs};
  8         18  
  8         2486  
  931         1217  
4828 931         1791 $expectation->is(q{})->at($text);
4829 931 100   931   4266 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpfilters($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  931         1568  
4830             {
4831            
4832 920 50       1876 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4833             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4834             q{_alternation_1_of_production_1_of_rule_xpcont},
4835             $tracelevel)
4836             if defined $::RD_TRACE;
4837 920         2280 $expectation->failed();
4838 920         1531 last;
4839             }
4840 11 50       45 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpfilters]<< (return value: [}
4841             . $_tok . q{]},
4842              
4843             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4844             q{_alternation_1_of_production_1_of_rule_xpcont},
4845             $tracelevel)
4846             if defined $::RD_TRACE;
4847 11         30 $item{q{xpfilters}} = $_tok;
4848 11         26 push @item, $_tok;
4849            
4850             }
4851              
4852 11 50       32 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xpfilters]<<},
4853             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4854             q{_alternation_1_of_production_1_of_rule_xpcont},
4855             $tracelevel)
4856             if defined $::RD_TRACE;
4857              
4858              
4859              
4860 11         18 $_matched = 1;
4861 11         20 last;
4862             }
4863              
4864              
4865 931   66     4646 while (!$_matched && !$commit)
4866             {
4867            
4868 920 50       1900 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xpbrackets]},
4869             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4870             q{_alternation_1_of_production_1_of_rule_xpcont},
4871             $tracelevel)
4872             if defined $::RD_TRACE;
4873 920         1787 my $thisprod = $thisrule->{"prods"}[1];
4874 920         1691 $text = $_[1];
4875 920         1244 my $_savetext;
4876 920         1800 @item = (q{_alternation_1_of_production_1_of_rule_xpcont});
4877 920         1835 %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_xpcont});
4878 920         1382 my $repcount = 0;
4879              
4880              
4881 920 50       1803 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpbrackets]},
4882             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4883             q{_alternation_1_of_production_1_of_rule_xpcont},
4884             $tracelevel)
4885             if defined $::RD_TRACE;
4886 8     8   61 if (1) { no strict qw{refs};
  8         29  
  8         3967  
  920         1234  
4887 920         1852 $expectation->is(q{})->at($text);
4888 920 100   920   4147 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpbrackets($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  920         1680  
4889             {
4890            
4891 618 50       1391 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4892             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4893             q{_alternation_1_of_production_1_of_rule_xpcont},
4894             $tracelevel)
4895             if defined $::RD_TRACE;
4896 618         1445 $expectation->failed();
4897 618         957 last;
4898             }
4899 302 50       1100 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpbrackets]<< (return value: [}
4900             . $_tok . q{]},
4901              
4902             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4903             q{_alternation_1_of_production_1_of_rule_xpcont},
4904             $tracelevel)
4905             if defined $::RD_TRACE;
4906 302         659 $item{q{xpbrackets}} = $_tok;
4907 302         552 push @item, $_tok;
4908            
4909             }
4910              
4911 302 50       636 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xpbrackets]<<},
4912             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4913             q{_alternation_1_of_production_1_of_rule_xpcont},
4914             $tracelevel)
4915             if defined $::RD_TRACE;
4916              
4917              
4918              
4919 302         521 $_matched = 1;
4920 302         514 last;
4921             }
4922              
4923              
4924 931 100 66     3855 unless ( $_matched || defined($score) )
4925             {
4926            
4927              
4928 618         1095 $_[1] = $text; # NOT SURE THIS IS NEEDED
4929 618 50       1293 XML::XSH2::Parser::_Runtime::_trace(q{<>},
4930             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4931             q{_alternation_1_of_production_1_of_rule_xpcont},
4932             $tracelevel)
4933             if defined $::RD_TRACE;
4934 618         3203 return undef;
4935             }
4936 313 50 33     1284 if (!defined($return) && defined($score))
4937             {
4938 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
4939             q{_alternation_1_of_production_1_of_rule_xpcont},
4940             $tracelevel)
4941             if defined $::RD_TRACE;
4942 0         0 $return = $score_return;
4943             }
4944 313         522 splice @{$thisparser->{errors}}, $err_at;
  313         684  
4945 313 50       818 $return = $item[$#item] unless defined $return;
4946 313 50       718 if (defined $::RD_TRACE)
4947             {
4948 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
4949             $return . q{])}, "",
4950             q{_alternation_1_of_production_1_of_rule_xpcont},
4951             $tracelevel);
4952 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
4953             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
4954             XML::XSH2::Parser::_Runtime::_tracefirst($text),
4955             , q{_alternation_1_of_production_1_of_rule_xpcont},
4956             $tracelevel)
4957             }
4958 313         576 $_[1] = $text;
4959 313         1948 return $return;
4960             }
4961              
4962             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
4963             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::_alternation_1_of_production_1_of_rule_xpintercont
4964             {
4965 1647     1647   2591 my $thisparser = $_[0];
4966 8     8   66 use vars q{$tracelevel};
  8         26  
  8         3245  
4967 1647   50     3724 local $tracelevel = ($tracelevel||0)+1;
4968 1647         2261 $ERRORS = 0;
4969 1647         2807 my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_xpintercont"};
4970              
4971 1647 50       3221 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [_alternation_1_of_production_1_of_rule_xpintercont]},
4972             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
4973             q{_alternation_1_of_production_1_of_rule_xpintercont},
4974             $tracelevel)
4975             if defined $::RD_TRACE;
4976              
4977            
4978 1647         1966 my $err_at = @{$thisparser->{errors}};
  1647         2992  
4979              
4980 1647         3775 my $score;
4981             my $score_return;
4982 1647         0 my $_tok;
4983 1647         2109 my $return = undef;
4984 1647         2026 my $_matched=0;
4985 1647         2136 my $commit=0;
4986 1647         2715 my @item = ();
4987 1647         2180 my %item = ();
4988 1647         2240 my $repeating = $_[2];
4989 1647         2229 my $_noactions = $_[3];
4990 1647 50       2878 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  1647         2106  
  1647         2725  
4991 1647         2355 my $_itempos = $_[5];
4992 1647 50       3337 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
4993 1647         3565 my $text;
4994             my $lastsep;
4995 1647         0 my $current_match;
4996 1647         3094 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{xpfilters, or xpbrackets});
4997 1647         3985 $expectation->at($_[1]);
4998            
4999 1647         2009 my $thisoffset;
5000 1647         4180 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
5001            
5002 1647         2518 my $thiscolumn;
5003 1647         3311 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
5004            
5005 1647         2543 my $thisline;
5006 1647         3354 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
5007              
5008            
5009              
5010 1647   33     6334 while (!$_matched && !$commit)
5011             {
5012            
5013 1647 50       3278 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xpfilters]},
5014             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
5015             q{_alternation_1_of_production_1_of_rule_xpintercont},
5016             $tracelevel)
5017             if defined $::RD_TRACE;
5018 1647         3111 my $thisprod = $thisrule->{"prods"}[0];
5019 1647         2586 $text = $_[1];
5020 1647         2258 my $_savetext;
5021 1647         2841 @item = (q{_alternation_1_of_production_1_of_rule_xpintercont});
5022 1647         2855 %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_xpintercont});
5023 1647         2279 my $repcount = 0;
5024              
5025              
5026 1647 50       2907 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpfilters]},
5027             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5028             q{_alternation_1_of_production_1_of_rule_xpintercont},
5029             $tracelevel)
5030             if defined $::RD_TRACE;
5031 8     8   66 if (1) { no strict qw{refs};
  8         18  
  8         2452  
  1647         2079  
5032 1647         3091 $expectation->is(q{})->at($text);
5033 1647 100   1139   7488 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpfilters($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1647         2735  
5034             {
5035            
5036 1565 50       3332 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5037             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5038             q{_alternation_1_of_production_1_of_rule_xpintercont},
5039             $tracelevel)
5040             if defined $::RD_TRACE;
5041 1565         3322 $expectation->failed();
5042 1565         2627 last;
5043             }
5044 82 50       273 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpfilters]<< (return value: [}
5045             . $_tok . q{]},
5046              
5047             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5048             q{_alternation_1_of_production_1_of_rule_xpintercont},
5049             $tracelevel)
5050             if defined $::RD_TRACE;
5051 82         191 $item{q{xpfilters}} = $_tok;
5052 82         152 push @item, $_tok;
5053            
5054             }
5055              
5056 82 50       189 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xpfilters]<<},
5057             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5058             q{_alternation_1_of_production_1_of_rule_xpintercont},
5059             $tracelevel)
5060             if defined $::RD_TRACE;
5061              
5062              
5063              
5064 82         120 $_matched = 1;
5065 82         128 last;
5066             }
5067              
5068              
5069 1647   66     7707 while (!$_matched && !$commit)
5070             {
5071            
5072 1565 50       2883 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xpbrackets]},
5073             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
5074             q{_alternation_1_of_production_1_of_rule_xpintercont},
5075             $tracelevel)
5076             if defined $::RD_TRACE;
5077 1565         2873 my $thisprod = $thisrule->{"prods"}[1];
5078 1565         2565 $text = $_[1];
5079 1565         2145 my $_savetext;
5080 1565         3161 @item = (q{_alternation_1_of_production_1_of_rule_xpintercont});
5081 1565         3188 %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_xpintercont});
5082 1565         2192 my $repcount = 0;
5083              
5084              
5085 1565 50       3304 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpbrackets]},
5086             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5087             q{_alternation_1_of_production_1_of_rule_xpintercont},
5088             $tracelevel)
5089             if defined $::RD_TRACE;
5090 8     8   60 if (1) { no strict qw{refs};
  8         28  
  8         3772  
  1565         1830  
5091 1565         2756 $expectation->is(q{})->at($text);
5092 1565 100   1101   7072 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpbrackets($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1565         2832  
5093             {
5094            
5095 1150 50       2566 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5096             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5097             q{_alternation_1_of_production_1_of_rule_xpintercont},
5098             $tracelevel)
5099             if defined $::RD_TRACE;
5100 1150         2530 $expectation->failed();
5101 1150         1765 last;
5102             }
5103 415 50       1353 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpbrackets]<< (return value: [}
5104             . $_tok . q{]},
5105              
5106             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5107             q{_alternation_1_of_production_1_of_rule_xpintercont},
5108             $tracelevel)
5109             if defined $::RD_TRACE;
5110 415         928 $item{q{xpbrackets}} = $_tok;
5111 415         797 push @item, $_tok;
5112            
5113             }
5114              
5115 415 50       814 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xpbrackets]<<},
5116             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5117             q{_alternation_1_of_production_1_of_rule_xpintercont},
5118             $tracelevel)
5119             if defined $::RD_TRACE;
5120              
5121              
5122              
5123 415         574 $_matched = 1;
5124 415         651 last;
5125             }
5126              
5127              
5128 1647 100 66     6195 unless ( $_matched || defined($score) )
5129             {
5130            
5131              
5132 1150         2054 $_[1] = $text; # NOT SURE THIS IS NEEDED
5133 1150 50       2209 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5134             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
5135             q{_alternation_1_of_production_1_of_rule_xpintercont},
5136             $tracelevel)
5137             if defined $::RD_TRACE;
5138 1150         5577 return undef;
5139             }
5140 497 50 33     1740 if (!defined($return) && defined($score))
5141             {
5142 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
5143             q{_alternation_1_of_production_1_of_rule_xpintercont},
5144             $tracelevel)
5145             if defined $::RD_TRACE;
5146 0         0 $return = $score_return;
5147             }
5148 497         727 splice @{$thisparser->{errors}}, $err_at;
  497         969  
5149 497 50       1183 $return = $item[$#item] unless defined $return;
5150 497 50       1053 if (defined $::RD_TRACE)
5151             {
5152 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
5153             $return . q{])}, "",
5154             q{_alternation_1_of_production_1_of_rule_xpintercont},
5155             $tracelevel);
5156 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
5157             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
5158             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5159             , q{_alternation_1_of_production_1_of_rule_xpintercont},
5160             $tracelevel)
5161             }
5162 497         849 $_[1] = $text;
5163 497         2719 return $return;
5164             }
5165              
5166             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
5167             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::_alternation_1_of_production_2_of_rule_command
5168             {
5169 240     240   450 my $thisparser = $_[0];
5170 8     8   79 use vars q{$tracelevel};
  8         23  
  8         5762  
5171 240   50     715 local $tracelevel = ($tracelevel||0)+1;
5172 240         443 $ERRORS = 0;
5173 240         532 my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_2_of_rule_command"};
5174              
5175 240 50       565 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [_alternation_1_of_production_2_of_rule_command]},
5176             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
5177             q{_alternation_1_of_production_2_of_rule_command},
5178             $tracelevel)
5179             if defined $::RD_TRACE;
5180              
5181            
5182 240         321 my $err_at = @{$thisparser->{errors}};
  240         462  
5183              
5184 240         626 my $score;
5185             my $score_return;
5186 240         0 my $_tok;
5187 240         363 my $return = undef;
5188 240         400 my $_matched=0;
5189 240         341 my $commit=0;
5190 240         469 my @item = ();
5191 240         405 my %item = ();
5192 240         386 my $repeating = $_[2];
5193 240         332 my $_noactions = $_[3];
5194 240 50       591 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  240         344  
  240         431  
5195 240         452 my $_itempos = $_[5];
5196 240 50       558 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
5197 240         615 my $text;
5198             my $lastsep;
5199 240         0 my $current_match;
5200 240         509 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?=/, or /\\s*(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?:=/});
5201 240         660 $expectation->at($_[1]);
5202            
5203 240         331 my $thisoffset;
5204 240         792 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
5205            
5206 240         449 my $thiscolumn;
5207 240         659 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
5208            
5209 240         494 my $thisline;
5210 240         672 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
5211              
5212            
5213              
5214 240   33     1178 while (!$_matched && !$commit)
5215             {
5216            
5217 240 50       619 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?=/ loose_exp]},
5218             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
5219             q{_alternation_1_of_production_2_of_rule_command},
5220             $tracelevel)
5221             if defined $::RD_TRACE;
5222 240         640 my $thisprod = $thisrule->{"prods"}[0];
5223 240         542 $text = $_[1];
5224 240         397 my $_savetext;
5225 240         545 @item = (q{_alternation_1_of_production_2_of_rule_command});
5226 240         569 %item = (__RULE__ => q{_alternation_1_of_production_2_of_rule_command});
5227 240         409 my $repcount = 0;
5228              
5229              
5230 240 50       504 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?=/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
5231             q{_alternation_1_of_production_2_of_rule_command},
5232             $tracelevel)
5233             if defined $::RD_TRACE;
5234 240         440 undef $lastsep;
5235 240         536 $expectation->is(q{})->at($text);
5236            
5237              
5238 240 100 66     2425 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?:[\-\+\*\/%x.]|\|\||\&\&)?=)/)
  240 100       2956  
5239             {
5240 48 50       220 $text = $lastsep . $text if defined $lastsep;
5241 48         177 $expectation->failed();
5242 48 50       148 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5243             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5244             if defined $::RD_TRACE;
5245              
5246 48         114 last;
5247             }
5248 192         1307 $current_match = substr($text, $-[0], $+[0] - $-[0]);
5249 192         737 substr($text,0,length($current_match),q{});
5250 192 50       465 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
5251             . $current_match . q{])},
5252             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5253             if defined $::RD_TRACE;
5254 192         558 push @item, $item{__PATTERN1__}=$current_match;
5255            
5256              
5257            
5258              
5259 192 50       518 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
5260             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5261             q{_alternation_1_of_production_2_of_rule_command},
5262             $tracelevel)
5263             if defined $::RD_TRACE;
5264 192         285 $_tok = do { $commit = 1 };
  192         351  
5265 192 50       427 if (defined($_tok))
5266             {
5267 192 50       468 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
5268             . $_tok . q{])},
5269             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5270             if defined $::RD_TRACE;
5271             }
5272             else
5273             {
5274 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5275             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5276             if defined $::RD_TRACE;
5277             }
5278            
5279 192 50       433 last unless defined $_tok;
5280 192         463 push @item, $item{__DIRECTIVE1__}=$_tok;
5281            
5282              
5283 192 50       408 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [loose_exp]},
5284             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5285             q{_alternation_1_of_production_2_of_rule_command},
5286             $tracelevel)
5287             if defined $::RD_TRACE;
5288 8     8   74 if (1) { no strict qw{refs};
  8         20  
  8         5546  
  192         316  
5289 192         489 $expectation->is(q{loose_exp})->at($text);
5290 192 50   192   1173 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::loose_exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  192         411  
5291             {
5292            
5293 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5294             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5295             q{_alternation_1_of_production_2_of_rule_command},
5296             $tracelevel)
5297             if defined $::RD_TRACE;
5298 0         0 $expectation->failed();
5299 0         0 last;
5300             }
5301 192 50       750 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [loose_exp]<< (return value: [}
5302             . $_tok . q{]},
5303              
5304             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5305             q{_alternation_1_of_production_2_of_rule_command},
5306             $tracelevel)
5307             if defined $::RD_TRACE;
5308 192         478 $item{q{loose_exp}} = $_tok;
5309 192         417 push @item, $_tok;
5310            
5311             }
5312              
5313 192 50       501 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
5314             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5315             q{_alternation_1_of_production_2_of_rule_command},
5316             $tracelevel)
5317             if defined $::RD_TRACE;
5318            
5319              
5320 192 50       434 $_tok = ($_noactions) ? 0 : do { ['xpath_assign',$item[3],$item[1]] };
  192         609  
5321 192 50       476 unless (defined $_tok)
5322             {
5323 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
5324             if defined $::RD_TRACE;
5325 0         0 last;
5326             }
5327 192 50       441 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
5328             . $_tok . q{])},
5329             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5330             if defined $::RD_TRACE;
5331 192         357 push @item, $_tok;
5332 192         348 $item{__ACTION1__}=$_tok;
5333            
5334              
5335 192 50       459 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?=/ loose_exp]<<},
5336             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5337             q{_alternation_1_of_production_2_of_rule_command},
5338             $tracelevel)
5339             if defined $::RD_TRACE;
5340              
5341              
5342              
5343 192         300 $_matched = 1;
5344 192         396 last;
5345             }
5346              
5347              
5348 240   66     717 while (!$_matched && !$commit)
5349             {
5350            
5351 48 50       152 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/\\s*(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?:=/ command]},
5352             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
5353             q{_alternation_1_of_production_2_of_rule_command},
5354             $tracelevel)
5355             if defined $::RD_TRACE;
5356 48         121 my $thisprod = $thisrule->{"prods"}[1];
5357 48         127 $text = $_[1];
5358 48         79 my $_savetext;
5359 48         128 @item = (q{_alternation_1_of_production_2_of_rule_command});
5360 48         128 %item = (__RULE__ => q{_alternation_1_of_production_2_of_rule_command});
5361 48         89 my $repcount = 0;
5362              
5363              
5364 48 50       157 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/\\s*(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?:=/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
5365             q{_alternation_1_of_production_2_of_rule_command},
5366             $tracelevel)
5367             if defined $::RD_TRACE;
5368 48         99 undef $lastsep;
5369 48         114 $expectation->is(q{})->at($text);
5370            
5371              
5372 48 50 33     587 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:\s*(?:[\-\+\*\/%x.]|\|\||\&\&)?:=)/)
  48 50       685  
5373             {
5374 0 0       0 $text = $lastsep . $text if defined $lastsep;
5375 0         0 $expectation->failed();
5376 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5377             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5378             if defined $::RD_TRACE;
5379              
5380 0         0 last;
5381             }
5382 48         396 $current_match = substr($text, $-[0], $+[0] - $-[0]);
5383 48         200 substr($text,0,length($current_match),q{});
5384 48 50       137 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
5385             . $current_match . q{])},
5386             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5387             if defined $::RD_TRACE;
5388 48         190 push @item, $item{__PATTERN1__}=$current_match;
5389            
5390              
5391 48 50       124 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [command]},
5392             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5393             q{_alternation_1_of_production_2_of_rule_command},
5394             $tracelevel)
5395             if defined $::RD_TRACE;
5396 8     8   124 if (1) { no strict qw{refs};
  8         18  
  8         5269  
  48         76  
5397 48         143 $expectation->is(q{command})->at($text);
5398 48 50   48   448 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::command($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  48         101  
5399             {
5400            
5401 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5402             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5403             q{_alternation_1_of_production_2_of_rule_command},
5404             $tracelevel)
5405             if defined $::RD_TRACE;
5406 0         0 $expectation->failed();
5407 0         0 last;
5408             }
5409 48 50       213 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [command]<< (return value: [}
5410             . $_tok . q{]},
5411              
5412             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5413             q{_alternation_1_of_production_2_of_rule_command},
5414             $tracelevel)
5415             if defined $::RD_TRACE;
5416 48         143 $item{q{command}} = $_tok;
5417 48         105 push @item, $_tok;
5418            
5419             }
5420              
5421 48 50       141 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
5422             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5423             q{_alternation_1_of_production_2_of_rule_command},
5424             $tracelevel)
5425             if defined $::RD_TRACE;
5426            
5427              
5428 48 50       132 $_tok = ($_noactions) ? 0 : do { ['command_assign',$item[2],$item[1]] };
  48         153  
5429 48 50       160 unless (defined $_tok)
5430             {
5431 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
5432             if defined $::RD_TRACE;
5433 0         0 last;
5434             }
5435 48 50       131 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
5436             . $_tok . q{])},
5437             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5438             if defined $::RD_TRACE;
5439 48         91 push @item, $_tok;
5440 48         103 $item{__ACTION1__}=$_tok;
5441            
5442              
5443 48 50       136 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/\\s*(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?:=/ command]<<},
5444             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5445             q{_alternation_1_of_production_2_of_rule_command},
5446             $tracelevel)
5447             if defined $::RD_TRACE;
5448              
5449              
5450              
5451 48         72 $_matched = 1;
5452 48         109 last;
5453             }
5454              
5455              
5456 240 50 33     622 unless ( $_matched || defined($score) )
5457             {
5458            
5459              
5460 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
5461 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5462             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
5463             q{_alternation_1_of_production_2_of_rule_command},
5464             $tracelevel)
5465             if defined $::RD_TRACE;
5466 0         0 return undef;
5467             }
5468 240 50 33     1055 if (!defined($return) && defined($score))
5469             {
5470 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
5471             q{_alternation_1_of_production_2_of_rule_command},
5472             $tracelevel)
5473             if defined $::RD_TRACE;
5474 0         0 $return = $score_return;
5475             }
5476 240         381 splice @{$thisparser->{errors}}, $err_at;
  240         570  
5477 240 50       665 $return = $item[$#item] unless defined $return;
5478 240 50       553 if (defined $::RD_TRACE)
5479             {
5480 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
5481             $return . q{])}, "",
5482             q{_alternation_1_of_production_2_of_rule_command},
5483             $tracelevel);
5484 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
5485             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
5486             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5487             , q{_alternation_1_of_production_2_of_rule_command},
5488             $tracelevel)
5489             }
5490 240         531 $_[1] = $text;
5491 240         1749 return $return;
5492             }
5493              
5494             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
5495             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block
5496             {
5497 278     278   585 my $thisparser = $_[0];
5498 8     8   69 use vars q{$tracelevel};
  8         32  
  8         11218  
5499 278   50     793 local $tracelevel = ($tracelevel||0)+1;
5500 278         523 $ERRORS = 0;
5501 278         684 my $thisrule = $thisparser->{"rules"}{"block"};
5502              
5503 278 50       748 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [block]},
5504             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
5505             q{block},
5506             $tracelevel)
5507             if defined $::RD_TRACE;
5508              
5509            
5510 278         386 my $err_at = @{$thisparser->{errors}};
  278         559  
5511              
5512 278         816 my $score;
5513             my $score_return;
5514 278         0 my $_tok;
5515 278         452 my $return = undef;
5516 278         424 my $_matched=0;
5517 278         452 my $commit=0;
5518 278         508 my @item = ();
5519 278         485 my %item = ();
5520 278         415 my $repeating = $_[2];
5521 278         431 my $_noactions = $_[3];
5522 278 50       687 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  278         408  
  278         578  
5523 278         507 my $_itempos = $_[5];
5524 278 50       849 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
5525 278         709 my $text;
5526             my $lastsep;
5527 278         0 my $current_match;
5528 278         713 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{'\{'});
5529 278         882 $expectation->at($_[1]);
5530            
5531 278         423 my $thisoffset;
5532 278         1176 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
5533            
5534 278         615 my $thiscolumn;
5535 278         874 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
5536            
5537 278         489 my $thisline;
5538 278         832 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
5539              
5540            
5541              
5542 278   33     1333 while (!$_matched && !$commit)
5543             {
5544            
5545 278 50       642 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: ['\{' complex_command '\}']},
5546             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
5547             q{block},
5548             $tracelevel)
5549             if defined $::RD_TRACE;
5550 278         762 my $thisprod = $thisrule->{"prods"}[0];
5551 278         599 $text = $_[1];
5552 278         444 my $_savetext;
5553 278         673 @item = (q{block});
5554 278         689 %item = (__RULE__ => q{block});
5555 278         421 my $repcount = 0;
5556              
5557              
5558 278 50       706 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: ['\{']},
5559             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5560             q{block},
5561             $tracelevel)
5562             if defined $::RD_TRACE;
5563 278         535 undef $lastsep;
5564 278         609 $expectation->is(q{})->at($text);
5565            
5566              
5567 278 100 66     4101 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A\{/)
  278 100       2919  
5568             {
5569 222 50       964 $text = $lastsep . $text if defined $lastsep;
5570            
5571 222         762 $expectation->failed();
5572 222 50       552 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
5573             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5574             if defined $::RD_TRACE;
5575 222         525 last;
5576             }
5577 56         374 $current_match = substr($text, $-[0], $+[0] - $-[0]);
5578 56         216 substr($text,0,length($current_match),q{});
5579 56 50       142 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
5580             . $current_match . q{])},
5581             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5582             if defined $::RD_TRACE;
5583 56         184 push @item, $item{__STRING1__}=$current_match;
5584            
5585              
5586            
5587              
5588 56 50       168 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
5589             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5590             q{block},
5591             $tracelevel)
5592             if defined $::RD_TRACE;
5593 56         82 $_tok = do { $commit = 1 };
  56         106  
5594 56 50       142 if (defined($_tok))
5595             {
5596 56 50       156 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
5597             . $_tok . q{])},
5598             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5599             if defined $::RD_TRACE;
5600             }
5601             else
5602             {
5603 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5604             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5605             if defined $::RD_TRACE;
5606             }
5607            
5608 56 50       147 last unless defined $_tok;
5609 56         134 push @item, $item{__DIRECTIVE1__}=$_tok;
5610            
5611              
5612 56 50       133 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [complex_command]},
5613             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5614             q{block},
5615             $tracelevel)
5616             if defined $::RD_TRACE;
5617 56         156 $expectation->is(q{complex_command})->at($text);
5618            
5619 56 50   165   449 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::complex_command, 1, 100000000, $_noactions,$expectation,sub { \@arg },undef)))
  165         340  
5620             {
5621 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5622             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5623             q{block},
5624             $tracelevel)
5625             if defined $::RD_TRACE;
5626 0         0 last;
5627             }
5628 56 50       265 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [complex_command]<< (}
5629             . @$_tok . q{ times)},
5630              
5631             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5632             q{block},
5633             $tracelevel)
5634             if defined $::RD_TRACE;
5635 56         148 $item{q{complex_command(s)}} = $_tok;
5636 56         112 push @item, $_tok;
5637            
5638              
5639              
5640 56 50       129 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: ['\}']},
5641             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5642             q{block},
5643             $tracelevel)
5644             if defined $::RD_TRACE;
5645 56         94 undef $lastsep;
5646 56         164 $expectation->is(q{'\}'})->at($text);
5647            
5648              
5649 56 100 33     693 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A\}/)
  56 50       686  
5650             {
5651 0 0       0 $text = $lastsep . $text if defined $lastsep;
5652            
5653 0         0 $expectation->failed();
5654 0 0       0 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
5655             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5656             if defined $::RD_TRACE;
5657 0         0 last;
5658             }
5659 56         304 $current_match = substr($text, $-[0], $+[0] - $-[0]);
5660 56         203 substr($text,0,length($current_match),q{});
5661 56 50       172 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
5662             . $current_match . q{])},
5663             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5664             if defined $::RD_TRACE;
5665 56         211 push @item, $item{__STRING2__}=$current_match;
5666            
5667              
5668 56 50       140 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
5669             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5670             q{block},
5671             $tracelevel)
5672             if defined $::RD_TRACE;
5673            
5674              
5675 56 50       133 $_tok = ($_noactions) ? 0 : do { [grep ref,@{$item[3]}] };
  56         94  
  56         324  
5676 56 50       168 unless (defined $_tok)
5677             {
5678 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
5679             if defined $::RD_TRACE;
5680 0         0 last;
5681             }
5682 56 50       124 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
5683             . $_tok . q{])},
5684             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5685             if defined $::RD_TRACE;
5686 56         117 push @item, $_tok;
5687 56         113 $item{__ACTION1__}=$_tok;
5688            
5689              
5690 56 50       156 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: ['\{' complex_command '\}']<<},
5691             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5692             q{block},
5693             $tracelevel)
5694             if defined $::RD_TRACE;
5695              
5696              
5697              
5698 56         124 $_matched = 1;
5699 56         142 last;
5700             }
5701              
5702              
5703 278 100 66     1204 unless ( $_matched || defined($score) )
5704             {
5705            
5706              
5707 222         515 $_[1] = $text; # NOT SURE THIS IS NEEDED
5708 222 50       487 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5709             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
5710             q{block},
5711             $tracelevel)
5712             if defined $::RD_TRACE;
5713 222         1512 return undef;
5714             }
5715 56 50 33     280 if (!defined($return) && defined($score))
5716             {
5717 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
5718             q{block},
5719             $tracelevel)
5720             if defined $::RD_TRACE;
5721 0         0 $return = $score_return;
5722             }
5723 56         89 splice @{$thisparser->{errors}}, $err_at;
  56         140  
5724 56 50       218 $return = $item[$#item] unless defined $return;
5725 56 50       169 if (defined $::RD_TRACE)
5726             {
5727 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
5728             $return . q{])}, "",
5729             q{block},
5730             $tracelevel);
5731 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
5732             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
5733             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5734             , q{block},
5735             $tracelevel)
5736             }
5737 56         130 $_[1] = $text;
5738 56         557 return $return;
5739             }
5740              
5741             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
5742             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::command
5743             {
5744 1136     1136   1922 my $thisparser = $_[0];
5745 8     8   77 use vars q{$tracelevel};
  8         23  
  8         9498  
5746 1136   50     2879 local $tracelevel = ($tracelevel||0)+1;
5747 1136         1632 $ERRORS = 0;
5748 1136         2558 my $thisrule = $thisparser->{"rules"}{"command"};
5749              
5750 1136 50       2209 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [command]},
5751             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
5752             q{command},
5753             $tracelevel)
5754             if defined $::RD_TRACE;
5755              
5756            
5757 1136         1635 my $err_at = @{$thisparser->{errors}};
  1136         2001  
5758              
5759 1136         2707 my $score;
5760             my $score_return;
5761 1136         0 my $_tok;
5762 1136         1585 my $return = undef;
5763 1136         1399 my $_matched=0;
5764 1136         1392 my $commit=0;
5765 1136         1681 my @item = ();
5766 1136         1740 my %item = ();
5767 1136         1535 my $repeating = $_[2];
5768 1136         1566 my $_noactions = $_[3];
5769 1136 50       2234 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  1136         1587  
  1136         2026  
5770 1136         1716 my $_itempos = $_[5];
5771 1136 50       3958 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
5772 1136         2508 my $text;
5773             my $lastsep;
5774 1136         0 my $current_match;
5775 1136         2435 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(?=\\s*[\}\{;]|\\s*\\Z)/, or /assign\\b|(?:local\\b|my\\b)?(?=\\s*\\$[a-zA-Z_][a-zA-Z0-9_]*\\s*\\s*(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?:?=)/, or /(my)\\b/, or /(local)\\b/, or /(do)\\b/, or /(if)\\b/, or /(unless)\\b/, or /(while)\\b/, or /(foreach|for)\\b/, or /(stream)\\b/, or /(undef|undefine)\\b/, or /(use)\\b/, or /(test-mode|test_mode)/, or /(run-mode|run_mode)/, or /(?!(?:iterate|try|def|define)\\b)/});
5776 1136         2811 $expectation->at($_[1]);
5777            
5778 1136         1503 my $thisoffset;
5779 1136         3799 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
5780            
5781 1136         1731 my $thiscolumn;
5782 1136         2764 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
5783            
5784 1136         1776 my $thisline;
5785 1136         2938 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
5786              
5787            
5788              
5789 1136   33     4847 while (!$_matched && !$commit)
5790             {
5791            
5792 1136 50       2355 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?=\\s*[\}\{;]|\\s*\\Z)/ ]},
5793             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
5794             q{command},
5795             $tracelevel)
5796             if defined $::RD_TRACE;
5797 1136         2511 my $thisprod = $thisrule->{"prods"}[0];
5798 1136         2079 $text = $_[1];
5799 1136         1598 my $_savetext;
5800 1136         2226 @item = (q{command});
5801 1136         2536 %item = (__RULE__ => q{command});
5802 1136         1659 my $repcount = 0;
5803              
5804              
5805 1136 50       2325 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?=\\s*[\}\{;]|\\s*\\Z)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
5806             q{command},
5807             $tracelevel)
5808             if defined $::RD_TRACE;
5809 1136         2125 undef $lastsep;
5810 1136         2444 $expectation->is(q{})->at($text);
5811            
5812              
5813 1136 100 33     10943 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?=\s*[}{;]|\s*\Z))/)
  1136 50       10630  
5814             {
5815 1136 50       3564 $text = $lastsep . $text if defined $lastsep;
5816 1136         3176 $expectation->failed();
5817 1136 50       2284 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5818             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5819             if defined $::RD_TRACE;
5820              
5821 1136         2394 last;
5822             }
5823 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
5824 0         0 substr($text,0,length($current_match),q{});
5825 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
5826             . $current_match . q{])},
5827             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5828             if defined $::RD_TRACE;
5829 0         0 push @item, $item{__PATTERN1__}=$current_match;
5830            
5831              
5832            
5833              
5834 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
5835             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5836             q{command},
5837             $tracelevel)
5838             if defined $::RD_TRACE;
5839 0         0 $_tok = do { $commit = 1 };
  0         0  
5840 0 0       0 if (defined($_tok))
5841             {
5842 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
5843             . $_tok . q{])},
5844             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5845             if defined $::RD_TRACE;
5846             }
5847             else
5848             {
5849 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5850             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5851             if defined $::RD_TRACE;
5852             }
5853            
5854 0 0       0 last unless defined $_tok;
5855 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
5856            
5857              
5858 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Rejecting production<< (found )},
5859             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5860             q{command},
5861             $tracelevel)
5862             if defined $::RD_TRACE;
5863 0         0 undef $return;
5864            
5865              
5866 0         0 $_tok = undef;
5867            
5868 0 0       0 last unless defined $_tok;
5869              
5870 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?=\\s*[\}\{;]|\\s*\\Z)/ ]<<},
5871             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5872             q{command},
5873             $tracelevel)
5874             if defined $::RD_TRACE;
5875              
5876              
5877              
5878 0         0 $_matched = 1;
5879 0         0 last;
5880             }
5881              
5882              
5883 1136   33     4440 while (!$_matched && !$commit)
5884             {
5885            
5886 1136 50       2314 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/assign\\b|(?:local\\b|my\\b)?(?=\\s*\\$[a-zA-Z_][a-zA-Z0-9_]*\\s*\\s*(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?:?=)/ variable /(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?=/, or /\\s*(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?:=/]},
5887             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
5888             q{command},
5889             $tracelevel)
5890             if defined $::RD_TRACE;
5891 1136         2066 my $thisprod = $thisrule->{"prods"}[1];
5892 1136         2035 $text = $_[1];
5893 1136         1535 my $_savetext;
5894 1136         2423 @item = (q{command});
5895 1136         2487 %item = (__RULE__ => q{command});
5896 1136         1755 my $repcount = 0;
5897              
5898              
5899 1136 50       2229 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/assign\\b|(?:local\\b|my\\b)?(?=\\s*\\$[a-zA-Z_][a-zA-Z0-9_]*\\s*\\s*(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?:?=)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
5900             q{command},
5901             $tracelevel)
5902             if defined $::RD_TRACE;
5903 1136         2077 undef $lastsep;
5904 1136         2245 $expectation->is(q{})->at($text);
5905            
5906              
5907 1136 100 66     6839 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:assign\b|(?:local\b|my\b)?(?=\s*\$[a-zA-Z_][a-zA-Z0-9_]*\s*\s*(?:[\-\+\*\/%x.]|\|\||\&\&)?:?=))/)
  1136 100       10225  
5908             {
5909 896 50       2793 $text = $lastsep . $text if defined $lastsep;
5910 896         2334 $expectation->failed();
5911 896 50       1808 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5912             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5913             if defined $::RD_TRACE;
5914              
5915 896         1605 last;
5916             }
5917 240         1676 $current_match = substr($text, $-[0], $+[0] - $-[0]);
5918 240         1025 substr($text,0,length($current_match),q{});
5919 240 50       668 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
5920             . $current_match . q{])},
5921             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5922             if defined $::RD_TRACE;
5923 240         723 push @item, $item{__PATTERN1__}=$current_match;
5924            
5925              
5926            
5927              
5928 240 50       588 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
5929             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5930             q{command},
5931             $tracelevel)
5932             if defined $::RD_TRACE;
5933 240         417 $_tok = do { $commit = 1 };
  240         494  
5934 240 50       561 if (defined($_tok))
5935             {
5936 240 50       614 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
5937             . $_tok . q{])},
5938             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5939             if defined $::RD_TRACE;
5940             }
5941             else
5942             {
5943 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5944             XML::XSH2::Parser::_Runtime::_tracefirst($text))
5945             if defined $::RD_TRACE;
5946             }
5947            
5948 240 50       561 last unless defined $_tok;
5949 240         562 push @item, $item{__DIRECTIVE1__}=$_tok;
5950            
5951              
5952 240 50       580 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [variable]},
5953             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5954             q{command},
5955             $tracelevel)
5956             if defined $::RD_TRACE;
5957 8     8   75 if (1) { no strict qw{refs};
  8         19  
  8         1642  
  240         329  
5958 240         572 $expectation->is(q{variable})->at($text);
5959 240 50   240   1345 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::variable($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  240         520  
5960             {
5961            
5962 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5963             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5964             q{command},
5965             $tracelevel)
5966             if defined $::RD_TRACE;
5967 0         0 $expectation->failed();
5968 0         0 last;
5969             }
5970 240 50       1024 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [variable]<< (return value: [}
5971             . $_tok . q{]},
5972              
5973             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5974             q{command},
5975             $tracelevel)
5976             if defined $::RD_TRACE;
5977 240         570 $item{q{variable}} = $_tok;
5978 240         483 push @item, $_tok;
5979            
5980             }
5981              
5982 240 50       618 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [_alternation_1_of_production_2_of_rule_command]},
5983             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5984             q{command},
5985             $tracelevel)
5986             if defined $::RD_TRACE;
5987 8     8   63 if (1) { no strict qw{refs};
  8         27  
  8         15274  
  240         373  
5988 240         609 $expectation->is(q{/(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?=/, or /\\s*(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?:=/})->at($text);
5989 240 50   240   1312 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::_alternation_1_of_production_2_of_rule_command($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  240         486  
5990             {
5991            
5992 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
5993             XML::XSH2::Parser::_Runtime::_tracefirst($text),
5994             q{command},
5995             $tracelevel)
5996             if defined $::RD_TRACE;
5997 0         0 $expectation->failed();
5998 0         0 last;
5999             }
6000 240 50       873 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [_alternation_1_of_production_2_of_rule_command]<< (return value: [}
6001             . $_tok . q{]},
6002              
6003             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6004             q{command},
6005             $tracelevel)
6006             if defined $::RD_TRACE;
6007 240         567 $item{q{_alternation_1_of_production_2_of_rule_command}} = $_tok;
6008 240         470 push @item, $_tok;
6009            
6010             }
6011              
6012 240 50       625 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
6013             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6014             q{command},
6015             $tracelevel)
6016             if defined $::RD_TRACE;
6017            
6018              
6019 240 50       498 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,@{$item[4]},$item[1],$item[3]] };
  240         424  
  240         980  
6020 240 50       729 unless (defined $_tok)
6021             {
6022 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
6023             if defined $::RD_TRACE;
6024 0         0 last;
6025             }
6026 240 50       577 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
6027             . $_tok . q{])},
6028             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6029             if defined $::RD_TRACE;
6030 240         523 push @item, $_tok;
6031 240         429 $item{__ACTION1__}=$_tok;
6032            
6033              
6034 240 50       581 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/assign\\b|(?:local\\b|my\\b)?(?=\\s*\\$[a-zA-Z_][a-zA-Z0-9_]*\\s*\\s*(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?:?=)/ variable /(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?=/, or /\\s*(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?:=/]<<},
6035             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6036             q{command},
6037             $tracelevel)
6038             if defined $::RD_TRACE;
6039              
6040              
6041              
6042 240         374 $_matched = 1;
6043 240         469 last;
6044             }
6045              
6046              
6047 1136   66     3715 while (!$_matched && !$commit)
6048             {
6049            
6050 896 50       1792 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(my)\\b/ variable]},
6051             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
6052             q{command},
6053             $tracelevel)
6054             if defined $::RD_TRACE;
6055 896         1729 my $thisprod = $thisrule->{"prods"}[2];
6056 896         1564 $text = $_[1];
6057 896         1326 my $_savetext;
6058 896         1959 @item = (q{command});
6059 896         1868 %item = (__RULE__ => q{command});
6060 896         1336 my $repcount = 0;
6061              
6062              
6063 896 50       1730 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(my)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
6064             q{command},
6065             $tracelevel)
6066             if defined $::RD_TRACE;
6067 896         1384 undef $lastsep;
6068 896         1630 $expectation->is(q{})->at($text);
6069            
6070              
6071 896 100 33     5564 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(my)\b)/)
  896 50       6534  
6072             {
6073 896 50       2640 $text = $lastsep . $text if defined $lastsep;
6074 896         2314 $expectation->failed();
6075 896 50       1735 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6076             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6077             if defined $::RD_TRACE;
6078              
6079 896         1706 last;
6080             }
6081 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
6082 0         0 substr($text,0,length($current_match),q{});
6083 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
6084             . $current_match . q{])},
6085             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6086             if defined $::RD_TRACE;
6087 0         0 push @item, $item{__PATTERN1__}=$current_match;
6088            
6089              
6090 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [variable]},
6091             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6092             q{command},
6093             $tracelevel)
6094             if defined $::RD_TRACE;
6095 0         0 $expectation->is(q{variable})->at($text);
6096            
6097 0 0   0   0 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::variable, 1, 100000000, $_noactions,$expectation,sub { \@arg },undef)))
  0         0  
6098             {
6099 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6100             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6101             q{command},
6102             $tracelevel)
6103             if defined $::RD_TRACE;
6104 0         0 last;
6105             }
6106 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [variable]<< (}
6107             . @$_tok . q{ times)},
6108              
6109             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6110             q{command},
6111             $tracelevel)
6112             if defined $::RD_TRACE;
6113 0         0 $item{q{variable(s)}} = $_tok;
6114 0         0 push @item, $_tok;
6115            
6116              
6117              
6118 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
6119             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6120             q{command},
6121             $tracelevel)
6122             if defined $::RD_TRACE;
6123            
6124              
6125 0 0       0 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'store_lex_variables',0,@{$item[2]}] };
  0         0  
  0         0  
6126 0 0       0 unless (defined $_tok)
6127             {
6128 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
6129             if defined $::RD_TRACE;
6130 0         0 last;
6131             }
6132 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
6133             . $_tok . q{])},
6134             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6135             if defined $::RD_TRACE;
6136 0         0 push @item, $_tok;
6137 0         0 $item{__ACTION1__}=$_tok;
6138            
6139              
6140 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(my)\\b/ variable]<<},
6141             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6142             q{command},
6143             $tracelevel)
6144             if defined $::RD_TRACE;
6145              
6146              
6147              
6148 0         0 $_matched = 1;
6149 0         0 last;
6150             }
6151              
6152              
6153 1136   66     3895 while (!$_matched && !$commit)
6154             {
6155            
6156 896 50       1830 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(local)\\b/ variable]},
6157             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
6158             q{command},
6159             $tracelevel)
6160             if defined $::RD_TRACE;
6161 896         1679 my $thisprod = $thisrule->{"prods"}[3];
6162 896         1459 $text = $_[1];
6163 896         1237 my $_savetext;
6164 896         1903 @item = (q{command});
6165 896         1911 %item = (__RULE__ => q{command});
6166 896         1355 my $repcount = 0;
6167              
6168              
6169 896 50       1594 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(local)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
6170             q{command},
6171             $tracelevel)
6172             if defined $::RD_TRACE;
6173 896         1440 undef $lastsep;
6174 896         1758 $expectation->is(q{})->at($text);
6175            
6176              
6177 896 100 66     5646 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(local)\b)/)
  896 100       6521  
6178             {
6179 895 50       2739 $text = $lastsep . $text if defined $lastsep;
6180 895         2316 $expectation->failed();
6181 895 50       1832 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6182             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6183             if defined $::RD_TRACE;
6184              
6185 895         1532 last;
6186             }
6187 1         11 $current_match = substr($text, $-[0], $+[0] - $-[0]);
6188 1         6 substr($text,0,length($current_match),q{});
6189 1 50       6 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
6190             . $current_match . q{])},
6191             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6192             if defined $::RD_TRACE;
6193 1         5 push @item, $item{__PATTERN1__}=$current_match;
6194            
6195              
6196 1 50       6 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [variable]},
6197             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6198             q{command},
6199             $tracelevel)
6200             if defined $::RD_TRACE;
6201 1         6 $expectation->is(q{variable})->at($text);
6202            
6203 1 50   2   14 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::variable, 1, 100000000, $_noactions,$expectation,sub { \@arg },undef)))
  2         5  
6204             {
6205 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6206             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6207             q{command},
6208             $tracelevel)
6209             if defined $::RD_TRACE;
6210 0         0 last;
6211             }
6212 1 50       6 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [variable]<< (}
6213             . @$_tok . q{ times)},
6214              
6215             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6216             q{command},
6217             $tracelevel)
6218             if defined $::RD_TRACE;
6219 1         10 $item{q{variable(s)}} = $_tok;
6220 1         3 push @item, $_tok;
6221            
6222              
6223              
6224 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
6225             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6226             q{command},
6227             $tracelevel)
6228             if defined $::RD_TRACE;
6229            
6230              
6231 1 50       3 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'make_local',@{$item[2]}] };
  1         3  
  1         4  
6232 1 50       5 unless (defined $_tok)
6233             {
6234 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
6235             if defined $::RD_TRACE;
6236 0         0 last;
6237             }
6238 1 50       5 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
6239             . $_tok . q{])},
6240             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6241             if defined $::RD_TRACE;
6242 1         2 push @item, $_tok;
6243 1         2 $item{__ACTION1__}=$_tok;
6244            
6245              
6246 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(local)\\b/ variable]<<},
6247             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6248             q{command},
6249             $tracelevel)
6250             if defined $::RD_TRACE;
6251              
6252              
6253              
6254 1         3 $_matched = 1;
6255 1         2 last;
6256             }
6257              
6258              
6259 1136   66     3706 while (!$_matched && !$commit)
6260             {
6261            
6262 895 50       1795 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(do)\\b/ block]},
6263             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
6264             q{command},
6265             $tracelevel)
6266             if defined $::RD_TRACE;
6267 895         1636 my $thisprod = $thisrule->{"prods"}[4];
6268 895         1403 $text = $_[1];
6269 895         1244 my $_savetext;
6270 895         1835 @item = (q{command});
6271 895         1876 %item = (__RULE__ => q{command});
6272 895         1441 my $repcount = 0;
6273              
6274              
6275 895 50       1809 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(do)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
6276             q{command},
6277             $tracelevel)
6278             if defined $::RD_TRACE;
6279 895         1478 undef $lastsep;
6280 895         1616 $expectation->is(q{})->at($text);
6281            
6282              
6283 895 100 33     5467 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(do)\b)/)
  895 50       6418  
6284             {
6285 895 50       2595 $text = $lastsep . $text if defined $lastsep;
6286 895         2372 $expectation->failed();
6287 895 50       2029 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6288             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6289             if defined $::RD_TRACE;
6290              
6291 895         1572 last;
6292             }
6293 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
6294 0         0 substr($text,0,length($current_match),q{});
6295 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
6296             . $current_match . q{])},
6297             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6298             if defined $::RD_TRACE;
6299 0         0 push @item, $item{__PATTERN1__}=$current_match;
6300            
6301              
6302            
6303              
6304 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
6305             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6306             q{command},
6307             $tracelevel)
6308             if defined $::RD_TRACE;
6309 0         0 $_tok = do { $commit = 1 };
  0         0  
6310 0 0       0 if (defined($_tok))
6311             {
6312 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
6313             . $_tok . q{])},
6314             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6315             if defined $::RD_TRACE;
6316             }
6317             else
6318             {
6319 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6320             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6321             if defined $::RD_TRACE;
6322             }
6323            
6324 0 0       0 last unless defined $_tok;
6325 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
6326            
6327              
6328 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
6329             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6330             q{command},
6331             $tracelevel)
6332             if defined $::RD_TRACE;
6333 8     8   89 if (1) { no strict qw{refs};
  8         22  
  8         5611  
  0         0  
6334 0         0 $expectation->is(q{block})->at($text);
6335 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
6336             {
6337            
6338 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6339             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6340             q{command},
6341             $tracelevel)
6342             if defined $::RD_TRACE;
6343 0         0 $expectation->failed();
6344 0         0 last;
6345             }
6346 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
6347             . $_tok . q{]},
6348              
6349             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6350             q{command},
6351             $tracelevel)
6352             if defined $::RD_TRACE;
6353 0         0 $item{q{block}} = $_tok;
6354 0         0 push @item, $_tok;
6355            
6356             }
6357              
6358 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
6359             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6360             q{command},
6361             $tracelevel)
6362             if defined $::RD_TRACE;
6363            
6364              
6365 0 0       0 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'run_commands',$item[3],0] };
  0         0  
6366 0 0       0 unless (defined $_tok)
6367             {
6368 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
6369             if defined $::RD_TRACE;
6370 0         0 last;
6371             }
6372 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
6373             . $_tok . q{])},
6374             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6375             if defined $::RD_TRACE;
6376 0         0 push @item, $_tok;
6377 0         0 $item{__ACTION1__}=$_tok;
6378            
6379              
6380 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(do)\\b/ block]<<},
6381             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6382             q{command},
6383             $tracelevel)
6384             if defined $::RD_TRACE;
6385              
6386              
6387              
6388 0         0 $_matched = 1;
6389 0         0 last;
6390             }
6391              
6392              
6393 1136   66     3856 while (!$_matched && !$commit)
6394             {
6395            
6396 895 50       1952 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(if)\\b/ exp command]},
6397             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
6398             q{command},
6399             $tracelevel)
6400             if defined $::RD_TRACE;
6401 895         1741 my $thisprod = $thisrule->{"prods"}[5];
6402 895         1537 $text = $_[1];
6403 895         1307 my $_savetext;
6404 895         1865 @item = (q{command});
6405 895         1937 %item = (__RULE__ => q{command});
6406 895         1334 my $repcount = 0;
6407              
6408              
6409 895 50       1843 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(if)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
6410             q{command},
6411             $tracelevel)
6412             if defined $::RD_TRACE;
6413 895         1334 undef $lastsep;
6414 895         1834 $expectation->is(q{})->at($text);
6415            
6416              
6417 895 100 33     5495 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(if)\b)/)
  895 50       6332  
6418             {
6419 895 50       2707 $text = $lastsep . $text if defined $lastsep;
6420 895         2459 $expectation->failed();
6421 895 50       1739 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6422             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6423             if defined $::RD_TRACE;
6424              
6425 895         1621 last;
6426             }
6427 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
6428 0         0 substr($text,0,length($current_match),q{});
6429 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
6430             . $current_match . q{])},
6431             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6432             if defined $::RD_TRACE;
6433 0         0 push @item, $item{__PATTERN1__}=$current_match;
6434            
6435              
6436            
6437              
6438 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
6439             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6440             q{command},
6441             $tracelevel)
6442             if defined $::RD_TRACE;
6443 0         0 $_tok = do { $commit = 1 };
  0         0  
6444 0 0       0 if (defined($_tok))
6445             {
6446 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
6447             . $_tok . q{])},
6448             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6449             if defined $::RD_TRACE;
6450             }
6451             else
6452             {
6453 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6454             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6455             if defined $::RD_TRACE;
6456             }
6457            
6458 0 0       0 last unless defined $_tok;
6459 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
6460            
6461              
6462 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
6463             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6464             q{command},
6465             $tracelevel)
6466             if defined $::RD_TRACE;
6467 8     8   86 if (1) { no strict qw{refs};
  8         31  
  8         1747  
  0         0  
6468 0         0 $expectation->is(q{exp})->at($text);
6469 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
6470             {
6471            
6472 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6473             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6474             q{command},
6475             $tracelevel)
6476             if defined $::RD_TRACE;
6477 0         0 $expectation->failed();
6478 0         0 last;
6479             }
6480 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
6481             . $_tok . q{]},
6482              
6483             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6484             q{command},
6485             $tracelevel)
6486             if defined $::RD_TRACE;
6487 0         0 $item{q{exp}} = $_tok;
6488 0         0 push @item, $_tok;
6489            
6490             }
6491              
6492 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [command]},
6493             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6494             q{command},
6495             $tracelevel)
6496             if defined $::RD_TRACE;
6497 8     8   62 if (1) { no strict qw{refs};
  8         23  
  8         5960  
  0         0  
6498 0         0 $expectation->is(q{command})->at($text);
6499 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::command($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
6500             {
6501            
6502 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6503             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6504             q{command},
6505             $tracelevel)
6506             if defined $::RD_TRACE;
6507 0         0 $expectation->failed();
6508 0         0 last;
6509             }
6510 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [command]<< (return value: [}
6511             . $_tok . q{]},
6512              
6513             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6514             q{command},
6515             $tracelevel)
6516             if defined $::RD_TRACE;
6517 0         0 $item{q{command}} = $_tok;
6518 0         0 push @item, $_tok;
6519            
6520             }
6521              
6522 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
6523             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6524             q{command},
6525             $tracelevel)
6526             if defined $::RD_TRACE;
6527            
6528              
6529 0 0       0 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'if_statement',[$item[3],[$item[4]]]] };
  0         0  
6530 0 0       0 unless (defined $_tok)
6531             {
6532 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
6533             if defined $::RD_TRACE;
6534 0         0 last;
6535             }
6536 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
6537             . $_tok . q{])},
6538             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6539             if defined $::RD_TRACE;
6540 0         0 push @item, $_tok;
6541 0         0 $item{__ACTION1__}=$_tok;
6542            
6543              
6544 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(if)\\b/ exp command]<<},
6545             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6546             q{command},
6547             $tracelevel)
6548             if defined $::RD_TRACE;
6549              
6550              
6551              
6552 0         0 $_matched = 1;
6553 0         0 last;
6554             }
6555              
6556              
6557 1136   66     3748 while (!$_matched && !$commit)
6558             {
6559            
6560 895 50       1709 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(unless)\\b/ exp command]},
6561             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
6562             q{command},
6563             $tracelevel)
6564             if defined $::RD_TRACE;
6565 895         1635 my $thisprod = $thisrule->{"prods"}[6];
6566 895         1630 $text = $_[1];
6567 895         1353 my $_savetext;
6568 895         1811 @item = (q{command});
6569 895         1909 %item = (__RULE__ => q{command});
6570 895         1296 my $repcount = 0;
6571              
6572              
6573 895 50       1670 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(unless)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
6574             q{command},
6575             $tracelevel)
6576             if defined $::RD_TRACE;
6577 895         1330 undef $lastsep;
6578 895         1671 $expectation->is(q{})->at($text);
6579            
6580              
6581 895 100 66     5390 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(unless)\b)/)
  895 100       6821  
6582             {
6583 676 50       1978 $text = $lastsep . $text if defined $lastsep;
6584 676         1744 $expectation->failed();
6585 676 50       1387 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6586             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6587             if defined $::RD_TRACE;
6588              
6589 676         1239 last;
6590             }
6591 219         1490 $current_match = substr($text, $-[0], $+[0] - $-[0]);
6592 219         883 substr($text,0,length($current_match),q{});
6593 219 50       533 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
6594             . $current_match . q{])},
6595             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6596             if defined $::RD_TRACE;
6597 219         630 push @item, $item{__PATTERN1__}=$current_match;
6598            
6599              
6600            
6601              
6602 219 50       560 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
6603             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6604             q{command},
6605             $tracelevel)
6606             if defined $::RD_TRACE;
6607 219         331 $_tok = do { $commit = 1 };
  219         473  
6608 219 50       548 if (defined($_tok))
6609             {
6610 219 50       485 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
6611             . $_tok . q{])},
6612             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6613             if defined $::RD_TRACE;
6614             }
6615             else
6616             {
6617 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6618             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6619             if defined $::RD_TRACE;
6620             }
6621            
6622 219 50       451 last unless defined $_tok;
6623 219         562 push @item, $item{__DIRECTIVE1__}=$_tok;
6624            
6625              
6626 219 50       526 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
6627             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6628             q{command},
6629             $tracelevel)
6630             if defined $::RD_TRACE;
6631 8     8   89 if (1) { no strict qw{refs};
  8         31  
  8         1681  
  219         332  
6632 219         573 $expectation->is(q{exp})->at($text);
6633 219 50   219   1164 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  219         424  
6634             {
6635            
6636 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6637             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6638             q{command},
6639             $tracelevel)
6640             if defined $::RD_TRACE;
6641 0         0 $expectation->failed();
6642 0         0 last;
6643             }
6644 219 50       1150 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
6645             . $_tok . q{]},
6646              
6647             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6648             q{command},
6649             $tracelevel)
6650             if defined $::RD_TRACE;
6651 219         562 $item{q{exp}} = $_tok;
6652 219         439 push @item, $_tok;
6653            
6654             }
6655              
6656 219 50       599 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [command]},
6657             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6658             q{command},
6659             $tracelevel)
6660             if defined $::RD_TRACE;
6661 8     8   63 if (1) { no strict qw{refs};
  8         46  
  8         6488  
  219         378  
6662 219         630 $expectation->is(q{command})->at($text);
6663 219 50   219   1471 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::command($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  219         430  
6664             {
6665            
6666 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6667             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6668             q{command},
6669             $tracelevel)
6670             if defined $::RD_TRACE;
6671 0         0 $expectation->failed();
6672 0         0 last;
6673             }
6674 219 50       852 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [command]<< (return value: [}
6675             . $_tok . q{]},
6676              
6677             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6678             q{command},
6679             $tracelevel)
6680             if defined $::RD_TRACE;
6681 219         581 $item{q{command}} = $_tok;
6682 219         446 push @item, $_tok;
6683            
6684             }
6685              
6686 219 50       528 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
6687             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6688             q{command},
6689             $tracelevel)
6690             if defined $::RD_TRACE;
6691            
6692              
6693 219 50       506 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'unless_statement',$item[3],[$item[4]]] };
  219         713  
6694 219 50       705 unless (defined $_tok)
6695             {
6696 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
6697             if defined $::RD_TRACE;
6698 0         0 last;
6699             }
6700 219 50       524 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
6701             . $_tok . q{])},
6702             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6703             if defined $::RD_TRACE;
6704 219         433 push @item, $_tok;
6705 219         414 $item{__ACTION1__}=$_tok;
6706            
6707              
6708 219 50       490 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(unless)\\b/ exp command]<<},
6709             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6710             q{command},
6711             $tracelevel)
6712             if defined $::RD_TRACE;
6713              
6714              
6715              
6716 219         356 $_matched = 1;
6717 219         461 last;
6718             }
6719              
6720              
6721 1136   66     3952 while (!$_matched && !$commit)
6722             {
6723            
6724 676 50       1408 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(while)\\b/ exp command]},
6725             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
6726             q{command},
6727             $tracelevel)
6728             if defined $::RD_TRACE;
6729 676         1430 my $thisprod = $thisrule->{"prods"}[7];
6730 676         1292 $text = $_[1];
6731 676         1008 my $_savetext;
6732 676         1365 @item = (q{command});
6733 676         1471 %item = (__RULE__ => q{command});
6734 676         1042 my $repcount = 0;
6735              
6736              
6737 676 50       1419 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(while)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
6738             q{command},
6739             $tracelevel)
6740             if defined $::RD_TRACE;
6741 676         1041 undef $lastsep;
6742 676         1401 $expectation->is(q{})->at($text);
6743            
6744              
6745 676 100 33     4090 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(while)\b)/)
  676 50       5211  
6746             {
6747 676 50       1990 $text = $lastsep . $text if defined $lastsep;
6748 676         1790 $expectation->failed();
6749 676 50       1304 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6750             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6751             if defined $::RD_TRACE;
6752              
6753 676         1238 last;
6754             }
6755 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
6756 0         0 substr($text,0,length($current_match),q{});
6757 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
6758             . $current_match . q{])},
6759             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6760             if defined $::RD_TRACE;
6761 0         0 push @item, $item{__PATTERN1__}=$current_match;
6762            
6763              
6764            
6765              
6766 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
6767             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6768             q{command},
6769             $tracelevel)
6770             if defined $::RD_TRACE;
6771 0         0 $_tok = do { $commit = 1 };
  0         0  
6772 0 0       0 if (defined($_tok))
6773             {
6774 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
6775             . $_tok . q{])},
6776             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6777             if defined $::RD_TRACE;
6778             }
6779             else
6780             {
6781 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6782             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6783             if defined $::RD_TRACE;
6784             }
6785            
6786 0 0       0 last unless defined $_tok;
6787 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
6788            
6789              
6790 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
6791             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6792             q{command},
6793             $tracelevel)
6794             if defined $::RD_TRACE;
6795 8     8   65 if (1) { no strict qw{refs};
  8         18  
  8         1675  
  0         0  
6796 0         0 $expectation->is(q{exp})->at($text);
6797 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
6798             {
6799            
6800 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6801             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6802             q{command},
6803             $tracelevel)
6804             if defined $::RD_TRACE;
6805 0         0 $expectation->failed();
6806 0         0 last;
6807             }
6808 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
6809             . $_tok . q{]},
6810              
6811             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6812             q{command},
6813             $tracelevel)
6814             if defined $::RD_TRACE;
6815 0         0 $item{q{exp}} = $_tok;
6816 0         0 push @item, $_tok;
6817            
6818             }
6819              
6820 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [command]},
6821             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6822             q{command},
6823             $tracelevel)
6824             if defined $::RD_TRACE;
6825 8     8   1356 if (1) { no strict qw{refs};
  8         40  
  8         7821  
  0         0  
6826 0         0 $expectation->is(q{command})->at($text);
6827 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::command($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
6828             {
6829            
6830 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6831             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6832             q{command},
6833             $tracelevel)
6834             if defined $::RD_TRACE;
6835 0         0 $expectation->failed();
6836 0         0 last;
6837             }
6838 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [command]<< (return value: [}
6839             . $_tok . q{]},
6840              
6841             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6842             q{command},
6843             $tracelevel)
6844             if defined $::RD_TRACE;
6845 0         0 $item{q{command}} = $_tok;
6846 0         0 push @item, $_tok;
6847            
6848             }
6849              
6850 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
6851             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6852             q{command},
6853             $tracelevel)
6854             if defined $::RD_TRACE;
6855            
6856              
6857 0 0       0 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'while_statement',$item[3],[$item[4]]] };
  0         0  
6858 0 0       0 unless (defined $_tok)
6859             {
6860 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
6861             if defined $::RD_TRACE;
6862 0         0 last;
6863             }
6864 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
6865             . $_tok . q{])},
6866             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6867             if defined $::RD_TRACE;
6868 0         0 push @item, $_tok;
6869 0         0 $item{__ACTION1__}=$_tok;
6870            
6871              
6872 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(while)\\b/ exp command]<<},
6873             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6874             q{command},
6875             $tracelevel)
6876             if defined $::RD_TRACE;
6877              
6878              
6879              
6880 0         0 $_matched = 1;
6881 0         0 last;
6882             }
6883              
6884              
6885 1136   66     3522 while (!$_matched && !$commit)
6886             {
6887            
6888 676 50       1309 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(foreach|for)\\b/ local_var_in exp command]},
6889             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
6890             q{command},
6891             $tracelevel)
6892             if defined $::RD_TRACE;
6893 676         1407 my $thisprod = $thisrule->{"prods"}[8];
6894 676         1274 $text = $_[1];
6895 676         1005 my $_savetext;
6896 676         1487 @item = (q{command});
6897 676         1467 %item = (__RULE__ => q{command});
6898 676         1248 my $repcount = 0;
6899              
6900              
6901 676 50       1293 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(foreach|for)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
6902             q{command},
6903             $tracelevel)
6904             if defined $::RD_TRACE;
6905 676         1062 undef $lastsep;
6906 676         1343 $expectation->is(q{})->at($text);
6907            
6908              
6909 676 100 66     4059 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(foreach|for)\b)/)
  676 100       4891  
6910             {
6911 673 50       1932 $text = $lastsep . $text if defined $lastsep;
6912 673         1834 $expectation->failed();
6913 673 50       1310 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6914             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6915             if defined $::RD_TRACE;
6916              
6917 673         1227 last;
6918             }
6919 3         21 $current_match = substr($text, $-[0], $+[0] - $-[0]);
6920 3         16 substr($text,0,length($current_match),q{});
6921 3 50       9 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
6922             . $current_match . q{])},
6923             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6924             if defined $::RD_TRACE;
6925 3         10 push @item, $item{__PATTERN1__}=$current_match;
6926            
6927              
6928            
6929              
6930 3 50       8 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
6931             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6932             q{command},
6933             $tracelevel)
6934             if defined $::RD_TRACE;
6935 3         4 $_tok = do { $commit = 1 };
  3         7  
6936 3 50       9 if (defined($_tok))
6937             {
6938 3 50       8 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
6939             . $_tok . q{])},
6940             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6941             if defined $::RD_TRACE;
6942             }
6943             else
6944             {
6945 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6946             XML::XSH2::Parser::_Runtime::_tracefirst($text))
6947             if defined $::RD_TRACE;
6948             }
6949            
6950 3 50       9 last unless defined $_tok;
6951 3         9 push @item, $item{__DIRECTIVE1__}=$_tok;
6952            
6953              
6954 3 50       8 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [local_var_in]},
6955             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6956             q{command},
6957             $tracelevel)
6958             if defined $::RD_TRACE;
6959 3         9 $expectation->is(q{local_var_in})->at($text);
6960            
6961 3 50   3   19 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::local_var_in, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  3         6  
6962             {
6963 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6964             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6965             q{command},
6966             $tracelevel)
6967             if defined $::RD_TRACE;
6968 0         0 last;
6969             }
6970 3 50       12 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [local_var_in]<< (}
6971             . @$_tok . q{ times)},
6972              
6973             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6974             q{command},
6975             $tracelevel)
6976             if defined $::RD_TRACE;
6977 3         8 $item{q{local_var_in(?)}} = $_tok;
6978 3         7 push @item, $_tok;
6979            
6980              
6981              
6982 3 50       6 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
6983             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6984             q{command},
6985             $tracelevel)
6986             if defined $::RD_TRACE;
6987 8     8   75 if (1) { no strict qw{refs};
  8         18  
  8         1890  
  3         6  
6988 3         8 $expectation->is(q{exp})->at($text);
6989 3 50   3   15 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  3         5  
6990             {
6991            
6992 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
6993             XML::XSH2::Parser::_Runtime::_tracefirst($text),
6994             q{command},
6995             $tracelevel)
6996             if defined $::RD_TRACE;
6997 0         0 $expectation->failed();
6998 0         0 last;
6999             }
7000 3 50       13 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
7001             . $_tok . q{]},
7002              
7003             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7004             q{command},
7005             $tracelevel)
7006             if defined $::RD_TRACE;
7007 3         7 $item{q{exp}} = $_tok;
7008 3         6 push @item, $_tok;
7009            
7010             }
7011              
7012 3 50       10 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [command]},
7013             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7014             q{command},
7015             $tracelevel)
7016             if defined $::RD_TRACE;
7017 8     8   67 if (1) { no strict qw{refs};
  8         17  
  8         6783  
  3         5  
7018 3         9 $expectation->is(q{command})->at($text);
7019 3 50   3   17 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::command($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  3         6  
7020             {
7021            
7022 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7023             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7024             q{command},
7025             $tracelevel)
7026             if defined $::RD_TRACE;
7027 0         0 $expectation->failed();
7028 0         0 last;
7029             }
7030 3 50       14 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [command]<< (return value: [}
7031             . $_tok . q{]},
7032              
7033             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7034             q{command},
7035             $tracelevel)
7036             if defined $::RD_TRACE;
7037 3         7 $item{q{command}} = $_tok;
7038 3         7 push @item, $_tok;
7039            
7040             }
7041              
7042 3 50       11 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
7043             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7044             q{command},
7045             $tracelevel)
7046             if defined $::RD_TRACE;
7047            
7048              
7049 3 50       7 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'foreach_statement',$item[4],[$item[5]],@{$item[3]}] };
  3         8  
  3         8  
7050 3 50       9 unless (defined $_tok)
7051             {
7052 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
7053             if defined $::RD_TRACE;
7054 0         0 last;
7055             }
7056 3 50       9 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
7057             . $_tok . q{])},
7058             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7059             if defined $::RD_TRACE;
7060 3         6 push @item, $_tok;
7061 3         7 $item{__ACTION1__}=$_tok;
7062            
7063              
7064 3 50       9 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(foreach|for)\\b/ local_var_in exp command]<<},
7065             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7066             q{command},
7067             $tracelevel)
7068             if defined $::RD_TRACE;
7069              
7070              
7071              
7072 3         4 $_matched = 1;
7073 3         7 last;
7074             }
7075              
7076              
7077 1136   66     3586 while (!$_matched && !$commit)
7078             {
7079            
7080 673 50       1368 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(stream)\\b/ /--input-file|:f/, or /--input-pipe|:p/, or /--input-string|:s/, or /--output-file|:F/, or /--output-encoding|:E/, or /--output-pipe|:P/, or /--output-string|:S/, or /--no-output|:N/ stream_select]},
7081             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
7082             q{command},
7083             $tracelevel)
7084             if defined $::RD_TRACE;
7085 673         1544 my $thisprod = $thisrule->{"prods"}[9];
7086 673         1175 $text = $_[1];
7087 673         847 my $_savetext;
7088 673         1361 @item = (q{command});
7089 673         1368 %item = (__RULE__ => q{command});
7090 673         1004 my $repcount = 0;
7091              
7092              
7093 673 50       1190 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(stream)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
7094             q{command},
7095             $tracelevel)
7096             if defined $::RD_TRACE;
7097 673         1172 undef $lastsep;
7098 673         1255 $expectation->is(q{})->at($text);
7099            
7100              
7101 673 100 66     4093 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(stream)\b)/)
  673 100       4961  
7102             {
7103 671 50       2015 $text = $lastsep . $text if defined $lastsep;
7104 671         1750 $expectation->failed();
7105 671 50       1453 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7106             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7107             if defined $::RD_TRACE;
7108              
7109 671         1246 last;
7110             }
7111 2         14 $current_match = substr($text, $-[0], $+[0] - $-[0]);
7112 2         23 substr($text,0,length($current_match),q{});
7113 2 50       11 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
7114             . $current_match . q{])},
7115             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7116             if defined $::RD_TRACE;
7117 2         7 push @item, $item{__PATTERN1__}=$current_match;
7118            
7119              
7120            
7121              
7122 2 50       8 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
7123             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7124             q{command},
7125             $tracelevel)
7126             if defined $::RD_TRACE;
7127 2         5 $_tok = do { $commit = 1 };
  2         6  
7128 2 50       8 if (defined($_tok))
7129             {
7130 2 50       8 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
7131             . $_tok . q{])},
7132             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7133             if defined $::RD_TRACE;
7134             }
7135             else
7136             {
7137 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7138             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7139             if defined $::RD_TRACE;
7140             }
7141            
7142 2 50       7 last unless defined $_tok;
7143 2         7 push @item, $item{__DIRECTIVE1__}=$_tok;
7144            
7145              
7146 2 50       7 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [_alternation_1_of_production_10_of_rule_command]},
7147             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7148             q{command},
7149             $tracelevel)
7150             if defined $::RD_TRACE;
7151 8     8   66 if (1) { no strict qw{refs};
  8         16  
  8         42050  
  2         4  
7152 2         8 $expectation->is(q{/--input-file|:f/, or /--input-pipe|:p/, or /--input-string|:s/, or /--output-file|:F/, or /--output-encoding|:E/, or /--output-pipe|:P/, or /--output-string|:S/, or /--no-output|:N/})->at($text);
7153 2 50   2   16 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::_alternation_1_of_production_10_of_rule_command($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  2         6  
7154             {
7155            
7156 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7157             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7158             q{command},
7159             $tracelevel)
7160             if defined $::RD_TRACE;
7161 0         0 $expectation->failed();
7162 0         0 last;
7163             }
7164 2 50       10 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [_alternation_1_of_production_10_of_rule_command]<< (return value: [}
7165             . $_tok . q{]},
7166              
7167             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7168             q{command},
7169             $tracelevel)
7170             if defined $::RD_TRACE;
7171 2         9 $item{q{_alternation_1_of_production_10_of_rule_command}} = $_tok;
7172 2         5 push @item, $_tok;
7173            
7174             }
7175              
7176 2 50       6 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [stream_select]},
7177             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7178             q{command},
7179             $tracelevel)
7180             if defined $::RD_TRACE;
7181 2         8 $expectation->is(q{stream_select})->at($text);
7182            
7183 2 50   4   15 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::stream_select, 1, 100000000, $_noactions,$expectation,sub { \@arg },undef)))
  4         11  
7184             {
7185 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7186             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7187             q{command},
7188             $tracelevel)
7189             if defined $::RD_TRACE;
7190 0         0 last;
7191             }
7192 2 50       40 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [stream_select]<< (}
7193             . @$_tok . q{ times)},
7194              
7195             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7196             q{command},
7197             $tracelevel)
7198             if defined $::RD_TRACE;
7199 2         17 $item{q{stream_select(s)}} = $_tok;
7200 2         7 push @item, $_tok;
7201            
7202              
7203              
7204 2 50       7 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
7205             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7206             q{command},
7207             $tracelevel)
7208             if defined $::RD_TRACE;
7209            
7210              
7211 2 50       7 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'stream_process',$item[3],$item[4]] };
  2         12  
7212 2 50       8 unless (defined $_tok)
7213             {
7214 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
7215             if defined $::RD_TRACE;
7216 0         0 last;
7217             }
7218 2 50       8 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
7219             . $_tok . q{])},
7220             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7221             if defined $::RD_TRACE;
7222 2         4 push @item, $_tok;
7223 2         5 $item{__ACTION1__}=$_tok;
7224            
7225              
7226 2 50       7 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(stream)\\b/ /--input-file|:f/, or /--input-pipe|:p/, or /--input-string|:s/, or /--output-file|:F/, or /--output-encoding|:E/, or /--output-pipe|:P/, or /--output-string|:S/, or /--no-output|:N/ stream_select]<<},
7227             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7228             q{command},
7229             $tracelevel)
7230             if defined $::RD_TRACE;
7231              
7232              
7233              
7234 2         5 $_matched = 1;
7235 2         5 last;
7236             }
7237              
7238              
7239 1136   66     3474 while (!$_matched && !$commit)
7240             {
7241            
7242 671 50       1346 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(undef|undefine)\\b/ /\\$?[a-zA-Z_][a-zA-Z0-9_]*/]},
7243             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
7244             q{command},
7245             $tracelevel)
7246             if defined $::RD_TRACE;
7247 671         1333 my $thisprod = $thisrule->{"prods"}[10];
7248 671         1188 $text = $_[1];
7249 671         873 my $_savetext;
7250 671         1387 @item = (q{command});
7251 671         1375 %item = (__RULE__ => q{command});
7252 671         1071 my $repcount = 0;
7253              
7254              
7255 671 50       1403 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(undef|undefine)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
7256             q{command},
7257             $tracelevel)
7258             if defined $::RD_TRACE;
7259 671         1045 undef $lastsep;
7260 671         1278 $expectation->is(q{})->at($text);
7261            
7262              
7263 671 100 33     4180 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(undef|undefine)\b)/)
  671 50       5010  
7264             {
7265 671 50       2014 $text = $lastsep . $text if defined $lastsep;
7266 671         1823 $expectation->failed();
7267 671 50       1379 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7268             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7269             if defined $::RD_TRACE;
7270              
7271 671         1230 last;
7272             }
7273 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
7274 0         0 substr($text,0,length($current_match),q{});
7275 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
7276             . $current_match . q{])},
7277             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7278             if defined $::RD_TRACE;
7279 0         0 push @item, $item{__PATTERN1__}=$current_match;
7280            
7281              
7282            
7283              
7284 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
7285             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7286             q{command},
7287             $tracelevel)
7288             if defined $::RD_TRACE;
7289 0         0 $_tok = do { $commit = 1 };
  0         0  
7290 0 0       0 if (defined($_tok))
7291             {
7292 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
7293             . $_tok . q{])},
7294             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7295             if defined $::RD_TRACE;
7296             }
7297             else
7298             {
7299 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7300             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7301             if defined $::RD_TRACE;
7302             }
7303            
7304 0 0       0 last unless defined $_tok;
7305 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
7306            
7307              
7308 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/\\$?[a-zA-Z_][a-zA-Z0-9_]*/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
7309             q{command},
7310             $tracelevel)
7311             if defined $::RD_TRACE;
7312 0         0 undef $lastsep;
7313 0         0 $expectation->is(q{/\\$?[a-zA-Z_][a-zA-Z0-9_]*/})->at($text);
7314            
7315              
7316 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:\$?[a-zA-Z_][a-zA-Z0-9_]*)/)
  0 0       0  
7317             {
7318 0 0       0 $text = $lastsep . $text if defined $lastsep;
7319 0         0 $expectation->failed();
7320 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7321             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7322             if defined $::RD_TRACE;
7323              
7324 0         0 last;
7325             }
7326 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
7327 0         0 substr($text,0,length($current_match),q{});
7328 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
7329             . $current_match . q{])},
7330             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7331             if defined $::RD_TRACE;
7332 0         0 push @item, $item{__PATTERN2__}=$current_match;
7333            
7334              
7335 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
7336             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7337             q{command},
7338             $tracelevel)
7339             if defined $::RD_TRACE;
7340            
7341              
7342 0 0       0 $_tok = ($_noactions) ? 0 : do {
7343 0         0 [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'undefine',$item[3]];
7344             };
7345 0 0       0 unless (defined $_tok)
7346             {
7347 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
7348             if defined $::RD_TRACE;
7349 0         0 last;
7350             }
7351 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
7352             . $_tok . q{])},
7353             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7354             if defined $::RD_TRACE;
7355 0         0 push @item, $_tok;
7356 0         0 $item{__ACTION1__}=$_tok;
7357            
7358              
7359 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(undef|undefine)\\b/ /\\$?[a-zA-Z_][a-zA-Z0-9_]*/]<<},
7360             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7361             q{command},
7362             $tracelevel)
7363             if defined $::RD_TRACE;
7364              
7365              
7366              
7367 0         0 $_matched = 1;
7368 0         0 last;
7369             }
7370              
7371              
7372 1136   66     3596 while (!$_matched && !$commit)
7373             {
7374            
7375 671 50       1520 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(use)\\b/ /XML::XSH2::(?:Inline|Compile)/]},
7376             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
7377             q{command},
7378             $tracelevel)
7379             if defined $::RD_TRACE;
7380 671         1285 my $thisprod = $thisrule->{"prods"}[11];
7381 671         1167 $text = $_[1];
7382 671         960 my $_savetext;
7383 671         1501 @item = (q{command});
7384 671         1489 %item = (__RULE__ => q{command});
7385 671         1096 my $repcount = 0;
7386              
7387              
7388 671 50       1267 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(use)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
7389             q{command},
7390             $tracelevel)
7391             if defined $::RD_TRACE;
7392 671         997 undef $lastsep;
7393 671         1230 $expectation->is(q{})->at($text);
7394            
7395              
7396 671 100 33     4228 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(use)\b)/)
  671 50       5109  
7397             {
7398 671 50       1973 $text = $lastsep . $text if defined $lastsep;
7399 671         1812 $expectation->failed();
7400 671 50       1424 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7401             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7402             if defined $::RD_TRACE;
7403              
7404 671         1313 last;
7405             }
7406 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
7407 0         0 substr($text,0,length($current_match),q{});
7408 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
7409             . $current_match . q{])},
7410             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7411             if defined $::RD_TRACE;
7412 0         0 push @item, $item{__PATTERN1__}=$current_match;
7413            
7414              
7415            
7416              
7417 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
7418             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7419             q{command},
7420             $tracelevel)
7421             if defined $::RD_TRACE;
7422 0         0 $_tok = do { $commit = 1 };
  0         0  
7423 0 0       0 if (defined($_tok))
7424             {
7425 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
7426             . $_tok . q{])},
7427             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7428             if defined $::RD_TRACE;
7429             }
7430             else
7431             {
7432 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7433             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7434             if defined $::RD_TRACE;
7435             }
7436            
7437 0 0       0 last unless defined $_tok;
7438 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
7439            
7440              
7441 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/XML::XSH2::(?:Inline|Compile)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
7442             q{command},
7443             $tracelevel)
7444             if defined $::RD_TRACE;
7445 0         0 undef $lastsep;
7446 0         0 $expectation->is(q{/XML::XSH2::(?:Inline|Compile)/})->at($text);
7447            
7448              
7449 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:XML::XSH2::(?:Inline|Compile))/)
  0 0       0  
7450             {
7451 0 0       0 $text = $lastsep . $text if defined $lastsep;
7452 0         0 $expectation->failed();
7453 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7454             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7455             if defined $::RD_TRACE;
7456              
7457 0         0 last;
7458             }
7459 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
7460 0         0 substr($text,0,length($current_match),q{});
7461 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
7462             . $current_match . q{])},
7463             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7464             if defined $::RD_TRACE;
7465 0         0 push @item, $item{__PATTERN2__}=$current_match;
7466            
7467              
7468 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
7469             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7470             q{command},
7471             $tracelevel)
7472             if defined $::RD_TRACE;
7473            
7474              
7475 0 0       0 $_tok = ($_noactions) ? 0 : do { 1 };
  0         0  
7476 0 0       0 unless (defined $_tok)
7477             {
7478 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
7479             if defined $::RD_TRACE;
7480 0         0 last;
7481             }
7482 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
7483             . $_tok . q{])},
7484             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7485             if defined $::RD_TRACE;
7486 0         0 push @item, $_tok;
7487 0         0 $item{__ACTION1__}=$_tok;
7488            
7489              
7490 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(use)\\b/ /XML::XSH2::(?:Inline|Compile)/]<<},
7491             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7492             q{command},
7493             $tracelevel)
7494             if defined $::RD_TRACE;
7495              
7496              
7497              
7498 0         0 $_matched = 1;
7499 0         0 last;
7500             }
7501              
7502              
7503 1136   66     3642 while (!$_matched && !$commit)
7504             {
7505            
7506 671 50       1421 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(test-mode|test_mode)/]},
7507             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
7508             q{command},
7509             $tracelevel)
7510             if defined $::RD_TRACE;
7511 671         1290 my $thisprod = $thisrule->{"prods"}[12];
7512 671         1257 $text = $_[1];
7513 671         1043 my $_savetext;
7514 671         1445 @item = (q{command});
7515 671         1637 %item = (__RULE__ => q{command});
7516 671         992 my $repcount = 0;
7517              
7518              
7519 671 50       1252 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(test-mode|test_mode)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
7520             q{command},
7521             $tracelevel)
7522             if defined $::RD_TRACE;
7523 671         1060 undef $lastsep;
7524 671         1323 $expectation->is(q{})->at($text);
7525            
7526              
7527 671 100 66     4069 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(test-mode|test_mode))/)
  671 100       4723  
7528             {
7529 670 50       1962 $text = $lastsep . $text if defined $lastsep;
7530 670         1729 $expectation->failed();
7531 670 50       1467 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7532             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7533             if defined $::RD_TRACE;
7534              
7535 670         1174 last;
7536             }
7537 1         9 $current_match = substr($text, $-[0], $+[0] - $-[0]);
7538 1         5 substr($text,0,length($current_match),q{});
7539 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
7540             . $current_match . q{])},
7541             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7542             if defined $::RD_TRACE;
7543 1         4 push @item, $item{__PATTERN1__}=$current_match;
7544            
7545              
7546 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
7547             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7548             q{command},
7549             $tracelevel)
7550             if defined $::RD_TRACE;
7551            
7552              
7553 1 50       3 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,"test-mode"] };
  1         5  
7554 1 50       4 unless (defined $_tok)
7555             {
7556 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
7557             if defined $::RD_TRACE;
7558 0         0 last;
7559             }
7560 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
7561             . $_tok . q{])},
7562             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7563             if defined $::RD_TRACE;
7564 1         3 push @item, $_tok;
7565 1         3 $item{__ACTION1__}=$_tok;
7566            
7567              
7568 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(test-mode|test_mode)/]<<},
7569             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7570             q{command},
7571             $tracelevel)
7572             if defined $::RD_TRACE;
7573              
7574              
7575              
7576 1         3 $_matched = 1;
7577 1         3 last;
7578             }
7579              
7580              
7581 1136   66     3365 while (!$_matched && !$commit)
7582             {
7583            
7584 670 50       1391 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(run-mode|run_mode)/]},
7585             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
7586             q{command},
7587             $tracelevel)
7588             if defined $::RD_TRACE;
7589 670         1280 my $thisprod = $thisrule->{"prods"}[13];
7590 670         1189 $text = $_[1];
7591 670         888 my $_savetext;
7592 670         1477 @item = (q{command});
7593 670         1407 %item = (__RULE__ => q{command});
7594 670         922 my $repcount = 0;
7595              
7596              
7597 670 50       1438 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(run-mode|run_mode)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
7598             q{command},
7599             $tracelevel)
7600             if defined $::RD_TRACE;
7601 670         1085 undef $lastsep;
7602 670         1457 $expectation->is(q{})->at($text);
7603            
7604              
7605 670 100 66     4222 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(run-mode|run_mode))/)
  670 100       4819  
7606             {
7607 669 50       2514 $text = $lastsep . $text if defined $lastsep;
7608 669         1727 $expectation->failed();
7609 669 50       1515 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7610             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7611             if defined $::RD_TRACE;
7612              
7613 669         1162 last;
7614             }
7615 1         7 $current_match = substr($text, $-[0], $+[0] - $-[0]);
7616 1         5 substr($text,0,length($current_match),q{});
7617 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
7618             . $current_match . q{])},
7619             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7620             if defined $::RD_TRACE;
7621 1         4 push @item, $item{__PATTERN1__}=$current_match;
7622            
7623              
7624 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
7625             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7626             q{command},
7627             $tracelevel)
7628             if defined $::RD_TRACE;
7629            
7630              
7631 1 50       4 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,"run-mode"] };
  1         6  
7632 1 50       4 unless (defined $_tok)
7633             {
7634 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
7635             if defined $::RD_TRACE;
7636 0         0 last;
7637             }
7638 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
7639             . $_tok . q{])},
7640             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7641             if defined $::RD_TRACE;
7642 1         2 push @item, $_tok;
7643 1         2 $item{__ACTION1__}=$_tok;
7644            
7645              
7646 1 50       11 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(run-mode|run_mode)/]<<},
7647             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7648             q{command},
7649             $tracelevel)
7650             if defined $::RD_TRACE;
7651              
7652              
7653              
7654 1         5 $_matched = 1;
7655 1         2 last;
7656             }
7657              
7658              
7659 1136   66     3423 while (!$_matched && !$commit)
7660             {
7661            
7662 669 50       1406 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?!(?:iterate|try|def|define)\\b)/ /\\.|[a-zA-Z_][-a-zA-Z0-9_]*/ exp_or_opt]},
7663             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
7664             q{command},
7665             $tracelevel)
7666             if defined $::RD_TRACE;
7667 669         1323 my $thisprod = $thisrule->{"prods"}[14];
7668 669         1141 $text = $_[1];
7669 669         935 my $_savetext;
7670 669         1402 @item = (q{command});
7671 669         1519 %item = (__RULE__ => q{command});
7672 669         1115 my $repcount = 0;
7673              
7674              
7675 669 50       1320 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?!(?:iterate|try|def|define)\\b)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
7676             q{command},
7677             $tracelevel)
7678             if defined $::RD_TRACE;
7679 669         1031 undef $lastsep;
7680 669         1461 $expectation->is(q{})->at($text);
7681            
7682              
7683 669 100 33     4051 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?!(?:iterate|try|def|define)\b))/)
  669 50       5649  
7684             {
7685 0 0       0 $text = $lastsep . $text if defined $lastsep;
7686 0         0 $expectation->failed();
7687 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7688             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7689             if defined $::RD_TRACE;
7690              
7691 0         0 last;
7692             }
7693 669         4307 $current_match = substr($text, $-[0], $+[0] - $-[0]);
7694 669         2563 substr($text,0,length($current_match),q{});
7695 669 50       1517 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
7696             . $current_match . q{])},
7697             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7698             if defined $::RD_TRACE;
7699 669         1906 push @item, $item{__PATTERN1__}=$current_match;
7700            
7701              
7702 669 50       1432 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/\\.|[a-zA-Z_][-a-zA-Z0-9_]*/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
7703             q{command},
7704             $tracelevel)
7705             if defined $::RD_TRACE;
7706 669         978 undef $lastsep;
7707 669         1460 $expectation->is(q{/\\.|[a-zA-Z_][-a-zA-Z0-9_]*/})->at($text);
7708            
7709              
7710 669 50 33     3996 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:\.|[a-zA-Z_][-a-zA-Z0-9_]*)/)
  669 50       5636  
7711             {
7712 0 0       0 $text = $lastsep . $text if defined $lastsep;
7713 0         0 $expectation->failed();
7714 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7715             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7716             if defined $::RD_TRACE;
7717              
7718 0         0 last;
7719             }
7720 669         3159 $current_match = substr($text, $-[0], $+[0] - $-[0]);
7721 669         2183 substr($text,0,length($current_match),q{});
7722 669 50       1538 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
7723             . $current_match . q{])},
7724             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7725             if defined $::RD_TRACE;
7726 669         1907 push @item, $item{__PATTERN2__}=$current_match;
7727            
7728              
7729 669 50       1462 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [exp_or_opt]},
7730             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7731             q{command},
7732             $tracelevel)
7733             if defined $::RD_TRACE;
7734 669         1436 $expectation->is(q{exp_or_opt})->at($text);
7735            
7736 669 50   1664   4168 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp_or_opt, 0, 100000000, $_noactions,$expectation,sub { \@arg },undef)))
  1664         3376  
7737             {
7738 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7739             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7740             q{command},
7741             $tracelevel)
7742             if defined $::RD_TRACE;
7743 0         0 last;
7744             }
7745 669 50       2548 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [exp_or_opt]<< (}
7746             . @$_tok . q{ times)},
7747              
7748             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7749             q{command},
7750             $tracelevel)
7751             if defined $::RD_TRACE;
7752 669         1572 $item{q{exp_or_opt(s?)}} = $_tok;
7753 669         1126 push @item, $_tok;
7754            
7755              
7756              
7757 669 50       1404 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
7758             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7759             q{command},
7760             $tracelevel)
7761             if defined $::RD_TRACE;
7762            
7763              
7764 669 50       1541 $_tok = ($_noactions) ? 0 : do {
7765             bless
7766 669         1149 [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,$item[2],@{$item[3]}],
  669         2491  
7767             'XML::XSH2::Command'
7768             };
7769 669 50       1698 unless (defined $_tok)
7770             {
7771 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
7772             if defined $::RD_TRACE;
7773 0         0 last;
7774             }
7775 669 50       1364 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
7776             . $_tok . q{])},
7777             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7778             if defined $::RD_TRACE;
7779 669         1089 push @item, $_tok;
7780 669         1297 $item{__ACTION1__}=$_tok;
7781            
7782              
7783 669 50       1305 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?!(?:iterate|try|def|define)\\b)/ /\\.|[a-zA-Z_][-a-zA-Z0-9_]*/ exp_or_opt]<<},
7784             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7785             q{command},
7786             $tracelevel)
7787             if defined $::RD_TRACE;
7788              
7789              
7790              
7791 669         907 $_matched = 1;
7792 669         1485 last;
7793             }
7794              
7795              
7796 1136 50 33     2784 unless ( $_matched || defined($score) )
7797             {
7798            
7799              
7800 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
7801 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7802             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
7803             q{command},
7804             $tracelevel)
7805             if defined $::RD_TRACE;
7806 0         0 return undef;
7807             }
7808 1136 50 33     4190 if (!defined($return) && defined($score))
7809             {
7810 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
7811             q{command},
7812             $tracelevel)
7813             if defined $::RD_TRACE;
7814 0         0 $return = $score_return;
7815             }
7816 1136         1615 splice @{$thisparser->{errors}}, $err_at;
  1136         2368  
7817 1136 50       2852 $return = $item[$#item] unless defined $return;
7818 1136 50       2257 if (defined $::RD_TRACE)
7819             {
7820 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
7821             $return . q{])}, "",
7822             q{command},
7823             $tracelevel);
7824 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
7825             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
7826             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7827             , q{command},
7828             $tracelevel)
7829             }
7830 1136         2507 $_[1] = $text;
7831 1136         9083 return $return;
7832             }
7833              
7834             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
7835             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::complex_command
7836             {
7837 1549     1549   2413 my $thisparser = $_[0];
7838 8     8   99 use vars q{$tracelevel};
  8         28  
  8         12347  
7839 1549   50     3668 local $tracelevel = ($tracelevel||0)+1;
7840 1549         2320 $ERRORS = 0;
7841 1549         3092 my $thisrule = $thisparser->{"rules"}{"complex_command"};
7842              
7843 1549 50       3194 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [complex_command]},
7844             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
7845             q{complex_command},
7846             $tracelevel)
7847             if defined $::RD_TRACE;
7848              
7849            
7850 1549         2002 my $err_at = @{$thisparser->{errors}};
  1549         2743  
7851              
7852 1549         3613 my $score;
7853             my $score_return;
7854 1549         0 my $_tok;
7855 1549         2236 my $return = undef;
7856 1549         2058 my $_matched=0;
7857 1549         2056 my $commit=0;
7858 1549         2433 my @item = ();
7859 1549         2170 my %item = ();
7860 1549         2149 my $repeating = $_[2];
7861 1549         2482 my $_noactions = $_[3];
7862 1549 50       2924 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  1549         1947  
  1549         3050  
7863 1549         2401 my $_itempos = $_[5];
7864 1549 50       3557 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
7865 1549         3341 my $text;
7866             my $lastsep;
7867 1549         0 my $current_match;
7868 1549         3359 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(?=\\s*[\{\}]|\\s*\\Z)/, or /\\s*;/, or /(?=(?:foreach|for|if|unless|iterate|while|try|def|define)\\b)/, or command});
7869 1549         3828 $expectation->at($_[1]);
7870            
7871 1549         2047 my $thisoffset;
7872 1549         5215 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
7873            
7874 1549         2472 my $thiscolumn;
7875 1549         3678 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
7876            
7877 1549         2516 my $thisline;
7878 1549         4025 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
7879              
7880            
7881              
7882 1549   33     6268 while (!$_matched && !$commit)
7883             {
7884            
7885 1549 50       3295 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?=\\s*[\{\}]|\\s*\\Z)/ ]},
7886             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
7887             q{complex_command},
7888             $tracelevel)
7889             if defined $::RD_TRACE;
7890 1549         3276 my $thisprod = $thisrule->{"prods"}[0];
7891 1549         2653 $text = $_[1];
7892 1549         2102 my $_savetext;
7893 1549         3087 @item = (q{complex_command});
7894 1549         3044 %item = (__RULE__ => q{complex_command});
7895 1549         2241 my $repcount = 0;
7896              
7897              
7898 1549 50       2987 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?=\\s*[\{\}]|\\s*\\Z)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
7899             q{complex_command},
7900             $tracelevel)
7901             if defined $::RD_TRACE;
7902 1549         2599 undef $lastsep;
7903 1549         3253 $expectation->is(q{})->at($text);
7904            
7905              
7906 1549 100 66     15307 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?=\s*[{}]|\s*\Z))/)
  1549 100       14274  
7907             {
7908 920 50       3173 $text = $lastsep . $text if defined $lastsep;
7909 920         2673 $expectation->failed();
7910 920 50       2011 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7911             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7912             if defined $::RD_TRACE;
7913              
7914 920         1907 last;
7915             }
7916 629         3096 $current_match = substr($text, $-[0], $+[0] - $-[0]);
7917 629         2062 substr($text,0,length($current_match),q{});
7918 629 50       1585 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
7919             . $current_match . q{])},
7920             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7921             if defined $::RD_TRACE;
7922 629         1634 push @item, $item{__PATTERN1__}=$current_match;
7923            
7924              
7925            
7926              
7927 629 50       1385 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
7928             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7929             q{complex_command},
7930             $tracelevel)
7931             if defined $::RD_TRACE;
7932 629         939 $_tok = do { $commit = 1 };
  629         1187  
7933 629 50       1310 if (defined($_tok))
7934             {
7935 629 50       1302 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
7936             . $_tok . q{])},
7937             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7938             if defined $::RD_TRACE;
7939             }
7940             else
7941             {
7942 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
7943             XML::XSH2::Parser::_Runtime::_tracefirst($text))
7944             if defined $::RD_TRACE;
7945             }
7946            
7947 629 50       1220 last unless defined $_tok;
7948 629         1376 push @item, $item{__DIRECTIVE1__}=$_tok;
7949            
7950              
7951 629 50       1212 XML::XSH2::Parser::_Runtime::_trace(q{>>Rejecting production<< (found )},
7952             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7953             q{complex_command},
7954             $tracelevel)
7955             if defined $::RD_TRACE;
7956 629         939 undef $return;
7957            
7958              
7959 629         872 $_tok = undef;
7960            
7961 629 50       2063 last unless defined $_tok;
7962              
7963 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?=\\s*[\{\}]|\\s*\\Z)/ ]<<},
7964             XML::XSH2::Parser::_Runtime::_tracefirst($text),
7965             q{complex_command},
7966             $tracelevel)
7967             if defined $::RD_TRACE;
7968              
7969              
7970              
7971 0         0 $_matched = 1;
7972 0         0 last;
7973             }
7974              
7975              
7976 1549   66     5706 while (!$_matched && !$commit)
7977             {
7978            
7979 920 50       1888 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/\\s*;/ ]},
7980             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
7981             q{complex_command},
7982             $tracelevel)
7983             if defined $::RD_TRACE;
7984 920         1729 my $thisprod = $thisrule->{"prods"}[1];
7985 920         1624 $text = $_[1];
7986 920         1273 my $_savetext;
7987 920         1987 @item = (q{complex_command});
7988 920         2280 %item = (__RULE__ => q{complex_command});
7989 920         1395 my $repcount = 0;
7990              
7991              
7992 920 50       1710 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/\\s*;/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
7993             q{complex_command},
7994             $tracelevel)
7995             if defined $::RD_TRACE;
7996 920         1412 undef $lastsep;
7997 920         1842 $expectation->is(q{})->at($text);
7998            
7999              
8000 920 100 66     5801 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:\s*;)/)
  920 100       8572  
8001             {
8002 908 50       2865 $text = $lastsep . $text if defined $lastsep;
8003 908         2406 $expectation->failed();
8004 908 50       1883 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8005             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8006             if defined $::RD_TRACE;
8007              
8008 908         1579 last;
8009             }
8010 12         93 $current_match = substr($text, $-[0], $+[0] - $-[0]);
8011 12         54 substr($text,0,length($current_match),q{});
8012 12 50       39 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
8013             . $current_match . q{])},
8014             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8015             if defined $::RD_TRACE;
8016 12         40 push @item, $item{__PATTERN1__}=$current_match;
8017            
8018              
8019            
8020              
8021 12 50       37 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
8022             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8023             q{complex_command},
8024             $tracelevel)
8025             if defined $::RD_TRACE;
8026 12         22 $_tok = do { $commit = 1 };
  12         28  
8027 12 50       52 if (defined($_tok))
8028             {
8029 12 50       40 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
8030             . $_tok . q{])},
8031             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8032             if defined $::RD_TRACE;
8033             }
8034             else
8035             {
8036 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8037             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8038             if defined $::RD_TRACE;
8039             }
8040            
8041 12 50       33 last unless defined $_tok;
8042 12         34 push @item, $item{__DIRECTIVE1__}=$_tok;
8043            
8044              
8045 12 50       42 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/\\s*;/ ]<<},
8046             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8047             q{complex_command},
8048             $tracelevel)
8049             if defined $::RD_TRACE;
8050              
8051              
8052              
8053 12         27 $_matched = 1;
8054 12         22 last;
8055             }
8056              
8057              
8058 1549   100     5929 while (!$_matched && !$commit)
8059             {
8060            
8061 908 50       1897 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?=(?:foreach|for|if|unless|iterate|while|try|def|define)\\b)/ statement trail]},
8062             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
8063             q{complex_command},
8064             $tracelevel)
8065             if defined $::RD_TRACE;
8066 908         1848 my $thisprod = $thisrule->{"prods"}[2];
8067 908         1591 $text = $_[1];
8068 908         1298 my $_savetext;
8069 908         1850 @item = (q{complex_command});
8070 908         1997 %item = (__RULE__ => q{complex_command});
8071 908         1341 my $repcount = 0;
8072              
8073              
8074 908 50       1734 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?=(?:foreach|for|if|unless|iterate|while|try|def|define)\\b)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
8075             q{complex_command},
8076             $tracelevel)
8077             if defined $::RD_TRACE;
8078 908         1374 undef $lastsep;
8079 908         1743 $expectation->is(q{})->at($text);
8080            
8081              
8082 908 100 66     5316 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?=(?:foreach|for|if|unless|iterate|while|try|def|define)\b))/)
  908 100       7741  
8083             {
8084 644 50       1895 $text = $lastsep . $text if defined $lastsep;
8085 644         1709 $expectation->failed();
8086 644 50       1476 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8087             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8088             if defined $::RD_TRACE;
8089              
8090 644         1087 last;
8091             }
8092 264         1926 $current_match = substr($text, $-[0], $+[0] - $-[0]);
8093 264         1045 substr($text,0,length($current_match),q{});
8094 264 50       750 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
8095             . $current_match . q{])},
8096             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8097             if defined $::RD_TRACE;
8098 264         856 push @item, $item{__PATTERN1__}=$current_match;
8099            
8100              
8101 264 50       678 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [statement]},
8102             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8103             q{complex_command},
8104             $tracelevel)
8105             if defined $::RD_TRACE;
8106 8     8   77 if (1) { no strict qw{refs};
  8         26  
  8         5858  
  264         391  
8107 264         610 $expectation->is(q{statement})->at($text);
8108 264 100   264   2033 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::statement($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  264         551  
8109             {
8110            
8111 222 50       537 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8112             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8113             q{complex_command},
8114             $tracelevel)
8115             if defined $::RD_TRACE;
8116 222         674 $expectation->failed();
8117 222         491 last;
8118             }
8119 42 50       216 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [statement]<< (return value: [}
8120             . $_tok . q{]},
8121              
8122             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8123             q{complex_command},
8124             $tracelevel)
8125             if defined $::RD_TRACE;
8126 42         135 $item{q{statement}} = $_tok;
8127 42         109 push @item, $_tok;
8128            
8129             }
8130              
8131            
8132              
8133 42 50       119 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
8134             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8135             q{complex_command},
8136             $tracelevel)
8137             if defined $::RD_TRACE;
8138 42         70 $_tok = do { $commit = 1 };
  42         94  
8139 42 50       119 if (defined($_tok))
8140             {
8141 42 50       171 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
8142             . $_tok . q{])},
8143             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8144             if defined $::RD_TRACE;
8145             }
8146             else
8147             {
8148 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8149             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8150             if defined $::RD_TRACE;
8151             }
8152            
8153 42 50       122 last unless defined $_tok;
8154 42         108 push @item, $item{__DIRECTIVE1__}=$_tok;
8155            
8156              
8157 42 50       107 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [trail]},
8158             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8159             q{complex_command},
8160             $tracelevel)
8161             if defined $::RD_TRACE;
8162 42         125 $expectation->is(q{trail})->at($text);
8163            
8164 42 50   42   312 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::trail, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  42         88  
8165             {
8166 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8167             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8168             q{complex_command},
8169             $tracelevel)
8170             if defined $::RD_TRACE;
8171 0         0 last;
8172             }
8173 42 50       179 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [trail]<< (}
8174             . @$_tok . q{ times)},
8175              
8176             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8177             q{complex_command},
8178             $tracelevel)
8179             if defined $::RD_TRACE;
8180 42         104 $item{q{trail(?)}} = $_tok;
8181 42         86 push @item, $_tok;
8182            
8183              
8184              
8185 42 50       129 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
8186             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8187             q{complex_command},
8188             $tracelevel)
8189             if defined $::RD_TRACE;
8190            
8191              
8192 42 50       101 $_tok = ($_noactions) ? 0 : do {
8193 42 50       67 if (scalar(@{$item[4]})) {
  42         140  
8194 0 0       0 if ($item[4][0][0] eq 'pipe') {
8195 0         0 $return=[$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'pipe_command',[$item[2]],$item[4][0][1]]
8196             } else {
8197 0         0 $return=[$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'string_pipe_command',[$item[2]],$item[4][0][1]]
8198             }
8199             } else {
8200 42         111 $return=$item[2]
8201             }
8202             };
8203 42 50       117 unless (defined $_tok)
8204             {
8205 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
8206             if defined $::RD_TRACE;
8207 0         0 last;
8208             }
8209 42 50       100 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
8210             . $_tok . q{])},
8211             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8212             if defined $::RD_TRACE;
8213 42         98 push @item, $_tok;
8214 42         82 $item{__ACTION1__}=$_tok;
8215            
8216              
8217 42 50       111 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?=(?:foreach|for|if|unless|iterate|while|try|def|define)\\b)/ statement trail]<<},
8218             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8219             q{complex_command},
8220             $tracelevel)
8221             if defined $::RD_TRACE;
8222              
8223              
8224              
8225 42         68 $_matched = 1;
8226 42         96 last;
8227             }
8228              
8229              
8230 1549   100     5748 while (!$_matched && !$commit)
8231             {
8232            
8233 866 50       1902 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [command trail /\\s*;|(?=\\s*\}|\\s*\\Z)/]},
8234             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
8235             q{complex_command},
8236             $tracelevel)
8237             if defined $::RD_TRACE;
8238 866         1737 my $thisprod = $thisrule->{"prods"}[3];
8239 866         1504 $text = $_[1];
8240 866         1252 my $_savetext;
8241 866         1906 @item = (q{complex_command});
8242 866         1931 %item = (__RULE__ => q{complex_command});
8243 866         1396 my $repcount = 0;
8244              
8245              
8246 866 50       1741 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [command]},
8247             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8248             q{complex_command},
8249             $tracelevel)
8250             if defined $::RD_TRACE;
8251 8     8   67 if (1) { no strict qw{refs};
  8         16  
  8         12587  
  866         1216  
8252 866         1810 $expectation->is(q{})->at($text);
8253 866 50   866   4628 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::command($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  866         1690  
8254             {
8255            
8256 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8257             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8258             q{complex_command},
8259             $tracelevel)
8260             if defined $::RD_TRACE;
8261 0         0 $expectation->failed();
8262 0         0 last;
8263             }
8264 866 50       3320 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [command]<< (return value: [}
8265             . $_tok . q{]},
8266              
8267             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8268             q{complex_command},
8269             $tracelevel)
8270             if defined $::RD_TRACE;
8271 866         2178 $item{q{command}} = $_tok;
8272 866         1547 push @item, $_tok;
8273            
8274             }
8275              
8276            
8277              
8278 866 50       1800 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
8279             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8280             q{complex_command},
8281             $tracelevel)
8282             if defined $::RD_TRACE;
8283 866         1255 $_tok = do { $commit = 1 };
  866         1607  
8284 866 50       1809 if (defined($_tok))
8285             {
8286 866 50       1916 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
8287             . $_tok . q{])},
8288             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8289             if defined $::RD_TRACE;
8290             }
8291             else
8292             {
8293 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8294             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8295             if defined $::RD_TRACE;
8296             }
8297            
8298 866 50       1705 last unless defined $_tok;
8299 866         1789 push @item, $item{__DIRECTIVE1__}=$_tok;
8300            
8301              
8302 866 50       1770 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [trail]},
8303             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8304             q{complex_command},
8305             $tracelevel)
8306             if defined $::RD_TRACE;
8307 866         2147 $expectation->is(q{trail})->at($text);
8308            
8309 866 50   866   4800 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::trail, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  866         1606  
8310             {
8311 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8312             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8313             q{complex_command},
8314             $tracelevel)
8315             if defined $::RD_TRACE;
8316 0         0 last;
8317             }
8318 866 50       3117 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [trail]<< (}
8319             . @$_tok . q{ times)},
8320              
8321             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8322             q{complex_command},
8323             $tracelevel)
8324             if defined $::RD_TRACE;
8325 866         1918 $item{q{trail(?)}} = $_tok;
8326 866         1484 push @item, $_tok;
8327            
8328              
8329              
8330 866 50       1608 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/\\s*;|(?=\\s*\}|\\s*\\Z)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
8331             q{complex_command},
8332             $tracelevel)
8333             if defined $::RD_TRACE;
8334 866         1385 undef $lastsep;
8335 866         2118 $expectation->is(q{/\\s*;|(?=\\s*\}|\\s*\\Z)/})->at($text);
8336            
8337              
8338 866 100 33     5880 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:\s*;|(?=\s*}|\s*\Z))/)
  866 50       7330  
8339             {
8340 0 0       0 $text = $lastsep . $text if defined $lastsep;
8341 0         0 $expectation->failed();
8342 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8343             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8344             if defined $::RD_TRACE;
8345              
8346 0         0 last;
8347             }
8348 866         4215 $current_match = substr($text, $-[0], $+[0] - $-[0]);
8349 866         2723 substr($text,0,length($current_match),q{});
8350 866 50       2021 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
8351             . $current_match . q{])},
8352             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8353             if defined $::RD_TRACE;
8354 866         2050 push @item, $item{__PATTERN1__}=$current_match;
8355            
8356              
8357 866 50       1734 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
8358             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8359             q{complex_command},
8360             $tracelevel)
8361             if defined $::RD_TRACE;
8362            
8363              
8364 866 50       1869 $_tok = ($_noactions) ? 0 : do {
8365 866 100       1099 if (scalar(@{$item[3]})) {
  866         2080  
8366 21 100       90 if ($item[3][0][0] eq 'pipe') {
8367 20         102 $return=[$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'pipe_command',[$item[1]],$item[3][0][1]]
8368             } else {
8369 1         6 $return=[$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'string_pipe_command',[$item[1]],$item[3][0][1]]
8370             }
8371             } else {
8372 845         2011 $return=$item[1]
8373             }
8374             };
8375 866 50       1918 unless (defined $_tok)
8376             {
8377 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
8378             if defined $::RD_TRACE;
8379 0         0 last;
8380             }
8381 866 50       1665 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
8382             . $_tok . q{])},
8383             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8384             if defined $::RD_TRACE;
8385 866         1321 push @item, $_tok;
8386 866         1511 $item{__ACTION1__}=$_tok;
8387            
8388              
8389 866 50       1829 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [command trail /\\s*;|(?=\\s*\}|\\s*\\Z)/]<<},
8390             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8391             q{complex_command},
8392             $tracelevel)
8393             if defined $::RD_TRACE;
8394              
8395              
8396              
8397 866         1249 $_matched = 1;
8398 866         1675 last;
8399             }
8400              
8401              
8402 1549         3345 while (!$_matched)
8403             {
8404            
8405 629 50       1388 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: []},
8406             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
8407             q{complex_command},
8408             $tracelevel)
8409             if defined $::RD_TRACE;
8410 629         1309 my $thisprod = $thisrule->{"prods"}[4];
8411            
8412 629         913 my $_savetext;
8413 629         1656 @item = (q{complex_command});
8414 629         1667 %item = (__RULE__ => q{complex_command});
8415 629         958 my $repcount = 0;
8416              
8417              
8418            
8419              
8420 629 50       1408 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
8421             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8422             q{complex_command},
8423             $tracelevel)
8424             if defined $::RD_TRACE;
8425 629 50       889 $_tok = do { if (1) { do {push @{$thisparser->{errors}}, [qq{Parse error near: "}.substr($text,0,40).qq{ ..."},$thisline];} unless $_noactions; undef } else {0} };
  629         811  
  629         1389  
  629         880  
  629         3579  
  629         1310  
8426 629 50       1492 if (defined($_tok))
8427             {
8428 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
8429             . $_tok . q{])},
8430             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8431             if defined $::RD_TRACE;
8432             }
8433             else
8434             {
8435 629 50       1366 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8436             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8437             if defined $::RD_TRACE;
8438             }
8439            
8440 629 50       1577 last unless defined $_tok;
8441 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
8442            
8443              
8444 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: []<<},
8445             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8446             q{complex_command},
8447             $tracelevel)
8448             if defined $::RD_TRACE;
8449              
8450              
8451              
8452 0         0 $_matched = 1;
8453 0         0 last;
8454             }
8455              
8456              
8457 1549 100 66     4369 unless ( $_matched || defined($score) )
8458             {
8459            
8460              
8461 629         1141 $_[1] = $text; # NOT SURE THIS IS NEEDED
8462 629 50       1370 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8463             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
8464             q{complex_command},
8465             $tracelevel)
8466             if defined $::RD_TRACE;
8467 629         4104 return undef;
8468             }
8469 920 50 66     2184 if (!defined($return) && defined($score))
8470             {
8471 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
8472             q{complex_command},
8473             $tracelevel)
8474             if defined $::RD_TRACE;
8475 0         0 $return = $score_return;
8476             }
8477 920         1306 splice @{$thisparser->{errors}}, $err_at;
  920         1987  
8478 920 100       2064 $return = $item[$#item] unless defined $return;
8479 920 50       1803 if (defined $::RD_TRACE)
8480             {
8481 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
8482             $return . q{])}, "",
8483             q{complex_command},
8484             $tracelevel);
8485 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
8486             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
8487             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8488             , q{complex_command},
8489             $tracelevel)
8490             }
8491 920         2061 $_[1] = $text;
8492 920         7033 return $return;
8493             }
8494              
8495             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
8496             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::else_block
8497             {
8498 8     8   18 my $thisparser = $_[0];
8499 8     8   78 use vars q{$tracelevel};
  8         17  
  8         5597  
8500 8   50     33 local $tracelevel = ($tracelevel||0)+1;
8501 8         20 $ERRORS = 0;
8502 8         20 my $thisrule = $thisparser->{"rules"}{"else_block"};
8503              
8504 8 50       21 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [else_block]},
8505             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
8506             q{else_block},
8507             $tracelevel)
8508             if defined $::RD_TRACE;
8509              
8510            
8511 8         11 my $err_at = @{$thisparser->{errors}};
  8         16  
8512              
8513 8         25 my $score;
8514             my $score_return;
8515 8         0 my $_tok;
8516 8         20 my $return = undef;
8517 8         13 my $_matched=0;
8518 8         11 my $commit=0;
8519 8         14 my @item = ();
8520 8         13 my %item = ();
8521 8         11 my $repeating = $_[2];
8522 8         13 my $_noactions = $_[3];
8523 8 50       19 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  8         14  
  8         11  
8524 8         19 my $_itempos = $_[5];
8525 8 50       29 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
8526 8         26 my $text;
8527             my $lastsep;
8528 8         0 my $current_match;
8529 8         21 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(else)\\b/, or /(?!else)/});
8530 8         23 $expectation->at($_[1]);
8531            
8532 8         28 my $thisoffset;
8533 8         29 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
8534            
8535 8         22 my $thiscolumn;
8536 8         25 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
8537            
8538 8         15 my $thisline;
8539 8         27 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
8540              
8541            
8542              
8543 8   33     57 while (!$_matched && !$commit)
8544             {
8545            
8546 8 50       17 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(else)\\b/ block]},
8547             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
8548             q{else_block},
8549             $tracelevel)
8550             if defined $::RD_TRACE;
8551 8         28 my $thisprod = $thisrule->{"prods"}[0];
8552 8         16 $text = $_[1];
8553 8         13 my $_savetext;
8554 8         23 @item = (q{else_block});
8555 8         22 %item = (__RULE__ => q{else_block});
8556 8         11 my $repcount = 0;
8557              
8558              
8559 8 50       22 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(else)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
8560             q{else_block},
8561             $tracelevel)
8562             if defined $::RD_TRACE;
8563 8         13 undef $lastsep;
8564 8         16 $expectation->is(q{})->at($text);
8565            
8566              
8567 8 100 66     120 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(else)\b)/)
  8 100       88  
8568             {
8569 4 50       17 $text = $lastsep . $text if defined $lastsep;
8570 4         13 $expectation->failed();
8571 4 50       12 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8572             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8573             if defined $::RD_TRACE;
8574              
8575 4         20 last;
8576             }
8577 4         20 $current_match = substr($text, $-[0], $+[0] - $-[0]);
8578 4         16 substr($text,0,length($current_match),q{});
8579 4 50       10 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
8580             . $current_match . q{])},
8581             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8582             if defined $::RD_TRACE;
8583 4         11 push @item, $item{__PATTERN1__}=$current_match;
8584            
8585              
8586            
8587              
8588 4 50       8 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
8589             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8590             q{else_block},
8591             $tracelevel)
8592             if defined $::RD_TRACE;
8593 4         5 $_tok = do { $commit = 1 };
  4         6  
8594 4 50       10 if (defined($_tok))
8595             {
8596 4 50       13 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
8597             . $_tok . q{])},
8598             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8599             if defined $::RD_TRACE;
8600             }
8601             else
8602             {
8603 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8604             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8605             if defined $::RD_TRACE;
8606             }
8607            
8608 4 50       12 last unless defined $_tok;
8609 4         9 push @item, $item{__DIRECTIVE1__}=$_tok;
8610            
8611              
8612 4 50       8 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
8613             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8614             q{else_block},
8615             $tracelevel)
8616             if defined $::RD_TRACE;
8617 8     8   66 if (1) { no strict qw{refs};
  8         16  
  8         10895  
  4         6  
8618 4         16 $expectation->is(q{block})->at($text);
8619 4 50   4   19 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  4         5  
8620             {
8621            
8622 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8623             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8624             q{else_block},
8625             $tracelevel)
8626             if defined $::RD_TRACE;
8627 0         0 $expectation->failed();
8628 0         0 last;
8629             }
8630 4 50       17 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
8631             . $_tok . q{]},
8632              
8633             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8634             q{else_block},
8635             $tracelevel)
8636             if defined $::RD_TRACE;
8637 4         9 $item{q{block}} = $_tok;
8638 4         7 push @item, $_tok;
8639            
8640             }
8641              
8642 4 50       9 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
8643             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8644             q{else_block},
8645             $tracelevel)
8646             if defined $::RD_TRACE;
8647            
8648              
8649 4 50       9 $_tok = ($_noactions) ? 0 : do { [[undef,$item[3]]] };
  4         8  
8650 4 50       11 unless (defined $_tok)
8651             {
8652 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
8653             if defined $::RD_TRACE;
8654 0         0 last;
8655             }
8656 4 50       7 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
8657             . $_tok . q{])},
8658             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8659             if defined $::RD_TRACE;
8660 4         8 push @item, $_tok;
8661 4         5 $item{__ACTION1__}=$_tok;
8662            
8663              
8664 4 50       9 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(else)\\b/ block]<<},
8665             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8666             q{else_block},
8667             $tracelevel)
8668             if defined $::RD_TRACE;
8669              
8670              
8671              
8672 4         6 $_matched = 1;
8673 4         6 last;
8674             }
8675              
8676              
8677 8   66     35 while (!$_matched && !$commit)
8678             {
8679            
8680 4 50       17 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?!else)/]},
8681             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
8682             q{else_block},
8683             $tracelevel)
8684             if defined $::RD_TRACE;
8685 4         17 my $thisprod = $thisrule->{"prods"}[1];
8686 4         18 $text = $_[1];
8687 4         8 my $_savetext;
8688 4         10 @item = (q{else_block});
8689 4         13 %item = (__RULE__ => q{else_block});
8690 4         8 my $repcount = 0;
8691              
8692              
8693 4 50       20 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?!else)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
8694             q{else_block},
8695             $tracelevel)
8696             if defined $::RD_TRACE;
8697 4         9 undef $lastsep;
8698 4         10 $expectation->is(q{})->at($text);
8699            
8700              
8701 4 50 33     91 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?!else))/)
  4 50       51  
8702             {
8703 0 0       0 $text = $lastsep . $text if defined $lastsep;
8704 0         0 $expectation->failed();
8705 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8706             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8707             if defined $::RD_TRACE;
8708              
8709 0         0 last;
8710             }
8711 4         24 $current_match = substr($text, $-[0], $+[0] - $-[0]);
8712 4         17 substr($text,0,length($current_match),q{});
8713 4 50       13 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
8714             . $current_match . q{])},
8715             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8716             if defined $::RD_TRACE;
8717 4         13 push @item, $item{__PATTERN1__}=$current_match;
8718            
8719              
8720 4 50       7220 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
8721             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8722             q{else_block},
8723             $tracelevel)
8724             if defined $::RD_TRACE;
8725            
8726              
8727 4 50       22 $_tok = ($_noactions) ? 0 : do { [] };
  4         9  
8728 4 50       14 unless (defined $_tok)
8729             {
8730 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
8731             if defined $::RD_TRACE;
8732 0         0 last;
8733             }
8734 4 50       13 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
8735             . $_tok . q{])},
8736             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8737             if defined $::RD_TRACE;
8738 4         7 push @item, $_tok;
8739 4         11 $item{__ACTION1__}=$_tok;
8740            
8741              
8742 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?!else)/]<<},
8743             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8744             q{else_block},
8745             $tracelevel)
8746             if defined $::RD_TRACE;
8747              
8748              
8749              
8750 4         7 $_matched = 1;
8751 4         12 last;
8752             }
8753              
8754              
8755 8         22 while (!$_matched)
8756             {
8757            
8758 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [ ]},
8759             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
8760             q{else_block},
8761             $tracelevel)
8762             if defined $::RD_TRACE;
8763 0         0 my $thisprod = $thisrule->{"prods"}[2];
8764 0         0 $text = $_[1];
8765 0         0 my $_savetext;
8766 0         0 @item = (q{else_block});
8767 0         0 %item = (__RULE__ => q{else_block});
8768 0         0 my $repcount = 0;
8769              
8770              
8771            
8772              
8773 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
8774             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8775             q{else_block},
8776             $tracelevel)
8777             if defined $::RD_TRACE;
8778 0         0 $_tok = do { $commit=0;1 };
  0         0  
  0         0  
8779 0 0       0 if (defined($_tok))
8780             {
8781 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
8782             . $_tok . q{])},
8783             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8784             if defined $::RD_TRACE;
8785             }
8786             else
8787             {
8788 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8789             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8790             if defined $::RD_TRACE;
8791             }
8792            
8793 0 0       0 last unless defined $_tok;
8794 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
8795            
8796              
8797            
8798              
8799 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
8800             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8801             q{else_block},
8802             $tracelevel)
8803             if defined $::RD_TRACE;
8804 0 0       0 $_tok = do { if (1) { do {push @{$thisparser->{errors}}, [qq{Parse error near keyword else: "}.substr($text,0,40).qq{ ..."},$thisline];} unless $_noactions; undef } else {0} };
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
8805 0 0       0 if (defined($_tok))
8806             {
8807 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
8808             . $_tok . q{])},
8809             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8810             if defined $::RD_TRACE;
8811             }
8812             else
8813             {
8814 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8815             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8816             if defined $::RD_TRACE;
8817             }
8818            
8819 0 0       0 last unless defined $_tok;
8820 0         0 push @item, $item{__DIRECTIVE2__}=$_tok;
8821            
8822              
8823 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [ ]<<},
8824             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8825             q{else_block},
8826             $tracelevel)
8827             if defined $::RD_TRACE;
8828              
8829              
8830              
8831 0         0 $_matched = 1;
8832 0         0 last;
8833             }
8834              
8835              
8836 8 50 33     25 unless ( $_matched || defined($score) )
8837             {
8838            
8839              
8840 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
8841 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8842             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
8843             q{else_block},
8844             $tracelevel)
8845             if defined $::RD_TRACE;
8846 0         0 return undef;
8847             }
8848 8 50 33     55 if (!defined($return) && defined($score))
8849             {
8850 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
8851             q{else_block},
8852             $tracelevel)
8853             if defined $::RD_TRACE;
8854 0         0 $return = $score_return;
8855             }
8856 8         12 splice @{$thisparser->{errors}}, $err_at;
  8         23  
8857 8 50       32 $return = $item[$#item] unless defined $return;
8858 8 50       21 if (defined $::RD_TRACE)
8859             {
8860 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
8861             $return . q{])}, "",
8862             q{else_block},
8863             $tracelevel);
8864 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
8865             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
8866             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8867             , q{else_block},
8868             $tracelevel)
8869             }
8870 8         20 $_[1] = $text;
8871 8         93 return $return;
8872             }
8873              
8874             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
8875             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::elsif_block
8876             {
8877 4     4   12 my $thisparser = $_[0];
8878 8     8   87 use vars q{$tracelevel};
  8         20  
  8         5440  
8879 4   50     16 local $tracelevel = ($tracelevel||0)+1;
8880 4         11 $ERRORS = 0;
8881 4         17 my $thisrule = $thisparser->{"rules"}{"elsif_block"};
8882              
8883 4 50       25 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [elsif_block]},
8884             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
8885             q{elsif_block},
8886             $tracelevel)
8887             if defined $::RD_TRACE;
8888              
8889            
8890 4         11 my $err_at = @{$thisparser->{errors}};
  4         13  
8891              
8892 4         16 my $score;
8893             my $score_return;
8894 4         0 my $_tok;
8895 4         8 my $return = undef;
8896 4         7 my $_matched=0;
8897 4         6 my $commit=0;
8898 4         11 my @item = ();
8899 4         8 my %item = ();
8900 4         10 my $repeating = $_[2];
8901 4         8 my $_noactions = $_[3];
8902 4 50       15 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  4         6  
  4         17  
8903 4         17 my $_itempos = $_[5];
8904 4 50       22 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
8905 4         13 my $text;
8906             my $lastsep;
8907 4         0 my $current_match;
8908 4         12 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(elsif)\\b/, or /(?!elsif)/});
8909 4         17 $expectation->at($_[1]);
8910            
8911 4         5 my $thisoffset;
8912 4         17 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
8913            
8914 4         12 my $thiscolumn;
8915 4         23 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
8916            
8917 4         9 my $thisline;
8918 4         12 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
8919              
8920            
8921              
8922 4   33     29 while (!$_matched && !$commit)
8923             {
8924            
8925 4 50       23 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(elsif)\\b/ exp block elsif_block]},
8926             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
8927             q{elsif_block},
8928             $tracelevel)
8929             if defined $::RD_TRACE;
8930 4         15 my $thisprod = $thisrule->{"prods"}[0];
8931 4         12 $text = $_[1];
8932 4         7 my $_savetext;
8933 4         14 @item = (q{elsif_block});
8934 4         15 %item = (__RULE__ => q{elsif_block});
8935 4         7 my $repcount = 0;
8936              
8937              
8938 4 50       12 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(elsif)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
8939             q{elsif_block},
8940             $tracelevel)
8941             if defined $::RD_TRACE;
8942 4         8 undef $lastsep;
8943 4         17 $expectation->is(q{})->at($text);
8944            
8945              
8946 4 100 33     136 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(elsif)\b)/)
  4 50       55  
8947             {
8948 4 50       18 $text = $lastsep . $text if defined $lastsep;
8949 4         12 $expectation->failed();
8950 4 50       15 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8951             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8952             if defined $::RD_TRACE;
8953              
8954 4         10 last;
8955             }
8956 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
8957 0         0 substr($text,0,length($current_match),q{});
8958 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
8959             . $current_match . q{])},
8960             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8961             if defined $::RD_TRACE;
8962 0         0 push @item, $item{__PATTERN1__}=$current_match;
8963            
8964              
8965            
8966              
8967 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
8968             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8969             q{elsif_block},
8970             $tracelevel)
8971             if defined $::RD_TRACE;
8972 0         0 $_tok = do { $commit = 1 };
  0         0  
8973 0 0       0 if (defined($_tok))
8974             {
8975 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
8976             . $_tok . q{])},
8977             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8978             if defined $::RD_TRACE;
8979             }
8980             else
8981             {
8982 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
8983             XML::XSH2::Parser::_Runtime::_tracefirst($text))
8984             if defined $::RD_TRACE;
8985             }
8986            
8987 0 0       0 last unless defined $_tok;
8988 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
8989            
8990              
8991 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
8992             XML::XSH2::Parser::_Runtime::_tracefirst($text),
8993             q{elsif_block},
8994             $tracelevel)
8995             if defined $::RD_TRACE;
8996 8     8   93 if (1) { no strict qw{refs};
  8         20  
  8         1550  
  0         0  
8997 0         0 $expectation->is(q{exp})->at($text);
8998 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
8999             {
9000            
9001 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9002             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9003             q{elsif_block},
9004             $tracelevel)
9005             if defined $::RD_TRACE;
9006 0         0 $expectation->failed();
9007 0         0 last;
9008             }
9009 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
9010             . $_tok . q{]},
9011              
9012             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9013             q{elsif_block},
9014             $tracelevel)
9015             if defined $::RD_TRACE;
9016 0         0 $item{q{exp}} = $_tok;
9017 0         0 push @item, $_tok;
9018            
9019             }
9020              
9021 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
9022             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9023             q{elsif_block},
9024             $tracelevel)
9025             if defined $::RD_TRACE;
9026 8     8   57 if (1) { no strict qw{refs};
  8         16  
  8         1676  
  0         0  
9027 0         0 $expectation->is(q{block})->at($text);
9028 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
9029             {
9030            
9031 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9032             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9033             q{elsif_block},
9034             $tracelevel)
9035             if defined $::RD_TRACE;
9036 0         0 $expectation->failed();
9037 0         0 last;
9038             }
9039 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
9040             . $_tok . q{]},
9041              
9042             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9043             q{elsif_block},
9044             $tracelevel)
9045             if defined $::RD_TRACE;
9046 0         0 $item{q{block}} = $_tok;
9047 0         0 push @item, $_tok;
9048            
9049             }
9050              
9051 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [elsif_block]},
9052             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9053             q{elsif_block},
9054             $tracelevel)
9055             if defined $::RD_TRACE;
9056 8     8   63 if (1) { no strict qw{refs};
  8         44  
  8         11145  
  0         0  
9057 0         0 $expectation->is(q{elsif_block})->at($text);
9058 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::elsif_block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
9059             {
9060            
9061 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9062             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9063             q{elsif_block},
9064             $tracelevel)
9065             if defined $::RD_TRACE;
9066 0         0 $expectation->failed();
9067 0         0 last;
9068             }
9069 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [elsif_block]<< (return value: [}
9070             . $_tok . q{]},
9071              
9072             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9073             q{elsif_block},
9074             $tracelevel)
9075             if defined $::RD_TRACE;
9076 0         0 $item{q{elsif_block}} = $_tok;
9077 0         0 push @item, $_tok;
9078            
9079             }
9080              
9081 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
9082             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9083             q{elsif_block},
9084             $tracelevel)
9085             if defined $::RD_TRACE;
9086            
9087              
9088 0 0       0 $_tok = ($_noactions) ? 0 : do { [[$item[3],$item[4]],@{$item[5]}] };
  0         0  
  0         0  
9089 0 0       0 unless (defined $_tok)
9090             {
9091 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
9092             if defined $::RD_TRACE;
9093 0         0 last;
9094             }
9095 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
9096             . $_tok . q{])},
9097             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9098             if defined $::RD_TRACE;
9099 0         0 push @item, $_tok;
9100 0         0 $item{__ACTION1__}=$_tok;
9101            
9102              
9103 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(elsif)\\b/ exp block elsif_block]<<},
9104             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9105             q{elsif_block},
9106             $tracelevel)
9107             if defined $::RD_TRACE;
9108              
9109              
9110              
9111 0         0 $_matched = 1;
9112 0         0 last;
9113             }
9114              
9115              
9116 4   33     33 while (!$_matched && !$commit)
9117             {
9118            
9119 4 50       13 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?!elsif)/]},
9120             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
9121             q{elsif_block},
9122             $tracelevel)
9123             if defined $::RD_TRACE;
9124 4         11 my $thisprod = $thisrule->{"prods"}[1];
9125 4         7 $text = $_[1];
9126 4         6 my $_savetext;
9127 4         24 @item = (q{elsif_block});
9128 4         13 %item = (__RULE__ => q{elsif_block});
9129 4         13 my $repcount = 0;
9130              
9131              
9132 4 50       20 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?!elsif)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
9133             q{elsif_block},
9134             $tracelevel)
9135             if defined $::RD_TRACE;
9136 4         9 undef $lastsep;
9137 4         17 $expectation->is(q{})->at($text);
9138            
9139              
9140 4 100 33     76 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?!elsif))/)
  4 50       61  
9141             {
9142 0 0       0 $text = $lastsep . $text if defined $lastsep;
9143 0         0 $expectation->failed();
9144 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9145             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9146             if defined $::RD_TRACE;
9147              
9148 0         0 last;
9149             }
9150 4         24 $current_match = substr($text, $-[0], $+[0] - $-[0]);
9151 4         17 substr($text,0,length($current_match),q{});
9152 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
9153             . $current_match . q{])},
9154             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9155             if defined $::RD_TRACE;
9156 4         14 push @item, $item{__PATTERN1__}=$current_match;
9157            
9158              
9159 4 50       15 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
9160             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9161             q{elsif_block},
9162             $tracelevel)
9163             if defined $::RD_TRACE;
9164            
9165              
9166 4 50       13 $_tok = ($_noactions) ? 0 : do { [] };
  4         9  
9167 4 50       17 unless (defined $_tok)
9168             {
9169 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
9170             if defined $::RD_TRACE;
9171 0         0 last;
9172             }
9173 4 50       13 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
9174             . $_tok . q{])},
9175             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9176             if defined $::RD_TRACE;
9177 4         26 push @item, $_tok;
9178 4         12 $item{__ACTION1__}=$_tok;
9179            
9180              
9181 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?!elsif)/]<<},
9182             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9183             q{elsif_block},
9184             $tracelevel)
9185             if defined $::RD_TRACE;
9186              
9187              
9188              
9189 4         8 $_matched = 1;
9190 4         10 last;
9191             }
9192              
9193              
9194 4         27 while (!$_matched)
9195             {
9196            
9197 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [ ]},
9198             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
9199             q{elsif_block},
9200             $tracelevel)
9201             if defined $::RD_TRACE;
9202 0         0 my $thisprod = $thisrule->{"prods"}[2];
9203 0         0 $text = $_[1];
9204 0         0 my $_savetext;
9205 0         0 @item = (q{elsif_block});
9206 0         0 %item = (__RULE__ => q{elsif_block});
9207 0         0 my $repcount = 0;
9208              
9209              
9210            
9211              
9212 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
9213             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9214             q{elsif_block},
9215             $tracelevel)
9216             if defined $::RD_TRACE;
9217 0         0 $_tok = do { $commit=0;1 };
  0         0  
  0         0  
9218 0 0       0 if (defined($_tok))
9219             {
9220 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
9221             . $_tok . q{])},
9222             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9223             if defined $::RD_TRACE;
9224             }
9225             else
9226             {
9227 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9228             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9229             if defined $::RD_TRACE;
9230             }
9231            
9232 0 0       0 last unless defined $_tok;
9233 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
9234            
9235              
9236            
9237              
9238 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
9239             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9240             q{elsif_block},
9241             $tracelevel)
9242             if defined $::RD_TRACE;
9243 0 0       0 $_tok = do { if (1) { do {push @{$thisparser->{errors}}, [qq{Parse error near keyword elsif: "}.substr($text,0,40).qq{ ..."},$thisline];} unless $_noactions; undef } else {0} };
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
9244 0 0       0 if (defined($_tok))
9245             {
9246 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
9247             . $_tok . q{])},
9248             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9249             if defined $::RD_TRACE;
9250             }
9251             else
9252             {
9253 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9254             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9255             if defined $::RD_TRACE;
9256             }
9257            
9258 0 0       0 last unless defined $_tok;
9259 0         0 push @item, $item{__DIRECTIVE2__}=$_tok;
9260            
9261              
9262 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [ ]<<},
9263             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9264             q{elsif_block},
9265             $tracelevel)
9266             if defined $::RD_TRACE;
9267              
9268              
9269              
9270 0         0 $_matched = 1;
9271 0         0 last;
9272             }
9273              
9274              
9275 4 50 33     22 unless ( $_matched || defined($score) )
9276             {
9277            
9278              
9279 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
9280 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9281             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
9282             q{elsif_block},
9283             $tracelevel)
9284             if defined $::RD_TRACE;
9285 0         0 return undef;
9286             }
9287 4 50 33     27 if (!defined($return) && defined($score))
9288             {
9289 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
9290             q{elsif_block},
9291             $tracelevel)
9292             if defined $::RD_TRACE;
9293 0         0 $return = $score_return;
9294             }
9295 4         6 splice @{$thisparser->{errors}}, $err_at;
  4         15  
9296 4 50       16 $return = $item[$#item] unless defined $return;
9297 4 50       43 if (defined $::RD_TRACE)
9298             {
9299 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
9300             $return . q{])}, "",
9301             q{elsif_block},
9302             $tracelevel);
9303 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
9304             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
9305             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9306             , q{elsif_block},
9307             $tracelevel)
9308             }
9309 4         12 $_[1] = $text;
9310 4         41 return $return;
9311             }
9312              
9313             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
9314             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::enc_string
9315             {
9316 0     0   0 my $thisparser = $_[0];
9317 8     8   73 use vars q{$tracelevel};
  8         20  
  8         3243  
9318 0   0     0 local $tracelevel = ($tracelevel||0)+1;
9319 0         0 $ERRORS = 0;
9320 0         0 my $thisrule = $thisparser->{"rules"}{"enc_string"};
9321              
9322 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [enc_string]},
9323             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
9324             q{enc_string},
9325             $tracelevel)
9326             if defined $::RD_TRACE;
9327              
9328            
9329 0         0 my $err_at = @{$thisparser->{errors}};
  0         0  
9330              
9331 0         0 my $score;
9332             my $score_return;
9333 0         0 my $_tok;
9334 0         0 my $return = undef;
9335 0         0 my $_matched=0;
9336 0         0 my $commit=0;
9337 0         0 my @item = ();
9338 0         0 my %item = ();
9339 0         0 my $repeating = $_[2];
9340 0         0 my $_noactions = $_[3];
9341 0 0       0 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  0         0  
  0         0  
9342 0         0 my $_itempos = $_[5];
9343 0 0       0 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
9344 0         0 my $text;
9345             my $lastsep;
9346 0         0 my $current_match;
9347 0         0 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{exp});
9348 0         0 $expectation->at($_[1]);
9349            
9350 0         0 my $thisoffset;
9351 0         0 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
9352            
9353 0         0 my $thiscolumn;
9354 0         0 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
9355            
9356 0         0 my $thisline;
9357 0         0 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
9358              
9359            
9360              
9361 0   0     0 while (!$_matched && !$commit)
9362             {
9363            
9364 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [exp]},
9365             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
9366             q{enc_string},
9367             $tracelevel)
9368             if defined $::RD_TRACE;
9369 0         0 my $thisprod = $thisrule->{"prods"}[0];
9370 0         0 $text = $_[1];
9371 0         0 my $_savetext;
9372 0         0 @item = (q{enc_string});
9373 0         0 %item = (__RULE__ => q{enc_string});
9374 0         0 my $repcount = 0;
9375              
9376              
9377 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
9378             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9379             q{enc_string},
9380             $tracelevel)
9381             if defined $::RD_TRACE;
9382 8     8   63 if (1) { no strict qw{refs};
  8         33  
  8         3727  
  0         0  
9383 0         0 $expectation->is(q{})->at($text);
9384 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
9385             {
9386            
9387 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9388             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9389             q{enc_string},
9390             $tracelevel)
9391             if defined $::RD_TRACE;
9392 0         0 $expectation->failed();
9393 0         0 last;
9394             }
9395 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
9396             . $_tok . q{]},
9397              
9398             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9399             q{enc_string},
9400             $tracelevel)
9401             if defined $::RD_TRACE;
9402 0         0 $item{q{exp}} = $_tok;
9403 0         0 push @item, $_tok;
9404            
9405             }
9406              
9407 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [exp]<<},
9408             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9409             q{enc_string},
9410             $tracelevel)
9411             if defined $::RD_TRACE;
9412              
9413              
9414              
9415 0         0 $_matched = 1;
9416 0         0 last;
9417             }
9418              
9419              
9420 0 0 0     0 unless ( $_matched || defined($score) )
9421             {
9422            
9423              
9424 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
9425 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9426             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
9427             q{enc_string},
9428             $tracelevel)
9429             if defined $::RD_TRACE;
9430 0         0 return undef;
9431             }
9432 0 0 0     0 if (!defined($return) && defined($score))
9433             {
9434 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
9435             q{enc_string},
9436             $tracelevel)
9437             if defined $::RD_TRACE;
9438 0         0 $return = $score_return;
9439             }
9440 0         0 splice @{$thisparser->{errors}}, $err_at;
  0         0  
9441 0 0       0 $return = $item[$#item] unless defined $return;
9442 0 0       0 if (defined $::RD_TRACE)
9443             {
9444 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
9445             $return . q{])}, "",
9446             q{enc_string},
9447             $tracelevel);
9448 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
9449             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
9450             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9451             , q{enc_string},
9452             $tracelevel)
9453             }
9454 0         0 $_[1] = $text;
9455 0         0 return $return;
9456             }
9457              
9458             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
9459             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::eof
9460             {
9461 574     574   1078 my $thisparser = $_[0];
9462 8     8   62 use vars q{$tracelevel};
  8         18  
  8         7404  
9463 574   50     1460 local $tracelevel = ($tracelevel||0)+1;
9464 574         857 $ERRORS = 0;
9465 574         1437 my $thisrule = $thisparser->{"rules"}{"eof"};
9466              
9467 574 50       1201 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [eof]},
9468             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
9469             q{eof},
9470             $tracelevel)
9471             if defined $::RD_TRACE;
9472              
9473            
9474 574         777 my $err_at = @{$thisparser->{errors}};
  574         1056  
9475              
9476 574         1460 my $score;
9477             my $score_return;
9478 574         0 my $_tok;
9479 574         890 my $return = undef;
9480 574         762 my $_matched=0;
9481 574         881 my $commit=0;
9482 574         922 my @item = ();
9483 574         876 my %item = ();
9484 574         794 my $repeating = $_[2];
9485 574         801 my $_noactions = $_[3];
9486 574 50       1186 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  574         811  
  574         1080  
9487 574         966 my $_itempos = $_[5];
9488 574 50       1545 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
9489 574         1389 my $text;
9490             my $lastsep;
9491 574         0 my $current_match;
9492 574         1264 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/\\Z/});
9493 574         1456 $expectation->at($_[1]);
9494            
9495 574         760 my $thisoffset;
9496 574         1907 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
9497            
9498 574         991 my $thiscolumn;
9499 574         1525 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
9500            
9501 574         997 my $thisline;
9502 574         1430 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
9503              
9504            
9505              
9506 574   33     2606 while (!$_matched && !$commit)
9507             {
9508            
9509 574 50       1235 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/\\Z/]},
9510             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
9511             q{eof},
9512             $tracelevel)
9513             if defined $::RD_TRACE;
9514 574         1349 my $thisprod = $thisrule->{"prods"}[0];
9515 574         1067 $text = $_[1];
9516 574         833 my $_savetext;
9517 574         1210 @item = (q{eof});
9518 574         1253 %item = (__RULE__ => q{eof});
9519 574         805 my $repcount = 0;
9520              
9521              
9522 574 50       1198 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/\\Z/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
9523             q{eof},
9524             $tracelevel)
9525             if defined $::RD_TRACE;
9526 574         1034 undef $lastsep;
9527 574         1173 $expectation->is(q{})->at($text);
9528            
9529              
9530 574 100 33     4887 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:\Z)/)
  574 50       4599  
9531             {
9532 0 0       0 $text = $lastsep . $text if defined $lastsep;
9533 0         0 $expectation->failed();
9534 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9535             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9536             if defined $::RD_TRACE;
9537              
9538 0         0 last;
9539             }
9540 574         2793 $current_match = substr($text, $-[0], $+[0] - $-[0]);
9541 574         1887 substr($text,0,length($current_match),q{});
9542 574 50       1349 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
9543             . $current_match . q{])},
9544             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9545             if defined $::RD_TRACE;
9546 574         1481 push @item, $item{__PATTERN1__}=$current_match;
9547            
9548              
9549 574 50       1208 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
9550             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9551             q{eof},
9552             $tracelevel)
9553             if defined $::RD_TRACE;
9554            
9555              
9556 574 50       1133 $_tok = ($_noactions) ? 0 : do { 1; };
  574         945  
9557 574 50       1285 unless (defined $_tok)
9558             {
9559 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
9560             if defined $::RD_TRACE;
9561 0         0 last;
9562             }
9563 574 50       1172 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
9564             . $_tok . q{])},
9565             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9566             if defined $::RD_TRACE;
9567 574         877 push @item, $_tok;
9568 574         1015 $item{__ACTION1__}=$_tok;
9569            
9570              
9571 574 50       1170 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/\\Z/]<<},
9572             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9573             q{eof},
9574             $tracelevel)
9575             if defined $::RD_TRACE;
9576              
9577              
9578              
9579 574         859 $_matched = 1;
9580 574         1049 last;
9581             }
9582              
9583              
9584 574 50 33     1603 unless ( $_matched || defined($score) )
9585             {
9586            
9587              
9588 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
9589 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9590             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
9591             q{eof},
9592             $tracelevel)
9593             if defined $::RD_TRACE;
9594 0         0 return undef;
9595             }
9596 574 50 33     2388 if (!defined($return) && defined($score))
9597             {
9598 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
9599             q{eof},
9600             $tracelevel)
9601             if defined $::RD_TRACE;
9602 0         0 $return = $score_return;
9603             }
9604 574         803 splice @{$thisparser->{errors}}, $err_at;
  574         1307  
9605 574 50       1523 $return = $item[$#item] unless defined $return;
9606 574 50       1364 if (defined $::RD_TRACE)
9607             {
9608 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
9609             $return . q{])}, "",
9610             q{eof},
9611             $tracelevel);
9612 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
9613             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
9614             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9615             , q{eof},
9616             $tracelevel)
9617             }
9618 574         1038 $_[1] = $text;
9619 574         3581 return $return;
9620             }
9621              
9622             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
9623             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp
9624             {
9625 1453     1453   2348 my $thisparser = $_[0];
9626 8     8   66 use vars q{$tracelevel};
  8         27  
  8         4869  
9627 1453   50     3290 local $tracelevel = ($tracelevel||0)+1;
9628 1453         2106 $ERRORS = 0;
9629 1453         2850 my $thisrule = $thisparser->{"rules"}{"exp"};
9630              
9631 1453 50       2969 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [exp]},
9632             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
9633             q{exp},
9634             $tracelevel)
9635             if defined $::RD_TRACE;
9636              
9637            
9638 1453         1966 my $err_at = @{$thisparser->{errors}};
  1453         2479  
9639              
9640 1453         3528 my $score;
9641             my $score_return;
9642 1453         0 my $_tok;
9643 1453         2039 my $return = undef;
9644 1453         1855 my $_matched=0;
9645 1453         1944 my $commit=0;
9646 1453         2144 my @item = ();
9647 1453         2229 my %item = ();
9648 1453         1913 my $repeating = $_[2];
9649 1453         2148 my $_noactions = $_[3];
9650 1453 50       2926 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  1453         2080  
  1453         2428  
9651 1453         2127 my $_itempos = $_[5];
9652 1453 50       3095 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
9653 1453         3308 my $text;
9654             my $lastsep;
9655 1453         0 my $current_match;
9656 1453         3052 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/^(?=\{)/, or '&', or /^(?=<<)/, or xpath});
9657 1453         3573 $expectation->at($_[1]);
9658            
9659 1453         1877 my $thisoffset;
9660 1453         4601 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
9661            
9662 1453         2259 my $thiscolumn;
9663 1453         3311 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
9664            
9665 1453         2144 my $thisline;
9666 1453         3350 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
9667              
9668            
9669              
9670 1453   33     5891 while (!$_matched && !$commit)
9671             {
9672            
9673 1453 50       2833 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/^(?=\{)/ perl_block]},
9674             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
9675             q{exp},
9676             $tracelevel)
9677             if defined $::RD_TRACE;
9678 1453         2850 my $thisprod = $thisrule->{"prods"}[0];
9679 1453         2554 $text = $_[1];
9680 1453         2036 my $_savetext;
9681 1453         3036 @item = (q{exp});
9682 1453         2611 %item = (__RULE__ => q{exp});
9683 1453         2080 my $repcount = 0;
9684              
9685              
9686 1453 50       2644 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/^(?=\{)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
9687             q{exp},
9688             $tracelevel)
9689             if defined $::RD_TRACE;
9690 1453         2330 undef $lastsep;
9691 1453         2902 $expectation->is(q{})->at($text);
9692            
9693              
9694 1453 100 66     10977 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:^(?={))/)
  1453 100       12044  
9695             {
9696 1336 50       4445 $text = $lastsep . $text if defined $lastsep;
9697 1336         3640 $expectation->failed();
9698 1336 50       2636 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9699             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9700             if defined $::RD_TRACE;
9701              
9702 1336         2827 last;
9703             }
9704 117         667 $current_match = substr($text, $-[0], $+[0] - $-[0]);
9705 117         489 substr($text,0,length($current_match),q{});
9706 117 50       313 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
9707             . $current_match . q{])},
9708             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9709             if defined $::RD_TRACE;
9710 117         340 push @item, $item{__PATTERN1__}=$current_match;
9711            
9712              
9713 117 50       286 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [perl_block]},
9714             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9715             q{exp},
9716             $tracelevel)
9717             if defined $::RD_TRACE;
9718 8     8   130 if (1) { no strict qw{refs};
  8         70  
  8         4655  
  117         194  
9719 117         286 $expectation->is(q{perl_block})->at($text);
9720 117 50   117   693 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::perl_block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  117         250  
9721             {
9722            
9723 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9724             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9725             q{exp},
9726             $tracelevel)
9727             if defined $::RD_TRACE;
9728 0         0 $expectation->failed();
9729 0         0 last;
9730             }
9731 117 50       590 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [perl_block]<< (return value: [}
9732             . $_tok . q{]},
9733              
9734             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9735             q{exp},
9736             $tracelevel)
9737             if defined $::RD_TRACE;
9738 117         270 $item{q{perl_block}} = $_tok;
9739 117         221 push @item, $_tok;
9740            
9741             }
9742              
9743 117 50       258 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
9744             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9745             q{exp},
9746             $tracelevel)
9747             if defined $::RD_TRACE;
9748            
9749              
9750 117 50       248 $_tok = ($_noactions) ? 0 : do { $item[2] };
  117         207  
9751 117 50       278 unless (defined $_tok)
9752             {
9753 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
9754             if defined $::RD_TRACE;
9755 0         0 last;
9756             }
9757 117 50       230 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
9758             . $_tok . q{])},
9759             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9760             if defined $::RD_TRACE;
9761 117         471 push @item, $_tok;
9762 117         243 $item{__ACTION1__}=$_tok;
9763            
9764              
9765 117 50       246 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/^(?=\{)/ perl_block]<<},
9766             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9767             q{exp},
9768             $tracelevel)
9769             if defined $::RD_TRACE;
9770              
9771              
9772              
9773 117         169 $_matched = 1;
9774 117         249 last;
9775             }
9776              
9777              
9778 1453   66     5024 while (!$_matched && !$commit)
9779             {
9780            
9781 1336 50       2921 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: ['&' block]},
9782             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
9783             q{exp},
9784             $tracelevel)
9785             if defined $::RD_TRACE;
9786 1336         2269 my $thisprod = $thisrule->{"prods"}[1];
9787 1336         2259 $text = $_[1];
9788 1336         1808 my $_savetext;
9789 1336         2773 @item = (q{exp});
9790 1336         2818 %item = (__RULE__ => q{exp});
9791 1336         2049 my $repcount = 0;
9792              
9793              
9794 1336 50       2402 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: ['&']},
9795             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9796             q{exp},
9797             $tracelevel)
9798             if defined $::RD_TRACE;
9799 1336         2096 undef $lastsep;
9800 1336         2594 $expectation->is(q{})->at($text);
9801            
9802              
9803 1336 100 66     7191 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A\&/)
  1336 100       9625  
9804             {
9805 1334 50       3741 $text = $lastsep . $text if defined $lastsep;
9806            
9807 1334         3838 $expectation->failed();
9808 1334 50       2547 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
9809             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9810             if defined $::RD_TRACE;
9811 1334         2410 last;
9812             }
9813 2         15 $current_match = substr($text, $-[0], $+[0] - $-[0]);
9814 2         9 substr($text,0,length($current_match),q{});
9815 2 50       9 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
9816             . $current_match . q{])},
9817             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9818             if defined $::RD_TRACE;
9819 2         10 push @item, $item{__STRING1__}=$current_match;
9820            
9821              
9822 2 50       8 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
9823             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9824             q{exp},
9825             $tracelevel)
9826             if defined $::RD_TRACE;
9827 8     8   62 if (1) { no strict qw{refs};
  8         36  
  8         4625  
  2         19  
9828 2         9 $expectation->is(q{block})->at($text);
9829 2 50   2   17 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  2         6  
9830             {
9831            
9832 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9833             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9834             q{exp},
9835             $tracelevel)
9836             if defined $::RD_TRACE;
9837 0         0 $expectation->failed();
9838 0         0 last;
9839             }
9840 2 50       13 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
9841             . $_tok . q{]},
9842              
9843             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9844             q{exp},
9845             $tracelevel)
9846             if defined $::RD_TRACE;
9847 2         9 $item{q{block}} = $_tok;
9848 2         5 push @item, $_tok;
9849            
9850             }
9851              
9852 2 50       7 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
9853             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9854             q{exp},
9855             $tracelevel)
9856             if defined $::RD_TRACE;
9857            
9858              
9859 2 50       8 $_tok = ($_noactions) ? 0 : do { $item[2] };
  2         6  
9860 2 50       7 unless (defined $_tok)
9861             {
9862 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
9863             if defined $::RD_TRACE;
9864 0         0 last;
9865             }
9866 2 50       17 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
9867             . $_tok . q{])},
9868             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9869             if defined $::RD_TRACE;
9870 2         5 push @item, $_tok;
9871 2         4 $item{__ACTION1__}=$_tok;
9872            
9873              
9874 2 50       6 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: ['&' block]<<},
9875             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9876             q{exp},
9877             $tracelevel)
9878             if defined $::RD_TRACE;
9879              
9880              
9881              
9882 2         6 $_matched = 1;
9883 2         6 last;
9884             }
9885              
9886              
9887 1453   66     4828 while (!$_matched && !$commit)
9888             {
9889            
9890 1334 50       2603 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/^(?=<<)/ inline_doc]},
9891             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
9892             q{exp},
9893             $tracelevel)
9894             if defined $::RD_TRACE;
9895 1334         2461 my $thisprod = $thisrule->{"prods"}[2];
9896 1334         2390 $text = $_[1];
9897 1334         1635 my $_savetext;
9898 1334         2649 @item = (q{exp});
9899 1334         2722 %item = (__RULE__ => q{exp});
9900 1334         1904 my $repcount = 0;
9901              
9902              
9903 1334 50       2390 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/^(?=<<)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
9904             q{exp},
9905             $tracelevel)
9906             if defined $::RD_TRACE;
9907 1334         2011 undef $lastsep;
9908 1334         2375 $expectation->is(q{})->at($text);
9909            
9910              
9911 1334 100 66     6727 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:^(?=<<))/)
  1334 100       9482  
9912             {
9913 1333 50       3537 $text = $lastsep . $text if defined $lastsep;
9914 1333         3329 $expectation->failed();
9915 1333 50       2425 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9916             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9917             if defined $::RD_TRACE;
9918              
9919 1333         2268 last;
9920             }
9921 1         8 $current_match = substr($text, $-[0], $+[0] - $-[0]);
9922 1         5 substr($text,0,length($current_match),q{});
9923 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
9924             . $current_match . q{])},
9925             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9926             if defined $::RD_TRACE;
9927 1         3 push @item, $item{__PATTERN1__}=$current_match;
9928            
9929              
9930 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [inline_doc]},
9931             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9932             q{exp},
9933             $tracelevel)
9934             if defined $::RD_TRACE;
9935 8     8   64 if (1) { no strict qw{refs};
  8         16  
  8         3526  
  1         2  
9936 1         3 $expectation->is(q{inline_doc})->at($text);
9937 1 50   1   21 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::inline_doc($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1         3  
9938             {
9939            
9940 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
9941             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9942             q{exp},
9943             $tracelevel)
9944             if defined $::RD_TRACE;
9945 0         0 $expectation->failed();
9946 0         0 last;
9947             }
9948 1 50       5 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [inline_doc]<< (return value: [}
9949             . $_tok . q{]},
9950              
9951             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9952             q{exp},
9953             $tracelevel)
9954             if defined $::RD_TRACE;
9955 1         2 $item{q{inline_doc}} = $_tok;
9956 1         3 push @item, $_tok;
9957            
9958             }
9959              
9960 1 50       2 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
9961             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9962             q{exp},
9963             $tracelevel)
9964             if defined $::RD_TRACE;
9965            
9966              
9967 1 50       30 $_tok = ($_noactions) ? 0 : do { $item[2] };
  1         3  
9968 1 50       3 unless (defined $_tok)
9969             {
9970 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
9971             if defined $::RD_TRACE;
9972 0         0 last;
9973             }
9974 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
9975             . $_tok . q{])},
9976             XML::XSH2::Parser::_Runtime::_tracefirst($text))
9977             if defined $::RD_TRACE;
9978 1         2 push @item, $_tok;
9979 1         2 $item{__ACTION1__}=$_tok;
9980            
9981              
9982 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/^(?=<<)/ inline_doc]<<},
9983             XML::XSH2::Parser::_Runtime::_tracefirst($text),
9984             q{exp},
9985             $tracelevel)
9986             if defined $::RD_TRACE;
9987              
9988              
9989              
9990 1         1 $_matched = 1;
9991 1         2 last;
9992             }
9993              
9994              
9995 1453   66     5012 while (!$_matched && !$commit)
9996             {
9997            
9998 1333 50       2463 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xpath]},
9999             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10000             q{exp},
10001             $tracelevel)
10002             if defined $::RD_TRACE;
10003 1333         2315 my $thisprod = $thisrule->{"prods"}[3];
10004 1333         2258 $text = $_[1];
10005 1333         1711 my $_savetext;
10006 1333         2602 @item = (q{exp});
10007 1333         2624 %item = (__RULE__ => q{exp});
10008 1333         1922 my $repcount = 0;
10009              
10010              
10011 1333 50       2471 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpath]},
10012             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10013             q{exp},
10014             $tracelevel)
10015             if defined $::RD_TRACE;
10016 8     8   60 if (1) { no strict qw{refs};
  8         16  
  8         4497  
  1333         1792  
10017 1333         2317 $expectation->is(q{})->at($text);
10018 1333 100   1333   6417 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpath($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1333         2429  
10019             {
10020            
10021 21 50       51 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10022             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10023             q{exp},
10024             $tracelevel)
10025             if defined $::RD_TRACE;
10026 21         64 $expectation->failed();
10027 21         36 last;
10028             }
10029 1312 50       4369 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpath]<< (return value: [}
10030             . $_tok . q{]},
10031              
10032             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10033             q{exp},
10034             $tracelevel)
10035             if defined $::RD_TRACE;
10036 1312         2810 $item{q{xpath}} = $_tok;
10037 1312         2421 push @item, $_tok;
10038            
10039             }
10040              
10041 1312 50       2494 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xpath]<<},
10042             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10043             q{exp},
10044             $tracelevel)
10045             if defined $::RD_TRACE;
10046              
10047              
10048              
10049 1312         1838 $_matched = 1;
10050 1312         2076 last;
10051             }
10052              
10053              
10054 1453 100 66     3504 unless ( $_matched || defined($score) )
10055             {
10056            
10057              
10058 21         67 $_[1] = $text; # NOT SURE THIS IS NEEDED
10059 21 50       74 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10060             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10061             q{exp},
10062             $tracelevel)
10063             if defined $::RD_TRACE;
10064 21         146 return undef;
10065             }
10066 1432 50 33     4964 if (!defined($return) && defined($score))
10067             {
10068 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
10069             q{exp},
10070             $tracelevel)
10071             if defined $::RD_TRACE;
10072 0         0 $return = $score_return;
10073             }
10074 1432         1936 splice @{$thisparser->{errors}}, $err_at;
  1432         2690  
10075 1432 50       3391 $return = $item[$#item] unless defined $return;
10076 1432 50       2890 if (defined $::RD_TRACE)
10077             {
10078 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
10079             $return . q{])}, "",
10080             q{exp},
10081             $tracelevel);
10082 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
10083             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
10084             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10085             , q{exp},
10086             $tracelevel)
10087             }
10088 1432         2901 $_[1] = $text;
10089 1432         9231 return $return;
10090             }
10091              
10092             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
10093             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp_or_opt
10094             {
10095 1664     1664   2778 my $thisparser = $_[0];
10096 8     8   81 use vars q{$tracelevel};
  8         33  
  8         6933  
10097 1664   50     3958 local $tracelevel = ($tracelevel||0)+1;
10098 1664         2267 $ERRORS = 0;
10099 1664         3490 my $thisrule = $thisparser->{"rules"}{"exp_or_opt"};
10100              
10101 1664 50       3173 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [exp_or_opt]},
10102             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10103             q{exp_or_opt},
10104             $tracelevel)
10105             if defined $::RD_TRACE;
10106              
10107            
10108 1664         2179 my $err_at = @{$thisparser->{errors}};
  1664         2731  
10109              
10110 1664         3674 my $score;
10111             my $score_return;
10112 1664         0 my $_tok;
10113 1664         2276 my $return = undef;
10114 1664         2311 my $_matched=0;
10115 1664         2091 my $commit=0;
10116 1664         2833 my @item = ();
10117 1664         2466 my %item = ();
10118 1664         2477 my $repeating = $_[2];
10119 1664         3457 my $_noactions = $_[3];
10120 1664 50       3479 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  1664         2043  
  1664         2705  
10121 1664         2411 my $_itempos = $_[5];
10122 1664 50       3564 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
10123 1664         3641 my $text;
10124             my $lastsep;
10125 1664         0 my $current_match;
10126 1664         3723 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(?=\\s*[\};]|\\s*\\Z)/, or option, or exp});
10127 1664         4905 $expectation->at($_[1]);
10128            
10129 1664         2012 my $thisoffset;
10130 1664         6302 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
10131            
10132 1664         2571 my $thiscolumn;
10133 1664         4143 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
10134            
10135 1664         2444 my $thisline;
10136 1664         4161 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
10137              
10138            
10139              
10140 1664   33     6376 while (!$_matched && !$commit)
10141             {
10142            
10143 1664 50       3971 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?=\\s*[\};]|\\s*\\Z)/ ]},
10144             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10145             q{exp_or_opt},
10146             $tracelevel)
10147             if defined $::RD_TRACE;
10148 1664         3604 my $thisprod = $thisrule->{"prods"}[0];
10149 1664         2927 $text = $_[1];
10150 1664         2145 my $_savetext;
10151 1664         3179 @item = (q{exp_or_opt});
10152 1664         3274 %item = (__RULE__ => q{exp_or_opt});
10153 1664         2177 my $repcount = 0;
10154              
10155              
10156 1664 50       3111 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?=\\s*[\};]|\\s*\\Z)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
10157             q{exp_or_opt},
10158             $tracelevel)
10159             if defined $::RD_TRACE;
10160 1664         2712 undef $lastsep;
10161 1664         3291 $expectation->is(q{})->at($text);
10162            
10163              
10164 1664 100 66     12694 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?=\s*[};]|\s*\Z))/)
  1664 100       15498  
10165             {
10166 1016 50       3128 $text = $lastsep . $text if defined $lastsep;
10167 1016         2803 $expectation->failed();
10168 1016 50       2125 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10169             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10170             if defined $::RD_TRACE;
10171              
10172 1016         2092 last;
10173             }
10174 648         3415 $current_match = substr($text, $-[0], $+[0] - $-[0]);
10175 648         2345 substr($text,0,length($current_match),q{});
10176 648 50       1371 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
10177             . $current_match . q{])},
10178             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10179             if defined $::RD_TRACE;
10180 648         1716 push @item, $item{__PATTERN1__}=$current_match;
10181            
10182              
10183            
10184              
10185 648 50       1411 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
10186             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10187             q{exp_or_opt},
10188             $tracelevel)
10189             if defined $::RD_TRACE;
10190 648         946 $_tok = do { $commit = 1 };
  648         1223  
10191 648 50       1400 if (defined($_tok))
10192             {
10193 648 50       1407 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
10194             . $_tok . q{])},
10195             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10196             if defined $::RD_TRACE;
10197             }
10198             else
10199             {
10200 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10201             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10202             if defined $::RD_TRACE;
10203             }
10204            
10205 648 50       1357 last unless defined $_tok;
10206 648         1347 push @item, $item{__DIRECTIVE1__}=$_tok;
10207            
10208              
10209 648 50       1596 XML::XSH2::Parser::_Runtime::_trace(q{>>Rejecting production<< (found )},
10210             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10211             q{exp_or_opt},
10212             $tracelevel)
10213             if defined $::RD_TRACE;
10214 648         1005 undef $return;
10215            
10216              
10217 648         915 $_tok = undef;
10218            
10219 648 50       1639 last unless defined $_tok;
10220              
10221 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?=\\s*[\};]|\\s*\\Z)/ ]<<},
10222             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10223             q{exp_or_opt},
10224             $tracelevel)
10225             if defined $::RD_TRACE;
10226              
10227              
10228              
10229 0         0 $_matched = 1;
10230 0         0 last;
10231             }
10232              
10233              
10234 1664   66     6184 while (!$_matched && !$commit)
10235             {
10236            
10237 1016 50       1981 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [option]},
10238             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10239             q{exp_or_opt},
10240             $tracelevel)
10241             if defined $::RD_TRACE;
10242 1016         1865 my $thisprod = $thisrule->{"prods"}[1];
10243 1016         1789 $text = $_[1];
10244 1016         1337 my $_savetext;
10245 1016         2179 @item = (q{exp_or_opt});
10246 1016         2307 %item = (__RULE__ => q{exp_or_opt});
10247 1016         1440 my $repcount = 0;
10248              
10249              
10250 1016 50       1913 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [option]},
10251             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10252             q{exp_or_opt},
10253             $tracelevel)
10254             if defined $::RD_TRACE;
10255 8     8   111 if (1) { no strict qw{refs};
  8         21  
  8         2235  
  1016         1375  
10256 1016         1899 $expectation->is(q{})->at($text);
10257 1016 100   1016   5209 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::option($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1016         1823  
10258             {
10259            
10260 981 50       2031 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10261             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10262             q{exp_or_opt},
10263             $tracelevel)
10264             if defined $::RD_TRACE;
10265 981         2314 $expectation->failed();
10266 981         1682 last;
10267             }
10268 35 50       134 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [option]<< (return value: [}
10269             . $_tok . q{]},
10270              
10271             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10272             q{exp_or_opt},
10273             $tracelevel)
10274             if defined $::RD_TRACE;
10275 35         88 $item{q{option}} = $_tok;
10276 35         65 push @item, $_tok;
10277            
10278             }
10279              
10280 35 50       85 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [option]<<},
10281             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10282             q{exp_or_opt},
10283             $tracelevel)
10284             if defined $::RD_TRACE;
10285              
10286              
10287              
10288 35         50 $_matched = 1;
10289 35         59 last;
10290             }
10291              
10292              
10293 1664   100     7028 while (!$_matched && !$commit)
10294             {
10295            
10296 981 50       1971 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [exp]},
10297             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10298             q{exp_or_opt},
10299             $tracelevel)
10300             if defined $::RD_TRACE;
10301 981         2048 my $thisprod = $thisrule->{"prods"}[2];
10302 981         1835 $text = $_[1];
10303 981         1505 my $_savetext;
10304 981         2068 @item = (q{exp_or_opt});
10305 981         2102 %item = (__RULE__ => q{exp_or_opt});
10306 981         1504 my $repcount = 0;
10307              
10308              
10309 981 50       1876 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
10310             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10311             q{exp_or_opt},
10312             $tracelevel)
10313             if defined $::RD_TRACE;
10314 8     8   62 if (1) { no strict qw{refs};
  8         16  
  8         4605  
  981         1215  
10315 981         2077 $expectation->is(q{})->at($text);
10316 981 100   981   4404 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  981         1761  
10317             {
10318            
10319 21 50       52 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10320             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10321             q{exp_or_opt},
10322             $tracelevel)
10323             if defined $::RD_TRACE;
10324 21         62 $expectation->failed();
10325 21         31 last;
10326             }
10327 960 50       3136 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
10328             . $_tok . q{]},
10329              
10330             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10331             q{exp_or_opt},
10332             $tracelevel)
10333             if defined $::RD_TRACE;
10334 960         2110 $item{q{exp}} = $_tok;
10335 960         1683 push @item, $_tok;
10336            
10337             }
10338              
10339 960 50       1953 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [exp]<<},
10340             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10341             q{exp_or_opt},
10342             $tracelevel)
10343             if defined $::RD_TRACE;
10344              
10345              
10346              
10347 960         1293 $_matched = 1;
10348 960         1577 last;
10349             }
10350              
10351              
10352 1664 100 66     4444 unless ( $_matched || defined($score) )
10353             {
10354            
10355              
10356 669         1177 $_[1] = $text; # NOT SURE THIS IS NEEDED
10357 669 50       1284 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10358             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10359             q{exp_or_opt},
10360             $tracelevel)
10361             if defined $::RD_TRACE;
10362 669         4221 return undef;
10363             }
10364 995 50 33     3369 if (!defined($return) && defined($score))
10365             {
10366 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
10367             q{exp_or_opt},
10368             $tracelevel)
10369             if defined $::RD_TRACE;
10370 0         0 $return = $score_return;
10371             }
10372 995         1333 splice @{$thisparser->{errors}}, $err_at;
  995         1778  
10373 995 50       2183 $return = $item[$#item] unless defined $return;
10374 995 50       1952 if (defined $::RD_TRACE)
10375             {
10376 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
10377             $return . q{])}, "",
10378             q{exp_or_opt},
10379             $tracelevel);
10380 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
10381             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
10382             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10383             , q{exp_or_opt},
10384             $tracelevel)
10385             }
10386 995         2007 $_[1] = $text;
10387 995         5524 return $return;
10388             }
10389              
10390             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
10391             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::filename
10392             {
10393 1     1   4 my $thisparser = $_[0];
10394 8     8   64 use vars q{$tracelevel};
  8         17  
  8         3214  
10395 1   50     5 local $tracelevel = ($tracelevel||0)+1;
10396 1         3 $ERRORS = 0;
10397 1         4 my $thisrule = $thisparser->{"rules"}{"filename"};
10398              
10399 1 50       5 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [filename]},
10400             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10401             q{filename},
10402             $tracelevel)
10403             if defined $::RD_TRACE;
10404              
10405            
10406 1         2 my $err_at = @{$thisparser->{errors}};
  1         5  
10407              
10408 1         4 my $score;
10409             my $score_return;
10410 1         0 my $_tok;
10411 1         3 my $return = undef;
10412 1         3 my $_matched=0;
10413 1         2 my $commit=0;
10414 1         4 my @item = ();
10415 1         3 my %item = ();
10416 1         2 my $repeating = $_[2];
10417 1         3 my $_noactions = $_[3];
10418 1 50       4 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  1         2  
  1         4  
10419 1         3 my $_itempos = $_[5];
10420 1 50       5 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
10421 1         12 my $text;
10422             my $lastsep;
10423 1         0 my $current_match;
10424 1         6 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{exp});
10425 1         4 $expectation->at($_[1]);
10426            
10427 1         3 my $thisoffset;
10428 1         6 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
10429            
10430 1         4 my $thiscolumn;
10431 1         4 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
10432            
10433 1         2 my $thisline;
10434 1         6 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
10435              
10436            
10437              
10438 1   33     10 while (!$_matched && !$commit)
10439             {
10440            
10441 1 50       5 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [exp]},
10442             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10443             q{filename},
10444             $tracelevel)
10445             if defined $::RD_TRACE;
10446 1         4 my $thisprod = $thisrule->{"prods"}[0];
10447 1         3 $text = $_[1];
10448 1         4 my $_savetext;
10449 1         3 @item = (q{filename});
10450 1         4 %item = (__RULE__ => q{filename});
10451 1         1 my $repcount = 0;
10452              
10453              
10454 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
10455             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10456             q{filename},
10457             $tracelevel)
10458             if defined $::RD_TRACE;
10459 8     8   66 if (1) { no strict qw{refs};
  8         19  
  8         3524  
  1         3  
10460 1         4 $expectation->is(q{})->at($text);
10461 1 50   1   10 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1         3  
10462             {
10463            
10464 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10465             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10466             q{filename},
10467             $tracelevel)
10468             if defined $::RD_TRACE;
10469 0         0 $expectation->failed();
10470 0         0 last;
10471             }
10472 1 50       6 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
10473             . $_tok . q{]},
10474              
10475             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10476             q{filename},
10477             $tracelevel)
10478             if defined $::RD_TRACE;
10479 1         3 $item{q{exp}} = $_tok;
10480 1         3 push @item, $_tok;
10481            
10482             }
10483              
10484 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [exp]<<},
10485             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10486             q{filename},
10487             $tracelevel)
10488             if defined $::RD_TRACE;
10489              
10490              
10491              
10492 1         3 $_matched = 1;
10493 1         2 last;
10494             }
10495              
10496              
10497 1 50 33     4 unless ( $_matched || defined($score) )
10498             {
10499            
10500              
10501 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
10502 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10503             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10504             q{filename},
10505             $tracelevel)
10506             if defined $::RD_TRACE;
10507 0         0 return undef;
10508             }
10509 1 50 33     16 if (!defined($return) && defined($score))
10510             {
10511 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
10512             q{filename},
10513             $tracelevel)
10514             if defined $::RD_TRACE;
10515 0         0 $return = $score_return;
10516             }
10517 1         4 splice @{$thisparser->{errors}}, $err_at;
  1         4  
10518 1 50       5 $return = $item[$#item] unless defined $return;
10519 1 50       4 if (defined $::RD_TRACE)
10520             {
10521 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
10522             $return . q{])}, "",
10523             q{filename},
10524             $tracelevel);
10525 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
10526             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
10527             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10528             , q{filename},
10529             $tracelevel)
10530             }
10531 1         4 $_[1] = $text;
10532 1         9 return $return;
10533             }
10534              
10535             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
10536             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::inline_doc
10537             {
10538 1     1   2 my $thisparser = $_[0];
10539 8     8   78 use vars q{$tracelevel};
  8         18  
  8         5007  
10540 1   50     4 local $tracelevel = ($tracelevel||0)+1;
10541 1         2 $ERRORS = 0;
10542 1         2 my $thisrule = $thisparser->{"rules"}{"inline_doc"};
10543              
10544 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [inline_doc]},
10545             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10546             q{inline_doc},
10547             $tracelevel)
10548             if defined $::RD_TRACE;
10549              
10550            
10551 1         1 my $err_at = @{$thisparser->{errors}};
  1         3  
10552              
10553 1         3 my $score;
10554             my $score_return;
10555 1         0 my $_tok;
10556 1         1 my $return = undef;
10557 1         2 my $_matched=0;
10558 1         2 my $commit=0;
10559 1         1 my @item = ();
10560 1         2 my %item = ();
10561 1         1 my $repeating = $_[2];
10562 1         2 my $_noactions = $_[3];
10563 1 50       3 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  1         9  
  1         3  
10564 1         2 my $_itempos = $_[5];
10565 1 50       5 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
10566 1         3 my $text;
10567             my $lastsep;
10568 1         0 my $current_match;
10569 1         3 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/<
10570 1         4 $expectation->at($_[1]);
10571            
10572 1         2 my $thisoffset;
10573 1         3 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
10574            
10575 1         2 my $thiscolumn;
10576 1         2 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
10577            
10578 1         1 my $thisline;
10579 1         3 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
10580              
10581            
10582              
10583 1   33     5 while (!$_matched && !$commit)
10584             {
10585 1 50       3 local $skip = defined($skip) ? $skip : $XML::XSH2::Parser::_Runtime::skip;
10586 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/< /.*\\n/ /(.|\\n)*?\\n$item[2][1]\\s*(\\n|$)/]},
10587             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10588             q{inline_doc},
10589             $tracelevel)
10590             if defined $::RD_TRACE;
10591 1         3 my $thisprod = $thisrule->{"prods"}[0];
10592 1         1 $text = $_[1];
10593 1         2 my $_savetext;
10594 1         2 @item = (q{inline_doc});
10595 1         2 %item = (__RULE__ => q{inline_doc});
10596 1         2 my $repcount = 0;
10597              
10598              
10599 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/<
10600             q{inline_doc},
10601             $tracelevel)
10602             if defined $::RD_TRACE;
10603 1         2 undef $lastsep;
10604 1         3 $expectation->is(q{})->at($text);
10605            
10606              
10607 1 50 33     38 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:<<)/)
  1 50       36  
10608             {
10609 0 0       0 $text = $lastsep . $text if defined $lastsep;
10610 0         0 $expectation->failed();
10611 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10612             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10613             if defined $::RD_TRACE;
10614              
10615 0         0 last;
10616             }
10617 1         8 $current_match = substr($text, $-[0], $+[0] - $-[0]);
10618 1         3 substr($text,0,length($current_match),q{});
10619 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
10620             . $current_match . q{])},
10621             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10622             if defined $::RD_TRACE;
10623 1         4 push @item, $item{__PATTERN1__}=$current_match;
10624            
10625              
10626 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [inline_doc_string]},
10627             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10628             q{inline_doc},
10629             $tracelevel)
10630             if defined $::RD_TRACE;
10631 8     8   67 if (1) { no strict qw{refs};
  8         20  
  8         10072  
  1         3  
10632 1         3 $expectation->is(q{inline_doc_string})->at($text);
10633 1 50   1   7 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::inline_doc_string($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1         2  
10634             {
10635            
10636 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10637             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10638             q{inline_doc},
10639             $tracelevel)
10640             if defined $::RD_TRACE;
10641 0         0 $expectation->failed();
10642 0         0 last;
10643             }
10644 1 50       5 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [inline_doc_string]<< (return value: [}
10645             . $_tok . q{]},
10646              
10647             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10648             q{inline_doc},
10649             $tracelevel)
10650             if defined $::RD_TRACE;
10651 1         3 $item{q{inline_doc_string}} = $_tok;
10652 1         2 push @item, $_tok;
10653            
10654             }
10655              
10656            
10657              
10658 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
10659             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10660             q{inline_doc},
10661             $tracelevel)
10662             if defined $::RD_TRACE;
10663 1         2 $_tok = do { my $oldskip = $skip; $skip=""; $oldskip };
  1         2  
  1         2  
  1         2  
10664 1 50       3 if (defined($_tok))
10665             {
10666 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
10667             . $_tok . q{])},
10668             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10669             if defined $::RD_TRACE;
10670             }
10671             else
10672             {
10673 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10674             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10675             if defined $::RD_TRACE;
10676             }
10677            
10678 1 50       3 last unless defined $_tok;
10679 1         9 push @item, $item{__DIRECTIVE1__}=$_tok;
10680            
10681              
10682 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/.*\\n/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
10683             q{inline_doc},
10684             $tracelevel)
10685             if defined $::RD_TRACE;
10686 1         2 undef $lastsep;
10687 1         3 $expectation->is(q{/.*\\n/})->at($text);
10688            
10689              
10690 1 50 33     19 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:.*\n)/)
  1 50       14  
10691             {
10692 0 0       0 $text = $lastsep . $text if defined $lastsep;
10693 0         0 $expectation->failed();
10694 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10695             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10696             if defined $::RD_TRACE;
10697              
10698 0         0 last;
10699             }
10700 1         7 $current_match = substr($text, $-[0], $+[0] - $-[0]);
10701 1         10 substr($text,0,length($current_match),q{});
10702 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
10703             . $current_match . q{])},
10704             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10705             if defined $::RD_TRACE;
10706 1         4 push @item, $item{__PATTERN2__}=$current_match;
10707            
10708              
10709 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(.|\\n)*?\\n$item[2][1]\\s*(\\n|$)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
10710             q{inline_doc},
10711             $tracelevel)
10712             if defined $::RD_TRACE;
10713 1         1 undef $lastsep;
10714 1         3 $expectation->is(q{/(.|\\n)*?\\n$item[2][1]\\s*(\\n|$)/})->at($text);
10715            
10716              
10717 1 50 33     10 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(.|\n)*?\n$item[2][1]\s*(\n|$))/)
  1 50       40  
10718             {
10719 0 0       0 $text = $lastsep . $text if defined $lastsep;
10720 0         0 $expectation->failed();
10721 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10722             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10723             if defined $::RD_TRACE;
10724              
10725 0         0 last;
10726             }
10727 1         9 $current_match = substr($text, $-[0], $+[0] - $-[0]);
10728 1         4 substr($text,0,length($current_match),q{});
10729 1 50       10 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
10730             . $current_match . q{])},
10731             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10732             if defined $::RD_TRACE;
10733 1         4 push @item, $item{__PATTERN3__}=$current_match;
10734            
10735              
10736 1 50       2 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
10737             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10738             q{inline_doc},
10739             $tracelevel)
10740             if defined $::RD_TRACE;
10741            
10742              
10743 1 50       3 $_tok = ($_noactions) ? 0 : do {
10744 1         3 $text=$item[4].$text;
10745 1         2 local $_=$item[5]; s/\n$item[2][1]\s*$//;
  1         21  
10746 1         4 my $paren = $item[2][0];
10747 1 50       4 $paren = '"' if $paren eq "";
10748 1 50       3 if ($paren eq "'") {
10749 1         2 $paren = '"';
10750 1 0 0     35 s{(\\)(.|\n)|(\$)}{ (defined($3) and $3 eq '$') ? "\\\$"
  0 0 0     0  
    0 0        
    0 0        
10751             : ((defined($2) and $2 eq "\\")
10752             ? "\\\\" : ((defined($2) and $2 eq "'") ? "'" : (
10753             (defined($2) and $2 eq '$') ? "\\\\\\$2" :
10754             "\\\\$2"))) }eg;
10755 1         4 } "<<".$paren.$_;
10756             };
10757 1 50       4 unless (defined $_tok)
10758             {
10759 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
10760             if defined $::RD_TRACE;
10761 0         0 last;
10762             }
10763 1 50       2 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
10764             . $_tok . q{])},
10765             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10766             if defined $::RD_TRACE;
10767 1         2 push @item, $_tok;
10768 1         3 $item{__ACTION1__}=$_tok;
10769            
10770              
10771 1 50       2 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/< /.*\\n/ /(.|\\n)*?\\n$item[2][1]\\s*(\\n|$)/]<<},
10772             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10773             q{inline_doc},
10774             $tracelevel)
10775             if defined $::RD_TRACE;
10776              
10777              
10778              
10779 1         2 $_matched = 1;
10780 1         2 last;
10781             }
10782              
10783              
10784 1 50 33     11 unless ( $_matched || defined($score) )
10785             {
10786            
10787              
10788 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
10789 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10790             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10791             q{inline_doc},
10792             $tracelevel)
10793             if defined $::RD_TRACE;
10794 0         0 return undef;
10795             }
10796 1 50 33     6 if (!defined($return) && defined($score))
10797             {
10798 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
10799             q{inline_doc},
10800             $tracelevel)
10801             if defined $::RD_TRACE;
10802 0         0 $return = $score_return;
10803             }
10804 1         2 splice @{$thisparser->{errors}}, $err_at;
  1         3  
10805 1 50       3 $return = $item[$#item] unless defined $return;
10806 1 50       4 if (defined $::RD_TRACE)
10807             {
10808 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
10809             $return . q{])}, "",
10810             q{inline_doc},
10811             $tracelevel);
10812 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
10813             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
10814             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10815             , q{inline_doc},
10816             $tracelevel)
10817             }
10818 1         17 $_[1] = $text;
10819 1         9 return $return;
10820             }
10821              
10822             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
10823             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::inline_doc_string
10824             {
10825 1     1   2 my $thisparser = $_[0];
10826 8     8   72 use vars q{$tracelevel};
  8         17  
  8         8629  
10827 1   50     9 local $tracelevel = ($tracelevel||0)+1;
10828 1         3 $ERRORS = 0;
10829 1         2 my $thisrule = $thisparser->{"rules"}{"inline_doc_string"};
10830              
10831 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [inline_doc_string]},
10832             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10833             q{inline_doc_string},
10834             $tracelevel)
10835             if defined $::RD_TRACE;
10836              
10837            
10838 1         1 my $err_at = @{$thisparser->{errors}};
  1         2  
10839              
10840 1         4 my $score;
10841             my $score_return;
10842 1         0 my $_tok;
10843 1         1 my $return = undef;
10844 1         1 my $_matched=0;
10845 1         9 my $commit=0;
10846 1         2 my @item = ();
10847 1         2 my %item = ();
10848 1         1 my $repeating = $_[2];
10849 1         2 my $_noactions = $_[3];
10850 1 50       3 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  1         2  
  1         3  
10851 1         2 my $_itempos = $_[5];
10852 1 50       4 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
10853 1         3 my $text;
10854             my $lastsep;
10855 1         0 my $current_match;
10856 1         3 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/'[a-zA-Z_][a-zA-Z0-9_]*'|"[a-zA-Z_][a-zA-Z0-9_]*"|\\([a-zA-Z_][a-zA-Z0-9_]*\\)|\\\{[a-zA-Z_][a-zA-Z0-9_]*\\\}|[a-zA-Z_][a-zA-Z0-9_]*/});
10857 1         3 $expectation->at($_[1]);
10858            
10859 1         2 my $thisoffset;
10860 1         4 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
10861            
10862 1         2 my $thiscolumn;
10863 1         11 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
10864            
10865 1         2 my $thisline;
10866 1         3 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
10867              
10868            
10869              
10870 1   33     5 while (!$_matched && !$commit)
10871             {
10872            
10873 1 50       10 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/'[a-zA-Z_][a-zA-Z0-9_]*'|"[a-zA-Z_][a-zA-Z0-9_]*"|\\([a-zA-Z_][a-zA-Z0-9_]*\\)|\\\{[a-zA-Z_][a-zA-Z0-9_]*\\\}|[a-zA-Z_][a-zA-Z0-9_]*/]},
10874             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10875             q{inline_doc_string},
10876             $tracelevel)
10877             if defined $::RD_TRACE;
10878 1         4 my $thisprod = $thisrule->{"prods"}[0];
10879 1         2 $text = $_[1];
10880 1         2 my $_savetext;
10881 1         3 @item = (q{inline_doc_string});
10882 1         2 %item = (__RULE__ => q{inline_doc_string});
10883 1         2 my $repcount = 0;
10884              
10885              
10886 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/'[a-zA-Z_][a-zA-Z0-9_]*'|"[a-zA-Z_][a-zA-Z0-9_]*"|\\([a-zA-Z_][a-zA-Z0-9_]*\\)|\\\{[a-zA-Z_][a-zA-Z0-9_]*\\\}|[a-zA-Z_][a-zA-Z0-9_]*/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
10887             q{inline_doc_string},
10888             $tracelevel)
10889             if defined $::RD_TRACE;
10890 1         2 undef $lastsep;
10891 1         18 $expectation->is(q{})->at($text);
10892            
10893              
10894 1 50 33     28 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:'[a-zA-Z_][a-zA-Z0-9_]*'|"[a-zA-Z_][a-zA-Z0-9_]*"|\([a-zA-Z_][a-zA-Z0-9_]*\)|\{[a-zA-Z_][a-zA-Z0-9_]*\}|[a-zA-Z_][a-zA-Z0-9_]*)/)
  1 50       33  
10895             {
10896 0 0       0 $text = $lastsep . $text if defined $lastsep;
10897 0         0 $expectation->failed();
10898 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10899             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10900             if defined $::RD_TRACE;
10901              
10902 0         0 last;
10903             }
10904 1         8 $current_match = substr($text, $-[0], $+[0] - $-[0]);
10905 1         3 substr($text,0,length($current_match),q{});
10906 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
10907             . $current_match . q{])},
10908             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10909             if defined $::RD_TRACE;
10910 1         3 push @item, $item{__PATTERN1__}=$current_match;
10911            
10912              
10913 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
10914             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10915             q{inline_doc_string},
10916             $tracelevel)
10917             if defined $::RD_TRACE;
10918            
10919              
10920 1 50       3 $_tok = ($_noactions) ? 0 : do { [($item[1]=~/^(['"({])?(.*?)(['")}])?$/)] };
  1         7  
10921 1 50       3 unless (defined $_tok)
10922             {
10923 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
10924             if defined $::RD_TRACE;
10925 0         0 last;
10926             }
10927 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
10928             . $_tok . q{])},
10929             XML::XSH2::Parser::_Runtime::_tracefirst($text))
10930             if defined $::RD_TRACE;
10931 1         2 push @item, $_tok;
10932 1         2 $item{__ACTION1__}=$_tok;
10933            
10934              
10935 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/'[a-zA-Z_][a-zA-Z0-9_]*'|"[a-zA-Z_][a-zA-Z0-9_]*"|\\([a-zA-Z_][a-zA-Z0-9_]*\\)|\\\{[a-zA-Z_][a-zA-Z0-9_]*\\\}|[a-zA-Z_][a-zA-Z0-9_]*/]<<},
10936             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10937             q{inline_doc_string},
10938             $tracelevel)
10939             if defined $::RD_TRACE;
10940              
10941              
10942              
10943 1         1 $_matched = 1;
10944 1         3 last;
10945             }
10946              
10947              
10948 1 50 33     3 unless ( $_matched || defined($score) )
10949             {
10950            
10951              
10952 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
10953 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
10954             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10955             q{inline_doc_string},
10956             $tracelevel)
10957             if defined $::RD_TRACE;
10958 0         0 return undef;
10959             }
10960 1 50 33     18 if (!defined($return) && defined($score))
10961             {
10962 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
10963             q{inline_doc_string},
10964             $tracelevel)
10965             if defined $::RD_TRACE;
10966 0         0 $return = $score_return;
10967             }
10968 1         1 splice @{$thisparser->{errors}}, $err_at;
  1         3  
10969 1 50       3 $return = $item[$#item] unless defined $return;
10970 1 50       15 if (defined $::RD_TRACE)
10971             {
10972 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
10973             $return . q{])}, "",
10974             q{inline_doc_string},
10975             $tracelevel);
10976 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
10977             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
10978             XML::XSH2::Parser::_Runtime::_tracefirst($text),
10979             , q{inline_doc_string},
10980             $tracelevel)
10981             }
10982 1         4 $_[1] = $text;
10983 1         8 return $return;
10984             }
10985              
10986             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
10987             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::loc
10988             {
10989 0     0   0 my $thisparser = $_[0];
10990 8     8   81 use vars q{$tracelevel};
  8         18  
  8         24463  
10991 0   0     0 local $tracelevel = ($tracelevel||0)+1;
10992 0         0 $ERRORS = 0;
10993 0         0 my $thisrule = $thisparser->{"rules"}{"loc"};
10994              
10995 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [loc]},
10996             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
10997             q{loc},
10998             $tracelevel)
10999             if defined $::RD_TRACE;
11000              
11001            
11002 0         0 my $err_at = @{$thisparser->{errors}};
  0         0  
11003              
11004 0         0 my $score;
11005             my $score_return;
11006 0         0 my $_tok;
11007 0         0 my $return = undef;
11008 0         0 my $_matched=0;
11009 0         0 my $commit=0;
11010 0         0 my @item = ();
11011 0         0 my %item = ();
11012 0         0 my $repeating = $_[2];
11013 0         0 my $_noactions = $_[3];
11014 0 0       0 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  0         0  
  0         0  
11015 0         0 my $_itempos = $_[5];
11016 0 0       0 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
11017 0         0 my $text;
11018             my $lastsep;
11019 0         0 my $current_match;
11020 0         0 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/after\\s/, or /before\\s/, or /(in)?to\\s/, or /(append(ing)?|as\\s+(a\\s+)child(\\s+of)?)\\s/, or /(prepend(ing)?|(as\\s+)(the\\s+)first(\\s+child(\\s+of)?)?)\\s/, or /(replace|instead( of)?)\\s/});
11021 0         0 $expectation->at($_[1]);
11022            
11023 0         0 my $thisoffset;
11024 0         0 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
11025            
11026 0         0 my $thiscolumn;
11027 0         0 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
11028            
11029 0         0 my $thisline;
11030 0         0 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
11031              
11032            
11033              
11034 0   0     0 while (!$_matched && !$commit)
11035             {
11036            
11037 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/after\\s/]},
11038             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11039             q{loc},
11040             $tracelevel)
11041             if defined $::RD_TRACE;
11042 0         0 my $thisprod = $thisrule->{"prods"}[0];
11043 0         0 $text = $_[1];
11044 0         0 my $_savetext;
11045 0         0 @item = (q{loc});
11046 0         0 %item = (__RULE__ => q{loc});
11047 0         0 my $repcount = 0;
11048              
11049              
11050 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/after\\s/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
11051             q{loc},
11052             $tracelevel)
11053             if defined $::RD_TRACE;
11054 0         0 undef $lastsep;
11055 0         0 $expectation->is(q{})->at($text);
11056            
11057              
11058 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:after\s)/)
  0 0       0  
11059             {
11060 0 0       0 $text = $lastsep . $text if defined $lastsep;
11061 0         0 $expectation->failed();
11062 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
11063             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11064             if defined $::RD_TRACE;
11065              
11066 0         0 last;
11067             }
11068 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
11069 0         0 substr($text,0,length($current_match),q{});
11070 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
11071             . $current_match . q{])},
11072             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11073             if defined $::RD_TRACE;
11074 0         0 push @item, $item{__PATTERN1__}=$current_match;
11075            
11076              
11077 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
11078             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11079             q{loc},
11080             $tracelevel)
11081             if defined $::RD_TRACE;
11082            
11083              
11084 0 0       0 $_tok = ($_noactions) ? 0 : do { "after" };
  0         0  
11085 0 0       0 unless (defined $_tok)
11086             {
11087 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
11088             if defined $::RD_TRACE;
11089 0         0 last;
11090             }
11091 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
11092             . $_tok . q{])},
11093             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11094             if defined $::RD_TRACE;
11095 0         0 push @item, $_tok;
11096 0         0 $item{__ACTION1__}=$_tok;
11097            
11098              
11099 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/after\\s/]<<},
11100             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11101             q{loc},
11102             $tracelevel)
11103             if defined $::RD_TRACE;
11104              
11105              
11106              
11107 0         0 $_matched = 1;
11108 0         0 last;
11109             }
11110              
11111              
11112 0   0     0 while (!$_matched && !$commit)
11113             {
11114            
11115 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/before\\s/]},
11116             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11117             q{loc},
11118             $tracelevel)
11119             if defined $::RD_TRACE;
11120 0         0 my $thisprod = $thisrule->{"prods"}[1];
11121 0         0 $text = $_[1];
11122 0         0 my $_savetext;
11123 0         0 @item = (q{loc});
11124 0         0 %item = (__RULE__ => q{loc});
11125 0         0 my $repcount = 0;
11126              
11127              
11128 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/before\\s/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
11129             q{loc},
11130             $tracelevel)
11131             if defined $::RD_TRACE;
11132 0         0 undef $lastsep;
11133 0         0 $expectation->is(q{})->at($text);
11134            
11135              
11136 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:before\s)/)
  0 0       0  
11137             {
11138 0 0       0 $text = $lastsep . $text if defined $lastsep;
11139 0         0 $expectation->failed();
11140 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
11141             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11142             if defined $::RD_TRACE;
11143              
11144 0         0 last;
11145             }
11146 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
11147 0         0 substr($text,0,length($current_match),q{});
11148 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
11149             . $current_match . q{])},
11150             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11151             if defined $::RD_TRACE;
11152 0         0 push @item, $item{__PATTERN1__}=$current_match;
11153            
11154              
11155 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
11156             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11157             q{loc},
11158             $tracelevel)
11159             if defined $::RD_TRACE;
11160            
11161              
11162 0 0       0 $_tok = ($_noactions) ? 0 : do { "before" };
  0         0  
11163 0 0       0 unless (defined $_tok)
11164             {
11165 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
11166             if defined $::RD_TRACE;
11167 0         0 last;
11168             }
11169 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
11170             . $_tok . q{])},
11171             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11172             if defined $::RD_TRACE;
11173 0         0 push @item, $_tok;
11174 0         0 $item{__ACTION1__}=$_tok;
11175            
11176              
11177 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/before\\s/]<<},
11178             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11179             q{loc},
11180             $tracelevel)
11181             if defined $::RD_TRACE;
11182              
11183              
11184              
11185 0         0 $_matched = 1;
11186 0         0 last;
11187             }
11188              
11189              
11190 0   0     0 while (!$_matched && !$commit)
11191             {
11192            
11193 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(in)?to\\s/]},
11194             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11195             q{loc},
11196             $tracelevel)
11197             if defined $::RD_TRACE;
11198 0         0 my $thisprod = $thisrule->{"prods"}[2];
11199 0         0 $text = $_[1];
11200 0         0 my $_savetext;
11201 0         0 @item = (q{loc});
11202 0         0 %item = (__RULE__ => q{loc});
11203 0         0 my $repcount = 0;
11204              
11205              
11206 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(in)?to\\s/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
11207             q{loc},
11208             $tracelevel)
11209             if defined $::RD_TRACE;
11210 0         0 undef $lastsep;
11211 0         0 $expectation->is(q{})->at($text);
11212            
11213              
11214 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(in)?to\s)/)
  0 0       0  
11215             {
11216 0 0       0 $text = $lastsep . $text if defined $lastsep;
11217 0         0 $expectation->failed();
11218 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
11219             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11220             if defined $::RD_TRACE;
11221              
11222 0         0 last;
11223             }
11224 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
11225 0         0 substr($text,0,length($current_match),q{});
11226 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
11227             . $current_match . q{])},
11228             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11229             if defined $::RD_TRACE;
11230 0         0 push @item, $item{__PATTERN1__}=$current_match;
11231            
11232              
11233 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
11234             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11235             q{loc},
11236             $tracelevel)
11237             if defined $::RD_TRACE;
11238            
11239              
11240 0 0       0 $_tok = ($_noactions) ? 0 : do { "into" };
  0         0  
11241 0 0       0 unless (defined $_tok)
11242             {
11243 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
11244             if defined $::RD_TRACE;
11245 0         0 last;
11246             }
11247 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
11248             . $_tok . q{])},
11249             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11250             if defined $::RD_TRACE;
11251 0         0 push @item, $_tok;
11252 0         0 $item{__ACTION1__}=$_tok;
11253            
11254              
11255 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(in)?to\\s/]<<},
11256             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11257             q{loc},
11258             $tracelevel)
11259             if defined $::RD_TRACE;
11260              
11261              
11262              
11263 0         0 $_matched = 1;
11264 0         0 last;
11265             }
11266              
11267              
11268 0   0     0 while (!$_matched && !$commit)
11269             {
11270            
11271 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(append(ing)?|as\\s+(a\\s+)child(\\s+of)?)\\s/]},
11272             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11273             q{loc},
11274             $tracelevel)
11275             if defined $::RD_TRACE;
11276 0         0 my $thisprod = $thisrule->{"prods"}[3];
11277 0         0 $text = $_[1];
11278 0         0 my $_savetext;
11279 0         0 @item = (q{loc});
11280 0         0 %item = (__RULE__ => q{loc});
11281 0         0 my $repcount = 0;
11282              
11283              
11284 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(append(ing)?|as\\s+(a\\s+)child(\\s+of)?)\\s/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
11285             q{loc},
11286             $tracelevel)
11287             if defined $::RD_TRACE;
11288 0         0 undef $lastsep;
11289 0         0 $expectation->is(q{})->at($text);
11290            
11291              
11292 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(append(ing)?|as\s+(a\s+)child(\s+of)?)\s)/)
  0 0       0  
11293             {
11294 0 0       0 $text = $lastsep . $text if defined $lastsep;
11295 0         0 $expectation->failed();
11296 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
11297             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11298             if defined $::RD_TRACE;
11299              
11300 0         0 last;
11301             }
11302 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
11303 0         0 substr($text,0,length($current_match),q{});
11304 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
11305             . $current_match . q{])},
11306             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11307             if defined $::RD_TRACE;
11308 0         0 push @item, $item{__PATTERN1__}=$current_match;
11309            
11310              
11311 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
11312             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11313             q{loc},
11314             $tracelevel)
11315             if defined $::RD_TRACE;
11316            
11317              
11318 0 0       0 $_tok = ($_noactions) ? 0 : do { "append" };
  0         0  
11319 0 0       0 unless (defined $_tok)
11320             {
11321 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
11322             if defined $::RD_TRACE;
11323 0         0 last;
11324             }
11325 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
11326             . $_tok . q{])},
11327             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11328             if defined $::RD_TRACE;
11329 0         0 push @item, $_tok;
11330 0         0 $item{__ACTION1__}=$_tok;
11331            
11332              
11333 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(append(ing)?|as\\s+(a\\s+)child(\\s+of)?)\\s/]<<},
11334             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11335             q{loc},
11336             $tracelevel)
11337             if defined $::RD_TRACE;
11338              
11339              
11340              
11341 0         0 $_matched = 1;
11342 0         0 last;
11343             }
11344              
11345              
11346 0   0     0 while (!$_matched && !$commit)
11347             {
11348            
11349 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(prepend(ing)?|(as\\s+)(the\\s+)first(\\s+child(\\s+of)?)?)\\s/]},
11350             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11351             q{loc},
11352             $tracelevel)
11353             if defined $::RD_TRACE;
11354 0         0 my $thisprod = $thisrule->{"prods"}[4];
11355 0         0 $text = $_[1];
11356 0         0 my $_savetext;
11357 0         0 @item = (q{loc});
11358 0         0 %item = (__RULE__ => q{loc});
11359 0         0 my $repcount = 0;
11360              
11361              
11362 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(prepend(ing)?|(as\\s+)(the\\s+)first(\\s+child(\\s+of)?)?)\\s/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
11363             q{loc},
11364             $tracelevel)
11365             if defined $::RD_TRACE;
11366 0         0 undef $lastsep;
11367 0         0 $expectation->is(q{})->at($text);
11368            
11369              
11370 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(prepend(ing)?|(as\s+)(the\s+)first(\s+child(\s+of)?)?)\s)/)
  0 0       0  
11371             {
11372 0 0       0 $text = $lastsep . $text if defined $lastsep;
11373 0         0 $expectation->failed();
11374 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
11375             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11376             if defined $::RD_TRACE;
11377              
11378 0         0 last;
11379             }
11380 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
11381 0         0 substr($text,0,length($current_match),q{});
11382 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
11383             . $current_match . q{])},
11384             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11385             if defined $::RD_TRACE;
11386 0         0 push @item, $item{__PATTERN1__}=$current_match;
11387            
11388              
11389 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
11390             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11391             q{loc},
11392             $tracelevel)
11393             if defined $::RD_TRACE;
11394            
11395              
11396 0 0       0 $_tok = ($_noactions) ? 0 : do { "prepend" };
  0         0  
11397 0 0       0 unless (defined $_tok)
11398             {
11399 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
11400             if defined $::RD_TRACE;
11401 0         0 last;
11402             }
11403 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
11404             . $_tok . q{])},
11405             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11406             if defined $::RD_TRACE;
11407 0         0 push @item, $_tok;
11408 0         0 $item{__ACTION1__}=$_tok;
11409            
11410              
11411 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(prepend(ing)?|(as\\s+)(the\\s+)first(\\s+child(\\s+of)?)?)\\s/]<<},
11412             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11413             q{loc},
11414             $tracelevel)
11415             if defined $::RD_TRACE;
11416              
11417              
11418              
11419 0         0 $_matched = 1;
11420 0         0 last;
11421             }
11422              
11423              
11424 0   0     0 while (!$_matched && !$commit)
11425             {
11426            
11427 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(replace|instead( of)?)\\s/]},
11428             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11429             q{loc},
11430             $tracelevel)
11431             if defined $::RD_TRACE;
11432 0         0 my $thisprod = $thisrule->{"prods"}[5];
11433 0         0 $text = $_[1];
11434 0         0 my $_savetext;
11435 0         0 @item = (q{loc});
11436 0         0 %item = (__RULE__ => q{loc});
11437 0         0 my $repcount = 0;
11438              
11439              
11440 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(replace|instead( of)?)\\s/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
11441             q{loc},
11442             $tracelevel)
11443             if defined $::RD_TRACE;
11444 0         0 undef $lastsep;
11445 0         0 $expectation->is(q{})->at($text);
11446            
11447              
11448 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(replace|instead( of)?)\s)/)
  0 0       0  
11449             {
11450 0 0       0 $text = $lastsep . $text if defined $lastsep;
11451 0         0 $expectation->failed();
11452 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
11453             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11454             if defined $::RD_TRACE;
11455              
11456 0         0 last;
11457             }
11458 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
11459 0         0 substr($text,0,length($current_match),q{});
11460 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
11461             . $current_match . q{])},
11462             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11463             if defined $::RD_TRACE;
11464 0         0 push @item, $item{__PATTERN1__}=$current_match;
11465            
11466              
11467 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
11468             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11469             q{loc},
11470             $tracelevel)
11471             if defined $::RD_TRACE;
11472            
11473              
11474 0 0       0 $_tok = ($_noactions) ? 0 : do { "replace" };
  0         0  
11475 0 0       0 unless (defined $_tok)
11476             {
11477 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
11478             if defined $::RD_TRACE;
11479 0         0 last;
11480             }
11481 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
11482             . $_tok . q{])},
11483             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11484             if defined $::RD_TRACE;
11485 0         0 push @item, $_tok;
11486 0         0 $item{__ACTION1__}=$_tok;
11487            
11488              
11489 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(replace|instead( of)?)\\s/]<<},
11490             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11491             q{loc},
11492             $tracelevel)
11493             if defined $::RD_TRACE;
11494              
11495              
11496              
11497 0         0 $_matched = 1;
11498 0         0 last;
11499             }
11500              
11501              
11502 0 0 0     0 unless ( $_matched || defined($score) )
11503             {
11504            
11505              
11506 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
11507 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
11508             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11509             q{loc},
11510             $tracelevel)
11511             if defined $::RD_TRACE;
11512 0         0 return undef;
11513             }
11514 0 0 0     0 if (!defined($return) && defined($score))
11515             {
11516 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
11517             q{loc},
11518             $tracelevel)
11519             if defined $::RD_TRACE;
11520 0         0 $return = $score_return;
11521             }
11522 0         0 splice @{$thisparser->{errors}}, $err_at;
  0         0  
11523 0 0       0 $return = $item[$#item] unless defined $return;
11524 0 0       0 if (defined $::RD_TRACE)
11525             {
11526 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
11527             $return . q{])}, "",
11528             q{loc},
11529             $tracelevel);
11530 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
11531             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
11532             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11533             , q{loc},
11534             $tracelevel)
11535             }
11536 0         0 $_[1] = $text;
11537 0         0 return $return;
11538             }
11539              
11540             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
11541             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::local_var
11542             {
11543 23     23   55 my $thisparser = $_[0];
11544 8     8   89 use vars q{$tracelevel};
  8         20  
  8         4323  
11545 23   50     98 local $tracelevel = ($tracelevel||0)+1;
11546 23         40 $ERRORS = 0;
11547 23         73 my $thisrule = $thisparser->{"rules"}{"local_var"};
11548              
11549 23 50       69 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [local_var]},
11550             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11551             q{local_var},
11552             $tracelevel)
11553             if defined $::RD_TRACE;
11554              
11555            
11556 23         43 my $err_at = @{$thisparser->{errors}};
  23         63  
11557              
11558 23         75 my $score;
11559             my $score_return;
11560 23         0 my $_tok;
11561 23         37 my $return = undef;
11562 23         40 my $_matched=0;
11563 23         40 my $commit=0;
11564 23         43 my @item = ();
11565 23         51 my %item = ();
11566 23         37 my $repeating = $_[2];
11567 23         41 my $_noactions = $_[3];
11568 23 50       65 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  23         38  
  23         58  
11569 23         42 my $_itempos = $_[5];
11570 23 50       72 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
11571 23         63 my $text;
11572             my $lastsep;
11573 23         0 my $current_match;
11574 23         60 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(local|my)\\s/});
11575 23         85 $expectation->at($_[1]);
11576            
11577 23         35 my $thisoffset;
11578 23         84 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
11579            
11580 23         46 my $thiscolumn;
11581 23         80 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
11582            
11583 23         44 my $thisline;
11584 23         63 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
11585              
11586            
11587              
11588 23   33     171 while (!$_matched && !$commit)
11589             {
11590            
11591 23 50       70 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(local|my)\\s/ variable]},
11592             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11593             q{local_var},
11594             $tracelevel)
11595             if defined $::RD_TRACE;
11596 23         65 my $thisprod = $thisrule->{"prods"}[0];
11597 23         47 $text = $_[1];
11598 23         52 my $_savetext;
11599 23         60 @item = (q{local_var});
11600 23         66 %item = (__RULE__ => q{local_var});
11601 23         46 my $repcount = 0;
11602              
11603              
11604 23 50       70 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [/(local|my)\\s/]},
11605             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11606             q{local_var},
11607             $tracelevel)
11608             if defined $::RD_TRACE;
11609 23         65 $expectation->is(q{})->at($text);
11610            
11611 23 50   23   157 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::_alternation_1_of_production_1_of_rule_local_var, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  23         59  
11612             {
11613 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
11614             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11615             q{local_var},
11616             $tracelevel)
11617             if defined $::RD_TRACE;
11618 0         0 last;
11619             }
11620 23 50       141 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [_alternation_1_of_production_1_of_rule_local_var]<< (}
11621             . @$_tok . q{ times)},
11622              
11623             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11624             q{local_var},
11625             $tracelevel)
11626             if defined $::RD_TRACE;
11627 23         75 $item{q{_alternation_1_of_production_1_of_rule_local_var(?)}} = $_tok;
11628 23         56 push @item, $_tok;
11629            
11630              
11631              
11632 23 50       61 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [variable]},
11633             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11634             q{local_var},
11635             $tracelevel)
11636             if defined $::RD_TRACE;
11637 8     8   80 if (1) { no strict qw{refs};
  8         29  
  8         4836  
  23         46  
11638 23         68 $expectation->is(q{variable})->at($text);
11639 23 100   23   183 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::variable($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  23         51  
11640             {
11641            
11642 15 50       48 XML::XSH2::Parser::_Runtime::_trace(q{<>},
11643             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11644             q{local_var},
11645             $tracelevel)
11646             if defined $::RD_TRACE;
11647 15         47 $expectation->failed();
11648 15         29 last;
11649             }
11650 8 50       39 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [variable]<< (return value: [}
11651             . $_tok . q{]},
11652              
11653             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11654             q{local_var},
11655             $tracelevel)
11656             if defined $::RD_TRACE;
11657 8         26 $item{q{variable}} = $_tok;
11658 8         19 push @item, $_tok;
11659            
11660             }
11661              
11662 8 50       22 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
11663             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11664             q{local_var},
11665             $tracelevel)
11666             if defined $::RD_TRACE;
11667            
11668              
11669 8 50       46 $_tok = ($_noactions) ? 0 : do { [$item[2],@{$item[1]}] };
  8         17  
  8         25  
11670 8 50       38 unless (defined $_tok)
11671             {
11672 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
11673             if defined $::RD_TRACE;
11674 0         0 last;
11675             }
11676 8 50       49 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
11677             . $_tok . q{])},
11678             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11679             if defined $::RD_TRACE;
11680 8         22 push @item, $_tok;
11681 8         29 $item{__ACTION1__}=$_tok;
11682            
11683              
11684 8 50       25 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(local|my)\\s/ variable]<<},
11685             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11686             q{local_var},
11687             $tracelevel)
11688             if defined $::RD_TRACE;
11689              
11690              
11691              
11692 8         14 $_matched = 1;
11693 8         21 last;
11694             }
11695              
11696              
11697 23 100 66     143 unless ( $_matched || defined($score) )
11698             {
11699            
11700              
11701 15         35 $_[1] = $text; # NOT SURE THIS IS NEEDED
11702 15 50       36 XML::XSH2::Parser::_Runtime::_trace(q{<>},
11703             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11704             q{local_var},
11705             $tracelevel)
11706             if defined $::RD_TRACE;
11707 15         108 return undef;
11708             }
11709 8 50 33     85 if (!defined($return) && defined($score))
11710             {
11711 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
11712             q{local_var},
11713             $tracelevel)
11714             if defined $::RD_TRACE;
11715 0         0 $return = $score_return;
11716             }
11717 8         19 splice @{$thisparser->{errors}}, $err_at;
  8         24  
11718 8 50       33 $return = $item[$#item] unless defined $return;
11719 8 50       28 if (defined $::RD_TRACE)
11720             {
11721 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
11722             $return . q{])}, "",
11723             q{local_var},
11724             $tracelevel);
11725 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
11726             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
11727             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11728             , q{local_var},
11729             $tracelevel)
11730             }
11731 8         26 $_[1] = $text;
11732 8         65 return $return;
11733             }
11734              
11735             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
11736             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::local_var_in
11737             {
11738 17     17   38 my $thisparser = $_[0];
11739 8     8   74 use vars q{$tracelevel};
  8         31  
  8         3204  
11740 17   50     64 local $tracelevel = ($tracelevel||0)+1;
11741 17         28 $ERRORS = 0;
11742 17         46 my $thisrule = $thisparser->{"rules"}{"local_var_in"};
11743              
11744 17 50       46 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [local_var_in]},
11745             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11746             q{local_var_in},
11747             $tracelevel)
11748             if defined $::RD_TRACE;
11749              
11750            
11751 17         25 my $err_at = @{$thisparser->{errors}};
  17         42  
11752              
11753 17         55 my $score;
11754             my $score_return;
11755 17         0 my $_tok;
11756 17         31 my $return = undef;
11757 17         29 my $_matched=0;
11758 17         31 my $commit=0;
11759 17         36 my @item = ();
11760 17         44 my %item = ();
11761 17         30 my $repeating = $_[2];
11762 17         42 my $_noactions = $_[3];
11763 17 50       136 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  17         28  
  17         37  
11764 17         47 my $_itempos = $_[5];
11765 17 50       51 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
11766 17         58 my $text;
11767             my $lastsep;
11768 17         0 my $current_match;
11769 17         46 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{local_var});
11770 17         60 $expectation->at($_[1]);
11771            
11772 17         26 my $thisoffset;
11773 17         67 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
11774            
11775 17         35 my $thiscolumn;
11776 17         51 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
11777            
11778 17         34 my $thisline;
11779 17         54 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
11780              
11781            
11782              
11783 17   33     111 while (!$_matched && !$commit)
11784             {
11785            
11786 17 50       45 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [local_var 'in']},
11787             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11788             q{local_var_in},
11789             $tracelevel)
11790             if defined $::RD_TRACE;
11791 17         53 my $thisprod = $thisrule->{"prods"}[0];
11792 17         36 $text = $_[1];
11793 17         32 my $_savetext;
11794 17         44 @item = (q{local_var_in});
11795 17         36 %item = (__RULE__ => q{local_var_in});
11796 17         30 my $repcount = 0;
11797              
11798              
11799 17 50       56 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [local_var]},
11800             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11801             q{local_var_in},
11802             $tracelevel)
11803             if defined $::RD_TRACE;
11804 8     8   78 if (1) { no strict qw{refs};
  8         17  
  8         5949  
  17         28  
11805 17         70 $expectation->is(q{})->at($text);
11806 17 100   17   115 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::local_var($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  17         37  
11807             {
11808            
11809 15 50       40 XML::XSH2::Parser::_Runtime::_trace(q{<>},
11810             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11811             q{local_var_in},
11812             $tracelevel)
11813             if defined $::RD_TRACE;
11814 15         43 $expectation->failed();
11815 15         34 last;
11816             }
11817 2 50       10 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [local_var]<< (return value: [}
11818             . $_tok . q{]},
11819              
11820             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11821             q{local_var_in},
11822             $tracelevel)
11823             if defined $::RD_TRACE;
11824 2         6 $item{q{local_var}} = $_tok;
11825 2         4 push @item, $_tok;
11826            
11827             }
11828              
11829 2 50       6 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: ['in']},
11830             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11831             q{local_var_in},
11832             $tracelevel)
11833             if defined $::RD_TRACE;
11834 2         5 undef $lastsep;
11835 2         7 $expectation->is(q{'in'})->at($text);
11836            
11837              
11838 2 100 66     71 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\Ain/)
  2 100       42  
11839             {
11840 1 50       5 $text = $lastsep . $text if defined $lastsep;
11841            
11842 1         4 $expectation->failed();
11843 1 50       5 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
11844             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11845             if defined $::RD_TRACE;
11846 1         4 last;
11847             }
11848 1         8 $current_match = substr($text, $-[0], $+[0] - $-[0]);
11849 1         5 substr($text,0,length($current_match),q{});
11850 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
11851             . $current_match . q{])},
11852             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11853             if defined $::RD_TRACE;
11854 1         4 push @item, $item{__STRING1__}=$current_match;
11855            
11856              
11857 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
11858             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11859             q{local_var_in},
11860             $tracelevel)
11861             if defined $::RD_TRACE;
11862            
11863              
11864 1 50       15 $_tok = ($_noactions) ? 0 : do { $item[1] };
  1         3  
11865 1 50       4 unless (defined $_tok)
11866             {
11867 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
11868             if defined $::RD_TRACE;
11869 0         0 last;
11870             }
11871 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
11872             . $_tok . q{])},
11873             XML::XSH2::Parser::_Runtime::_tracefirst($text))
11874             if defined $::RD_TRACE;
11875 1         3 push @item, $_tok;
11876 1         3 $item{__ACTION1__}=$_tok;
11877            
11878              
11879 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [local_var 'in']<<},
11880             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11881             q{local_var_in},
11882             $tracelevel)
11883             if defined $::RD_TRACE;
11884              
11885              
11886              
11887 1         2 $_matched = 1;
11888 1         3 last;
11889             }
11890              
11891              
11892 17 100 66     112 unless ( $_matched || defined($score) )
11893             {
11894            
11895              
11896 16         38 $_[1] = $text; # NOT SURE THIS IS NEEDED
11897 16 50       43 XML::XSH2::Parser::_Runtime::_trace(q{<>},
11898             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11899             q{local_var_in},
11900             $tracelevel)
11901             if defined $::RD_TRACE;
11902 16         98 return undef;
11903             }
11904 1 50 33     7 if (!defined($return) && defined($score))
11905             {
11906 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
11907             q{local_var_in},
11908             $tracelevel)
11909             if defined $::RD_TRACE;
11910 0         0 $return = $score_return;
11911             }
11912 1         2 splice @{$thisparser->{errors}}, $err_at;
  1         4  
11913 1 50       4 $return = $item[$#item] unless defined $return;
11914 1 50       4 if (defined $::RD_TRACE)
11915             {
11916 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
11917             $return . q{])}, "",
11918             q{local_var_in},
11919             $tracelevel);
11920 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
11921             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
11922             XML::XSH2::Parser::_Runtime::_tracefirst($text),
11923             , q{local_var_in},
11924             $tracelevel)
11925             }
11926 1         3 $_[1] = $text;
11927 1         9 return $return;
11928             }
11929              
11930             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
11931             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::loose_exp
11932             {
11933 192     192   405 my $thisparser = $_[0];
11934 8     8   82 use vars q{$tracelevel};
  8         17  
  8         4698  
11935 192   50     608 local $tracelevel = ($tracelevel||0)+1;
11936 192         291 $ERRORS = 0;
11937 192         462 my $thisrule = $thisparser->{"rules"}{"loose_exp"};
11938              
11939 192 50       518 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [loose_exp]},
11940             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11941             q{loose_exp},
11942             $tracelevel)
11943             if defined $::RD_TRACE;
11944              
11945            
11946 192         283 my $err_at = @{$thisparser->{errors}};
  192         628  
11947              
11948 192         507 my $score;
11949             my $score_return;
11950 192         0 my $_tok;
11951 192         311 my $return = undef;
11952 192         349 my $_matched=0;
11953 192         282 my $commit=0;
11954 192         341 my @item = ();
11955 192         300 my %item = ();
11956 192         328 my $repeating = $_[2];
11957 192         347 my $_noactions = $_[3];
11958 192 50       444 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  192         281  
  192         319  
11959 192         365 my $_itempos = $_[5];
11960 192 50       499 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
11961 192         505 my $text;
11962             my $lastsep;
11963 192         0 my $current_match;
11964 192         455 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/^(?=\{)/, or '&', or /^(?=<<)/, or xpinter});
11965 192         837 $expectation->at($_[1]);
11966            
11967 192         273 my $thisoffset;
11968 192         696 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
11969            
11970 192         372 my $thiscolumn;
11971 192         523 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
11972            
11973 192         363 my $thisline;
11974 192         499 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
11975              
11976            
11977              
11978 192   33     937 while (!$_matched && !$commit)
11979             {
11980            
11981 192 50       462 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/^(?=\{)/ perl_block]},
11982             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
11983             q{loose_exp},
11984             $tracelevel)
11985             if defined $::RD_TRACE;
11986 192         460 my $thisprod = $thisrule->{"prods"}[0];
11987 192         420 $text = $_[1];
11988 192         333 my $_savetext;
11989 192         447 @item = (q{loose_exp});
11990 192         438 %item = (__RULE__ => q{loose_exp});
11991 192         350 my $repcount = 0;
11992              
11993              
11994 192 50       474 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/^(?=\{)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
11995             q{loose_exp},
11996             $tracelevel)
11997             if defined $::RD_TRACE;
11998 192         371 undef $lastsep;
11999 192         478 $expectation->is(q{})->at($text);
12000            
12001              
12002 192 100 66     1845 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:^(?={))/)
  192 100       2039  
12003             {
12004 191 50       818 $text = $lastsep . $text if defined $lastsep;
12005 191         608 $expectation->failed();
12006 191 50       504 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12007             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12008             if defined $::RD_TRACE;
12009              
12010 191         430 last;
12011             }
12012 1         16 $current_match = substr($text, $-[0], $+[0] - $-[0]);
12013 1         16 substr($text,0,length($current_match),q{});
12014 1 50       12 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
12015             . $current_match . q{])},
12016             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12017             if defined $::RD_TRACE;
12018 1         5 push @item, $item{__PATTERN1__}=$current_match;
12019            
12020              
12021 1 50       17 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [perl_block]},
12022             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12023             q{loose_exp},
12024             $tracelevel)
12025             if defined $::RD_TRACE;
12026 8     8   65 if (1) { no strict qw{refs};
  8         37  
  8         4504  
  1         11  
12027 1         11 $expectation->is(q{perl_block})->at($text);
12028 1 50   1   21 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::perl_block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1         8  
12029             {
12030            
12031 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12032             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12033             q{loose_exp},
12034             $tracelevel)
12035             if defined $::RD_TRACE;
12036 0         0 $expectation->failed();
12037 0         0 last;
12038             }
12039 1 50       11 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [perl_block]<< (return value: [}
12040             . $_tok . q{]},
12041              
12042             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12043             q{loose_exp},
12044             $tracelevel)
12045             if defined $::RD_TRACE;
12046 1         9 $item{q{perl_block}} = $_tok;
12047 1         4 push @item, $_tok;
12048            
12049             }
12050              
12051 1 50       13 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
12052             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12053             q{loose_exp},
12054             $tracelevel)
12055             if defined $::RD_TRACE;
12056            
12057              
12058 1 50       15 $_tok = ($_noactions) ? 0 : do { $item[2] };
  1         8  
12059 1 50       4 unless (defined $_tok)
12060             {
12061 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
12062             if defined $::RD_TRACE;
12063 0         0 last;
12064             }
12065 1 50       9 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
12066             . $_tok . q{])},
12067             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12068             if defined $::RD_TRACE;
12069 1         3 push @item, $_tok;
12070 1         3 $item{__ACTION1__}=$_tok;
12071            
12072              
12073 1 50       9 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/^(?=\{)/ perl_block]<<},
12074             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12075             q{loose_exp},
12076             $tracelevel)
12077             if defined $::RD_TRACE;
12078              
12079              
12080              
12081 1         2 $_matched = 1;
12082 1         3 last;
12083             }
12084              
12085              
12086 192   66     824 while (!$_matched && !$commit)
12087             {
12088            
12089 191 50       476 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: ['&' block]},
12090             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12091             q{loose_exp},
12092             $tracelevel)
12093             if defined $::RD_TRACE;
12094 191         367 my $thisprod = $thisrule->{"prods"}[1];
12095 191         364 $text = $_[1];
12096 191         289 my $_savetext;
12097 191         503 @item = (q{loose_exp});
12098 191         506 %item = (__RULE__ => q{loose_exp});
12099 191         296 my $repcount = 0;
12100              
12101              
12102 191 50       424 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: ['&']},
12103             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12104             q{loose_exp},
12105             $tracelevel)
12106             if defined $::RD_TRACE;
12107 191         345 undef $lastsep;
12108 191         412 $expectation->is(q{})->at($text);
12109            
12110              
12111 191 100 33     1505 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A\&/)
  191 50       1769  
12112             {
12113 191 50       630 $text = $lastsep . $text if defined $lastsep;
12114            
12115 191         647 $expectation->failed();
12116 191 50       429 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
12117             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12118             if defined $::RD_TRACE;
12119 191         383 last;
12120             }
12121 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
12122 0         0 substr($text,0,length($current_match),q{});
12123 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
12124             . $current_match . q{])},
12125             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12126             if defined $::RD_TRACE;
12127 0         0 push @item, $item{__STRING1__}=$current_match;
12128            
12129              
12130 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
12131             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12132             q{loose_exp},
12133             $tracelevel)
12134             if defined $::RD_TRACE;
12135 8     8   64 if (1) { no strict qw{refs};
  8         22  
  8         4488  
  0         0  
12136 0         0 $expectation->is(q{block})->at($text);
12137 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
12138             {
12139            
12140 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12141             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12142             q{loose_exp},
12143             $tracelevel)
12144             if defined $::RD_TRACE;
12145 0         0 $expectation->failed();
12146 0         0 last;
12147             }
12148 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
12149             . $_tok . q{]},
12150              
12151             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12152             q{loose_exp},
12153             $tracelevel)
12154             if defined $::RD_TRACE;
12155 0         0 $item{q{block}} = $_tok;
12156 0         0 push @item, $_tok;
12157            
12158             }
12159              
12160 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
12161             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12162             q{loose_exp},
12163             $tracelevel)
12164             if defined $::RD_TRACE;
12165            
12166              
12167 0 0       0 $_tok = ($_noactions) ? 0 : do { $item[2] };
  0         0  
12168 0 0       0 unless (defined $_tok)
12169             {
12170 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
12171             if defined $::RD_TRACE;
12172 0         0 last;
12173             }
12174 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
12175             . $_tok . q{])},
12176             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12177             if defined $::RD_TRACE;
12178 0         0 push @item, $_tok;
12179 0         0 $item{__ACTION1__}=$_tok;
12180            
12181              
12182 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: ['&' block]<<},
12183             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12184             q{loose_exp},
12185             $tracelevel)
12186             if defined $::RD_TRACE;
12187              
12188              
12189              
12190 0         0 $_matched = 1;
12191 0         0 last;
12192             }
12193              
12194              
12195 192   66     845 while (!$_matched && !$commit)
12196             {
12197            
12198 191 50       534 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/^(?=<<)/ inline_doc]},
12199             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12200             q{loose_exp},
12201             $tracelevel)
12202             if defined $::RD_TRACE;
12203 191         420 my $thisprod = $thisrule->{"prods"}[2];
12204 191         349 $text = $_[1];
12205 191         296 my $_savetext;
12206 191         422 @item = (q{loose_exp});
12207 191         476 %item = (__RULE__ => q{loose_exp});
12208 191         298 my $repcount = 0;
12209              
12210              
12211 191 50       483 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/^(?=<<)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
12212             q{loose_exp},
12213             $tracelevel)
12214             if defined $::RD_TRACE;
12215 191         327 undef $lastsep;
12216 191         423 $expectation->is(q{})->at($text);
12217            
12218              
12219 191 100 33     1474 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:^(?=<<))/)
  191 50       1658  
12220             {
12221 191 50       602 $text = $lastsep . $text if defined $lastsep;
12222 191         519 $expectation->failed();
12223 191 50       466 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12224             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12225             if defined $::RD_TRACE;
12226              
12227 191         368 last;
12228             }
12229 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
12230 0         0 substr($text,0,length($current_match),q{});
12231 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
12232             . $current_match . q{])},
12233             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12234             if defined $::RD_TRACE;
12235 0         0 push @item, $item{__PATTERN1__}=$current_match;
12236            
12237              
12238 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [inline_doc]},
12239             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12240             q{loose_exp},
12241             $tracelevel)
12242             if defined $::RD_TRACE;
12243 8     8   64 if (1) { no strict qw{refs};
  8         35  
  8         3424  
  0         0  
12244 0         0 $expectation->is(q{inline_doc})->at($text);
12245 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::inline_doc($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
12246             {
12247            
12248 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12249             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12250             q{loose_exp},
12251             $tracelevel)
12252             if defined $::RD_TRACE;
12253 0         0 $expectation->failed();
12254 0         0 last;
12255             }
12256 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [inline_doc]<< (return value: [}
12257             . $_tok . q{]},
12258              
12259             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12260             q{loose_exp},
12261             $tracelevel)
12262             if defined $::RD_TRACE;
12263 0         0 $item{q{inline_doc}} = $_tok;
12264 0         0 push @item, $_tok;
12265            
12266             }
12267              
12268 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
12269             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12270             q{loose_exp},
12271             $tracelevel)
12272             if defined $::RD_TRACE;
12273            
12274              
12275 0 0       0 $_tok = ($_noactions) ? 0 : do { $item[2] };
  0         0  
12276 0 0       0 unless (defined $_tok)
12277             {
12278 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
12279             if defined $::RD_TRACE;
12280 0         0 last;
12281             }
12282 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
12283             . $_tok . q{])},
12284             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12285             if defined $::RD_TRACE;
12286 0         0 push @item, $_tok;
12287 0         0 $item{__ACTION1__}=$_tok;
12288            
12289              
12290 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/^(?=<<)/ inline_doc]<<},
12291             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12292             q{loose_exp},
12293             $tracelevel)
12294             if defined $::RD_TRACE;
12295              
12296              
12297              
12298 0         0 $_matched = 1;
12299 0         0 last;
12300             }
12301              
12302              
12303 192   66     801 while (!$_matched && !$commit)
12304             {
12305            
12306 191 50       451 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xpinter]},
12307             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12308             q{loose_exp},
12309             $tracelevel)
12310             if defined $::RD_TRACE;
12311 191         444 my $thisprod = $thisrule->{"prods"}[3];
12312 191         430 $text = $_[1];
12313 191         305 my $_savetext;
12314 191         457 @item = (q{loose_exp});
12315 191         527 %item = (__RULE__ => q{loose_exp});
12316 191         289 my $repcount = 0;
12317              
12318              
12319 191 50       416 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpinter]},
12320             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12321             q{loose_exp},
12322             $tracelevel)
12323             if defined $::RD_TRACE;
12324 8     8   62 if (1) { no strict qw{refs};
  8         18  
  8         4628  
  191         293  
12325 191         423 $expectation->is(q{})->at($text);
12326 191 50   191   1196 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpinter($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  191         362  
12327             {
12328            
12329 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12330             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12331             q{loose_exp},
12332             $tracelevel)
12333             if defined $::RD_TRACE;
12334 0         0 $expectation->failed();
12335 0         0 last;
12336             }
12337 191 50       690 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpinter]<< (return value: [}
12338             . $_tok . q{]},
12339              
12340             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12341             q{loose_exp},
12342             $tracelevel)
12343             if defined $::RD_TRACE;
12344 191         441 $item{q{xpinter}} = $_tok;
12345 191         359 push @item, $_tok;
12346            
12347             }
12348              
12349 191 50       416 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xpinter]<<},
12350             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12351             q{loose_exp},
12352             $tracelevel)
12353             if defined $::RD_TRACE;
12354              
12355              
12356              
12357 191         283 $_matched = 1;
12358 191         356 last;
12359             }
12360              
12361              
12362 192 50 33     536 unless ( $_matched || defined($score) )
12363             {
12364            
12365              
12366 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
12367 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12368             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12369             q{loose_exp},
12370             $tracelevel)
12371             if defined $::RD_TRACE;
12372 0         0 return undef;
12373             }
12374 192 50 33     840 if (!defined($return) && defined($score))
12375             {
12376 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
12377             q{loose_exp},
12378             $tracelevel)
12379             if defined $::RD_TRACE;
12380 0         0 $return = $score_return;
12381             }
12382 192         332 splice @{$thisparser->{errors}}, $err_at;
  192         399  
12383 192 50       550 $return = $item[$#item] unless defined $return;
12384 192 50       497 if (defined $::RD_TRACE)
12385             {
12386 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
12387             $return . q{])}, "",
12388             q{loose_exp},
12389             $tracelevel);
12390 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
12391             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
12392             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12393             , q{loose_exp},
12394             $tracelevel)
12395             }
12396 192         433 $_[1] = $text;
12397 192         1265 return $return;
12398             }
12399              
12400             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
12401             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::nodename
12402             {
12403 0     0   0 my $thisparser = $_[0];
12404 8     8   64 use vars q{$tracelevel};
  8         19  
  8         3478  
12405 0   0     0 local $tracelevel = ($tracelevel||0)+1;
12406 0         0 $ERRORS = 0;
12407 0         0 my $thisrule = $thisparser->{"rules"}{"nodename"};
12408              
12409 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [nodename]},
12410             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12411             q{nodename},
12412             $tracelevel)
12413             if defined $::RD_TRACE;
12414              
12415            
12416 0         0 my $err_at = @{$thisparser->{errors}};
  0         0  
12417              
12418 0         0 my $score;
12419             my $score_return;
12420 0         0 my $_tok;
12421 0         0 my $return = undef;
12422 0         0 my $_matched=0;
12423 0         0 my $commit=0;
12424 0         0 my @item = ();
12425 0         0 my %item = ();
12426 0         0 my $repeating = $_[2];
12427 0         0 my $_noactions = $_[3];
12428 0 0       0 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  0         0  
  0         0  
12429 0         0 my $_itempos = $_[5];
12430 0 0       0 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
12431 0         0 my $text;
12432             my $lastsep;
12433 0         0 my $current_match;
12434 0         0 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{exp});
12435 0         0 $expectation->at($_[1]);
12436            
12437 0         0 my $thisoffset;
12438 0         0 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
12439            
12440 0         0 my $thiscolumn;
12441 0         0 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
12442            
12443 0         0 my $thisline;
12444 0         0 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
12445              
12446            
12447              
12448 0   0     0 while (!$_matched && !$commit)
12449             {
12450            
12451 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [exp]},
12452             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12453             q{nodename},
12454             $tracelevel)
12455             if defined $::RD_TRACE;
12456 0         0 my $thisprod = $thisrule->{"prods"}[0];
12457 0         0 $text = $_[1];
12458 0         0 my $_savetext;
12459 0         0 @item = (q{nodename});
12460 0         0 %item = (__RULE__ => q{nodename});
12461 0         0 my $repcount = 0;
12462              
12463              
12464 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
12465             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12466             q{nodename},
12467             $tracelevel)
12468             if defined $::RD_TRACE;
12469 8     8   105 if (1) { no strict qw{refs};
  8         26  
  8         3511  
  0         0  
12470 0         0 $expectation->is(q{})->at($text);
12471 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
12472             {
12473            
12474 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12475             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12476             q{nodename},
12477             $tracelevel)
12478             if defined $::RD_TRACE;
12479 0         0 $expectation->failed();
12480 0         0 last;
12481             }
12482 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
12483             . $_tok . q{]},
12484              
12485             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12486             q{nodename},
12487             $tracelevel)
12488             if defined $::RD_TRACE;
12489 0         0 $item{q{exp}} = $_tok;
12490 0         0 push @item, $_tok;
12491            
12492             }
12493              
12494 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [exp]<<},
12495             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12496             q{nodename},
12497             $tracelevel)
12498             if defined $::RD_TRACE;
12499              
12500              
12501              
12502 0         0 $_matched = 1;
12503 0         0 last;
12504             }
12505              
12506              
12507 0 0 0     0 unless ( $_matched || defined($score) )
12508             {
12509            
12510              
12511 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
12512 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12513             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12514             q{nodename},
12515             $tracelevel)
12516             if defined $::RD_TRACE;
12517 0         0 return undef;
12518             }
12519 0 0 0     0 if (!defined($return) && defined($score))
12520             {
12521 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
12522             q{nodename},
12523             $tracelevel)
12524             if defined $::RD_TRACE;
12525 0         0 $return = $score_return;
12526             }
12527 0         0 splice @{$thisparser->{errors}}, $err_at;
  0         0  
12528 0 0       0 $return = $item[$#item] unless defined $return;
12529 0 0       0 if (defined $::RD_TRACE)
12530             {
12531 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
12532             $return . q{])}, "",
12533             q{nodename},
12534             $tracelevel);
12535 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
12536             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
12537             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12538             , q{nodename},
12539             $tracelevel)
12540             }
12541 0         0 $_[1] = $text;
12542 0         0 return $return;
12543             }
12544              
12545             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
12546             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::nodetype
12547             {
12548 0     0   0 my $thisparser = $_[0];
12549 8     8   67 use vars q{$tracelevel};
  8         18  
  8         7200  
12550 0   0     0 local $tracelevel = ($tracelevel||0)+1;
12551 0         0 $ERRORS = 0;
12552 0         0 my $thisrule = $thisparser->{"rules"}{"nodetype"};
12553              
12554 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [nodetype]},
12555             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12556             q{nodetype},
12557             $tracelevel)
12558             if defined $::RD_TRACE;
12559              
12560            
12561 0         0 my $err_at = @{$thisparser->{errors}};
  0         0  
12562              
12563 0         0 my $score;
12564             my $score_return;
12565 0         0 my $_tok;
12566 0         0 my $return = undef;
12567 0         0 my $_matched=0;
12568 0         0 my $commit=0;
12569 0         0 my @item = ();
12570 0         0 my %item = ();
12571 0         0 my $repeating = $_[2];
12572 0         0 my $_noactions = $_[3];
12573 0 0       0 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  0         0  
  0         0  
12574 0         0 my $_itempos = $_[5];
12575 0 0       0 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
12576 0         0 my $text;
12577             my $lastsep;
12578 0         0 my $current_match;
12579 0         0 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/element|attribute|attributes|text|cdata|pi|comment|chunk|entity_reference/});
12580 0         0 $expectation->at($_[1]);
12581            
12582 0         0 my $thisoffset;
12583 0         0 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
12584            
12585 0         0 my $thiscolumn;
12586 0         0 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
12587            
12588 0         0 my $thisline;
12589 0         0 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
12590              
12591            
12592              
12593 0   0     0 while (!$_matched && !$commit)
12594             {
12595            
12596 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/element|attribute|attributes|text|cdata|pi|comment|chunk|entity_reference/]},
12597             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12598             q{nodetype},
12599             $tracelevel)
12600             if defined $::RD_TRACE;
12601 0         0 my $thisprod = $thisrule->{"prods"}[0];
12602 0         0 $text = $_[1];
12603 0         0 my $_savetext;
12604 0         0 @item = (q{nodetype});
12605 0         0 %item = (__RULE__ => q{nodetype});
12606 0         0 my $repcount = 0;
12607              
12608              
12609 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/element|attribute|attributes|text|cdata|pi|comment|chunk|entity_reference/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
12610             q{nodetype},
12611             $tracelevel)
12612             if defined $::RD_TRACE;
12613 0         0 undef $lastsep;
12614 0         0 $expectation->is(q{})->at($text);
12615            
12616              
12617 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:element|attribute|attributes|text|cdata|pi|comment|chunk|entity_reference)/)
  0 0       0  
12618             {
12619 0 0       0 $text = $lastsep . $text if defined $lastsep;
12620 0         0 $expectation->failed();
12621 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12622             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12623             if defined $::RD_TRACE;
12624              
12625 0         0 last;
12626             }
12627 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
12628 0         0 substr($text,0,length($current_match),q{});
12629 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
12630             . $current_match . q{])},
12631             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12632             if defined $::RD_TRACE;
12633 0         0 push @item, $item{__PATTERN1__}=$current_match;
12634            
12635              
12636 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/element|attribute|attributes|text|cdata|pi|comment|chunk|entity_reference/]<<},
12637             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12638             q{nodetype},
12639             $tracelevel)
12640             if defined $::RD_TRACE;
12641              
12642              
12643              
12644 0         0 $_matched = 1;
12645 0         0 last;
12646             }
12647              
12648              
12649 0 0 0     0 unless ( $_matched || defined($score) )
12650             {
12651            
12652              
12653 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
12654 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12655             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12656             q{nodetype},
12657             $tracelevel)
12658             if defined $::RD_TRACE;
12659 0         0 return undef;
12660             }
12661 0 0 0     0 if (!defined($return) && defined($score))
12662             {
12663 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
12664             q{nodetype},
12665             $tracelevel)
12666             if defined $::RD_TRACE;
12667 0         0 $return = $score_return;
12668             }
12669 0         0 splice @{$thisparser->{errors}}, $err_at;
  0         0  
12670 0 0       0 $return = $item[$#item] unless defined $return;
12671 0 0       0 if (defined $::RD_TRACE)
12672             {
12673 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
12674             $return . q{])}, "",
12675             q{nodetype},
12676             $tracelevel);
12677 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
12678             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
12679             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12680             , q{nodetype},
12681             $tracelevel)
12682             }
12683 0         0 $_[1] = $text;
12684 0         0 return $return;
12685             }
12686              
12687             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
12688             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::option
12689             {
12690 1016     1016   1647 my $thisparser = $_[0];
12691 8     8   67 use vars q{$tracelevel};
  8         16  
  8         7176  
12692 1016   50     2410 local $tracelevel = ($tracelevel||0)+1;
12693 1016         1504 $ERRORS = 0;
12694 1016         2355 my $thisrule = $thisparser->{"rules"}{"option"};
12695              
12696 1016 50       1994 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [option]},
12697             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12698             q{option},
12699             $tracelevel)
12700             if defined $::RD_TRACE;
12701              
12702            
12703 1016         1347 my $err_at = @{$thisparser->{errors}};
  1016         1814  
12704              
12705 1016         2412 my $score;
12706             my $score_return;
12707 1016         0 my $_tok;
12708 1016         1383 my $return = undef;
12709 1016         1382 my $_matched=0;
12710 1016         1360 my $commit=0;
12711 1016         1551 my @item = ();
12712 1016         1547 my %item = ();
12713 1016         1415 my $repeating = $_[2];
12714 1016         1360 my $_noactions = $_[3];
12715 1016 50       1927 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  1016         1317  
  1016         1679  
12716 1016         1611 my $_itempos = $_[5];
12717 1016 50       2424 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
12718 1016         2369 my $text;
12719             my $lastsep;
12720 1016         0 my $current_match;
12721 1016         2163 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/:[[:alnum:]]|--[-_[:alnum:]]+/});
12722 1016         2661 $expectation->at($_[1]);
12723            
12724 1016         1312 my $thisoffset;
12725 1016         3032 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
12726            
12727 1016         1643 my $thiscolumn;
12728 1016         2384 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
12729            
12730 1016         1621 my $thisline;
12731 1016         2348 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
12732              
12733            
12734              
12735 1016   33     3961 while (!$_matched && !$commit)
12736             {
12737            
12738 1016 50       1966 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/:[[:alnum:]]|--[-_[:alnum:]]+/]},
12739             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12740             q{option},
12741             $tracelevel)
12742             if defined $::RD_TRACE;
12743 1016         2160 my $thisprod = $thisrule->{"prods"}[0];
12744 1016         1619 $text = $_[1];
12745 1016         1288 my $_savetext;
12746 1016         1822 @item = (q{option});
12747 1016         1904 %item = (__RULE__ => q{option});
12748 1016         1430 my $repcount = 0;
12749              
12750              
12751 1016 50       1910 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/:[[:alnum:]]|--[-_[:alnum:]]+/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
12752             q{option},
12753             $tracelevel)
12754             if defined $::RD_TRACE;
12755 1016         1890 undef $lastsep;
12756 1016         2084 $expectation->is(q{})->at($text);
12757            
12758              
12759 1016 100 66     7484 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?::[[:alnum:]]|--[-_[:alnum:]]+)/)
  1016 100       8752  
12760             {
12761 981 50       2934 $text = $lastsep . $text if defined $lastsep;
12762 981         2711 $expectation->failed();
12763 981 50       2006 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12764             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12765             if defined $::RD_TRACE;
12766              
12767 981         1993 last;
12768             }
12769 35         217 $current_match = substr($text, $-[0], $+[0] - $-[0]);
12770 35         144 substr($text,0,length($current_match),q{});
12771 35 50       104 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
12772             . $current_match . q{])},
12773             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12774             if defined $::RD_TRACE;
12775 35         102 push @item, $item{__PATTERN1__}=$current_match;
12776            
12777              
12778 35 50       92 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/:[[:alnum:]]|--[-_[:alnum:]]+/]<<},
12779             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12780             q{option},
12781             $tracelevel)
12782             if defined $::RD_TRACE;
12783              
12784              
12785              
12786 35         58 $_matched = 1;
12787 35         63 last;
12788             }
12789              
12790              
12791 1016 100 66     3771 unless ( $_matched || defined($score) )
12792             {
12793            
12794              
12795 981         1757 $_[1] = $text; # NOT SURE THIS IS NEEDED
12796 981 50       1803 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12797             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12798             q{option},
12799             $tracelevel)
12800             if defined $::RD_TRACE;
12801 981         6004 return undef;
12802             }
12803 35 50 33     170 if (!defined($return) && defined($score))
12804             {
12805 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
12806             q{option},
12807             $tracelevel)
12808             if defined $::RD_TRACE;
12809 0         0 $return = $score_return;
12810             }
12811 35         64 splice @{$thisparser->{errors}}, $err_at;
  35         91  
12812 35 50       126 $return = $item[$#item] unless defined $return;
12813 35 50       87 if (defined $::RD_TRACE)
12814             {
12815 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
12816             $return . q{])}, "",
12817             q{option},
12818             $tracelevel);
12819 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
12820             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
12821             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12822             , q{option},
12823             $tracelevel)
12824             }
12825 35         76 $_[1] = $text;
12826 35         246 return $return;
12827             }
12828              
12829             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
12830             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::param
12831             {
12832 0     0   0 my $thisparser = $_[0];
12833 8     8   72 use vars q{$tracelevel};
  8         18  
  8         5832  
12834 0   0     0 local $tracelevel = ($tracelevel||0)+1;
12835 0         0 $ERRORS = 0;
12836 0         0 my $thisrule = $thisparser->{"rules"}{"param"};
12837              
12838 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [param]},
12839             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12840             q{param},
12841             $tracelevel)
12842             if defined $::RD_TRACE;
12843              
12844            
12845 0         0 my $err_at = @{$thisparser->{errors}};
  0         0  
12846              
12847 0         0 my $score;
12848             my $score_return;
12849 0         0 my $_tok;
12850 0         0 my $return = undef;
12851 0         0 my $_matched=0;
12852 0         0 my $commit=0;
12853 0         0 my @item = ();
12854 0         0 my %item = ();
12855 0         0 my $repeating = $_[2];
12856 0         0 my $_noactions = $_[3];
12857 0 0       0 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  0         0  
  0         0  
12858 0         0 my $_itempos = $_[5];
12859 0 0       0 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
12860 0         0 my $text;
12861             my $lastsep;
12862 0         0 my $current_match;
12863 0         0 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/[^=\\s]+/});
12864 0         0 $expectation->at($_[1]);
12865            
12866 0         0 my $thisoffset;
12867 0         0 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
12868            
12869 0         0 my $thiscolumn;
12870 0         0 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
12871            
12872 0         0 my $thisline;
12873 0         0 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
12874              
12875            
12876              
12877 0   0     0 while (!$_matched && !$commit)
12878             {
12879            
12880 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/[^=\\s]+/ '=' exp]},
12881             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
12882             q{param},
12883             $tracelevel)
12884             if defined $::RD_TRACE;
12885 0         0 my $thisprod = $thisrule->{"prods"}[0];
12886 0         0 $text = $_[1];
12887 0         0 my $_savetext;
12888 0         0 @item = (q{param});
12889 0         0 %item = (__RULE__ => q{param});
12890 0         0 my $repcount = 0;
12891              
12892              
12893 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/[^=\\s]+/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
12894             q{param},
12895             $tracelevel)
12896             if defined $::RD_TRACE;
12897 0         0 undef $lastsep;
12898 0         0 $expectation->is(q{})->at($text);
12899            
12900              
12901 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:[^=\s]+)/)
  0 0       0  
12902             {
12903 0 0       0 $text = $lastsep . $text if defined $lastsep;
12904 0         0 $expectation->failed();
12905 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12906             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12907             if defined $::RD_TRACE;
12908              
12909 0         0 last;
12910             }
12911 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
12912 0         0 substr($text,0,length($current_match),q{});
12913 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
12914             . $current_match . q{])},
12915             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12916             if defined $::RD_TRACE;
12917 0         0 push @item, $item{__PATTERN1__}=$current_match;
12918            
12919              
12920 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: ['=']},
12921             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12922             q{param},
12923             $tracelevel)
12924             if defined $::RD_TRACE;
12925 0         0 undef $lastsep;
12926 0         0 $expectation->is(q{'='})->at($text);
12927            
12928              
12929 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A\=/)
  0 0       0  
12930             {
12931 0 0       0 $text = $lastsep . $text if defined $lastsep;
12932            
12933 0         0 $expectation->failed();
12934 0 0       0 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
12935             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12936             if defined $::RD_TRACE;
12937 0         0 last;
12938             }
12939 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
12940 0         0 substr($text,0,length($current_match),q{});
12941 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
12942             . $current_match . q{])},
12943             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12944             if defined $::RD_TRACE;
12945 0         0 push @item, $item{__STRING1__}=$current_match;
12946            
12947              
12948 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
12949             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12950             q{param},
12951             $tracelevel)
12952             if defined $::RD_TRACE;
12953 8     8   71 if (1) { no strict qw{refs};
  8         29  
  8         4719  
  0         0  
12954 0         0 $expectation->is(q{exp})->at($text);
12955 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
12956             {
12957            
12958 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
12959             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12960             q{param},
12961             $tracelevel)
12962             if defined $::RD_TRACE;
12963 0         0 $expectation->failed();
12964 0         0 last;
12965             }
12966 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
12967             . $_tok . q{]},
12968              
12969             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12970             q{param},
12971             $tracelevel)
12972             if defined $::RD_TRACE;
12973 0         0 $item{q{exp}} = $_tok;
12974 0         0 push @item, $_tok;
12975            
12976             }
12977              
12978 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
12979             XML::XSH2::Parser::_Runtime::_tracefirst($text),
12980             q{param},
12981             $tracelevel)
12982             if defined $::RD_TRACE;
12983            
12984              
12985 0 0       0 $_tok = ($_noactions) ? 0 : do { [$item[1],$item[3]] };
  0         0  
12986 0 0       0 unless (defined $_tok)
12987             {
12988 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
12989             if defined $::RD_TRACE;
12990 0         0 last;
12991             }
12992 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
12993             . $_tok . q{])},
12994             XML::XSH2::Parser::_Runtime::_tracefirst($text))
12995             if defined $::RD_TRACE;
12996 0         0 push @item, $_tok;
12997 0         0 $item{__ACTION1__}=$_tok;
12998            
12999              
13000 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/[^=\\s]+/ '=' exp]<<},
13001             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13002             q{param},
13003             $tracelevel)
13004             if defined $::RD_TRACE;
13005              
13006              
13007              
13008 0         0 $_matched = 1;
13009 0         0 last;
13010             }
13011              
13012              
13013 0 0 0     0 unless ( $_matched || defined($score) )
13014             {
13015            
13016              
13017 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
13018 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
13019             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13020             q{param},
13021             $tracelevel)
13022             if defined $::RD_TRACE;
13023 0         0 return undef;
13024             }
13025 0 0 0     0 if (!defined($return) && defined($score))
13026             {
13027 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
13028             q{param},
13029             $tracelevel)
13030             if defined $::RD_TRACE;
13031 0         0 $return = $score_return;
13032             }
13033 0         0 splice @{$thisparser->{errors}}, $err_at;
  0         0  
13034 0 0       0 $return = $item[$#item] unless defined $return;
13035 0 0       0 if (defined $::RD_TRACE)
13036             {
13037 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
13038             $return . q{])}, "",
13039             q{param},
13040             $tracelevel);
13041 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
13042             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
13043             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13044             , q{param},
13045             $tracelevel)
13046             }
13047 0         0 $_[1] = $text;
13048 0         0 return $return;
13049             }
13050              
13051             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
13052             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::perl_block
13053             {
13054 118     118   244 my $thisparser = $_[0];
13055 8     8   65 use vars q{$tracelevel};
  8         26  
  8         11553  
13056 118   50     344 local $tracelevel = ($tracelevel||0)+1;
13057 118         188 $ERRORS = 0;
13058 118         284 my $thisrule = $thisparser->{"rules"}{"perl_block"};
13059              
13060 118 50       279 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [perl_block]},
13061             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13062             q{perl_block},
13063             $tracelevel)
13064             if defined $::RD_TRACE;
13065              
13066            
13067 118         187 my $err_at = @{$thisparser->{errors}};
  118         239  
13068              
13069 118         343 my $score;
13070             my $score_return;
13071 118         0 my $_tok;
13072 118         184 my $return = undef;
13073 118         193 my $_matched=0;
13074 118         158 my $commit=0;
13075 118         227 my @item = ();
13076 118         206 my %item = ();
13077 118         160 my $repeating = $_[2];
13078 118         183 my $_noactions = $_[3];
13079 118 50       297 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  118         173  
  118         232  
13080 118         216 my $_itempos = $_[5];
13081 118 50       301 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
13082 118         286 my $text;
13083             my $lastsep;
13084 118         0 my $current_match;
13085 118         271 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{});
13086 118         365 $expectation->at($_[1]);
13087            
13088 118         168 my $thisoffset;
13089 118         385 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
13090            
13091 118         208 my $thiscolumn;
13092 118         319 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
13093            
13094 118         184 my $thisline;
13095 118         294 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
13096              
13097            
13098              
13099 118   33     602 while (!$_matched && !$commit)
13100             {
13101            
13102 118 50       266 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: []},
13103             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13104             q{perl_block},
13105             $tracelevel)
13106             if defined $::RD_TRACE;
13107 118         301 my $thisprod = $thisrule->{"prods"}[0];
13108 118         259 $text = $_[1];
13109 118         201 my $_savetext;
13110 118         252 @item = (q{perl_block});
13111 118         257 %item = (__RULE__ => q{perl_block});
13112 118         181 my $repcount = 0;
13113              
13114              
13115 118 50       295 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
13116             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13117             q{perl_block},
13118             $tracelevel)
13119             if defined $::RD_TRACE;
13120            
13121              
13122 118 50       262 $_tok = ($_noactions) ? 0 : do { $main::myline = $thisline; };
  118         367  
13123 118 50       339 unless (defined $_tok)
13124             {
13125 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
13126             if defined $::RD_TRACE;
13127 0         0 last;
13128             }
13129 118 50       270 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
13130             . $_tok . q{])},
13131             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13132             if defined $::RD_TRACE;
13133 118         371 push @item, $_tok;
13134 118         256 $item{__ACTION1__}=$_tok;
13135            
13136              
13137 118 50       271 XML::XSH2::Parser::_Runtime::_trace(q{>>Rejecting production<< (found )},
13138             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13139             q{perl_block},
13140             $tracelevel)
13141             if defined $::RD_TRACE;
13142 118         199 undef $return;
13143            
13144              
13145 118         159 $_tok = undef;
13146            
13147 118 50       321 last unless defined $_tok;
13148              
13149 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: []<<},
13150             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13151             q{perl_block},
13152             $tracelevel)
13153             if defined $::RD_TRACE;
13154              
13155              
13156              
13157 0         0 $_matched = 1;
13158 0         0 last;
13159             }
13160              
13161              
13162 118   33     516 while (!$_matched && !$commit)
13163             {
13164            
13165 118 50       257 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: []},
13166             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13167             q{perl_block},
13168             $tracelevel)
13169             if defined $::RD_TRACE;
13170 118         223 my $thisprod = $thisrule->{"prods"}[1];
13171 118         239 $text = $_[1];
13172 118         173 my $_savetext;
13173 118         278 @item = (q{perl_block});
13174 118         296 %item = (__RULE__ => q{perl_block});
13175 118         192 my $repcount = 0;
13176              
13177              
13178 118 50       274 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
13179             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13180             q{perl_block},
13181             $tracelevel)
13182             if defined $::RD_TRACE;
13183            
13184              
13185 118 50       247 $_tok = ($_noactions) ? 0 : do { $main::myline = $thisline; };
  118         262  
13186 118 50       301 unless (defined $_tok)
13187             {
13188 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
13189             if defined $::RD_TRACE;
13190 0         0 last;
13191             }
13192 118 50       305 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
13193             . $_tok . q{])},
13194             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13195             if defined $::RD_TRACE;
13196 118         214 push @item, $_tok;
13197 118         225 $item{__ACTION1__}=$_tok;
13198            
13199              
13200 118 50       239 XML::XSH2::Parser::_Runtime::_trace(q{>>Rejecting production<< (found )},
13201             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13202             q{perl_block},
13203             $tracelevel)
13204             if defined $::RD_TRACE;
13205 118         175 undef $return;
13206            
13207              
13208 118         204 $_tok = undef;
13209            
13210 118 50       273 last unless defined $_tok;
13211              
13212 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: []<<},
13213             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13214             q{perl_block},
13215             $tracelevel)
13216             if defined $::RD_TRACE;
13217              
13218              
13219              
13220 0         0 $_matched = 1;
13221 0         0 last;
13222             }
13223              
13224              
13225 118   33     486 while (!$_matched && !$commit)
13226             {
13227            
13228 118 50       275 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: []},
13229             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13230             q{perl_block},
13231             $tracelevel)
13232             if defined $::RD_TRACE;
13233 118         211 my $thisprod = $thisrule->{"prods"}[2];
13234 118         222 $text = $_[1];
13235 118         173 my $_savetext;
13236 118         269 @item = (q{perl_block});
13237 118         256 %item = (__RULE__ => q{perl_block});
13238 118         223 my $repcount = 0;
13239              
13240              
13241            
13242              
13243 118 50       331 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
13244             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13245             q{perl_block},
13246             $tracelevel)
13247             if defined $::RD_TRACE;
13248 118         173 $_tok = do { Text::Balanced::extract_codeblock($text,undef,$skip,'{}');
  118         517  
13249             };
13250 118 50       91996 if (defined($_tok))
13251             {
13252 118 50       370 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
13253             . $_tok . q{])},
13254             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13255             if defined $::RD_TRACE;
13256             }
13257             else
13258             {
13259 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
13260             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13261             if defined $::RD_TRACE;
13262             }
13263            
13264 118 50       308 last unless defined $_tok;
13265 118         377 push @item, $item{__DIRECTIVE1__}=$_tok;
13266            
13267              
13268 118 50       287 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
13269             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13270             q{perl_block},
13271             $tracelevel)
13272             if defined $::RD_TRACE;
13273            
13274              
13275 118 50       310 $_tok = ($_noactions) ? 0 : do { {
13276 118         168 $return=$item[1];
  118         207  
13277             {
13278 118         168 local $^W = 0; # don't warn about undefined contants
  118         615  
13279 118         343 my $pos="# line $main::myline \"$XML::XSH2::Functions::SCRIPT\"\n";
13280 118         962 $return=~s/^\{/\{\n$pos/;
13281             }
13282             } };
13283 118 50       347 unless (defined $_tok)
13284             {
13285 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
13286             if defined $::RD_TRACE;
13287 0         0 last;
13288             }
13289 118 50       322 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
13290             . $_tok . q{])},
13291             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13292             if defined $::RD_TRACE;
13293 118         223 push @item, $_tok;
13294 118         264 $item{__ACTION1__}=$_tok;
13295            
13296              
13297 118 50       256 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: []<<},
13298             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13299             q{perl_block},
13300             $tracelevel)
13301             if defined $::RD_TRACE;
13302              
13303              
13304              
13305 118         178 $_matched = 1;
13306 118         203 last;
13307             }
13308              
13309              
13310 118 50 33     328 unless ( $_matched || defined($score) )
13311             {
13312            
13313              
13314 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
13315 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
13316             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13317             q{perl_block},
13318             $tracelevel)
13319             if defined $::RD_TRACE;
13320 0         0 return undef;
13321             }
13322 118 50 33     389 if (!defined($return) && defined($score))
13323             {
13324 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
13325             q{perl_block},
13326             $tracelevel)
13327             if defined $::RD_TRACE;
13328 0         0 $return = $score_return;
13329             }
13330 118         171 splice @{$thisparser->{errors}}, $err_at;
  118         328  
13331 118 50       304 $return = $item[$#item] unless defined $return;
13332 118 50       316 if (defined $::RD_TRACE)
13333             {
13334 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
13335             $return . q{])}, "",
13336             q{perl_block},
13337             $tracelevel);
13338 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
13339             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
13340             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13341             , q{perl_block},
13342             $tracelevel)
13343             }
13344 118         324 $_[1] = $text;
13345 118         1079 return $return;
13346             }
13347              
13348             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
13349             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::perl_expression
13350             {
13351 0     0   0 my $thisparser = $_[0];
13352 8     8   71 use vars q{$tracelevel};
  8         19  
  8         5173  
13353 0   0     0 local $tracelevel = ($tracelevel||0)+1;
13354 0         0 $ERRORS = 0;
13355 0         0 my $thisrule = $thisparser->{"rules"}{"perl_expression"};
13356              
13357 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [perl_expression]},
13358             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13359             q{perl_expression},
13360             $tracelevel)
13361             if defined $::RD_TRACE;
13362              
13363            
13364 0         0 my $err_at = @{$thisparser->{errors}};
  0         0  
13365              
13366 0         0 my $score;
13367             my $score_return;
13368 0         0 my $_tok;
13369 0         0 my $return = undef;
13370 0         0 my $_matched=0;
13371 0         0 my $commit=0;
13372 0         0 my @item = ();
13373 0         0 my %item = ();
13374 0         0 my $repeating = $_[2];
13375 0         0 my $_noactions = $_[3];
13376 0 0       0 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  0         0  
  0         0  
13377 0         0 my $_itempos = $_[5];
13378 0 0       0 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
13379 0         0 my $text;
13380             my $lastsep;
13381 0         0 my $current_match;
13382 0         0 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{exp});
13383 0         0 $expectation->at($_[1]);
13384            
13385 0         0 my $thisoffset;
13386 0         0 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
13387            
13388 0         0 my $thiscolumn;
13389 0         0 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
13390            
13391 0         0 my $thisline;
13392 0         0 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
13393              
13394            
13395              
13396 0   0     0 while (!$_matched && !$commit)
13397             {
13398            
13399 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: []},
13400             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13401             q{perl_expression},
13402             $tracelevel)
13403             if defined $::RD_TRACE;
13404 0         0 my $thisprod = $thisrule->{"prods"}[0];
13405 0         0 $text = $_[1];
13406 0         0 my $_savetext;
13407 0         0 @item = (q{perl_expression});
13408 0         0 %item = (__RULE__ => q{perl_expression});
13409 0         0 my $repcount = 0;
13410              
13411              
13412 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
13413             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13414             q{perl_expression},
13415             $tracelevel)
13416             if defined $::RD_TRACE;
13417            
13418              
13419 0 0       0 $_tok = ($_noactions) ? 0 : do { $main::myline = $thisline; };
  0         0  
13420 0 0       0 unless (defined $_tok)
13421             {
13422 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
13423             if defined $::RD_TRACE;
13424 0         0 last;
13425             }
13426 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
13427             . $_tok . q{])},
13428             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13429             if defined $::RD_TRACE;
13430 0         0 push @item, $_tok;
13431 0         0 $item{__ACTION1__}=$_tok;
13432            
13433              
13434 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Rejecting production<< (found )},
13435             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13436             q{perl_expression},
13437             $tracelevel)
13438             if defined $::RD_TRACE;
13439 0         0 undef $return;
13440            
13441              
13442 0         0 $_tok = undef;
13443            
13444 0 0       0 last unless defined $_tok;
13445              
13446 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: []<<},
13447             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13448             q{perl_expression},
13449             $tracelevel)
13450             if defined $::RD_TRACE;
13451              
13452              
13453              
13454 0         0 $_matched = 1;
13455 0         0 last;
13456             }
13457              
13458              
13459 0   0     0 while (!$_matched && !$commit)
13460             {
13461            
13462 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [exp]},
13463             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13464             q{perl_expression},
13465             $tracelevel)
13466             if defined $::RD_TRACE;
13467 0         0 my $thisprod = $thisrule->{"prods"}[1];
13468 0         0 $text = $_[1];
13469 0         0 my $_savetext;
13470 0         0 @item = (q{perl_expression});
13471 0         0 %item = (__RULE__ => q{perl_expression});
13472 0         0 my $repcount = 0;
13473              
13474              
13475 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
13476             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13477             q{perl_expression},
13478             $tracelevel)
13479             if defined $::RD_TRACE;
13480 8     8   64 if (1) { no strict qw{refs};
  8         21  
  8         4979  
  0         0  
13481 0         0 $expectation->is(q{})->at($text);
13482 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
13483             {
13484            
13485 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
13486             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13487             q{perl_expression},
13488             $tracelevel)
13489             if defined $::RD_TRACE;
13490 0         0 $expectation->failed();
13491 0         0 last;
13492             }
13493 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
13494             . $_tok . q{]},
13495              
13496             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13497             q{perl_expression},
13498             $tracelevel)
13499             if defined $::RD_TRACE;
13500 0         0 $item{q{exp}} = $_tok;
13501 0         0 push @item, $_tok;
13502            
13503             }
13504              
13505 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
13506             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13507             q{perl_expression},
13508             $tracelevel)
13509             if defined $::RD_TRACE;
13510            
13511              
13512 0 0       0 $_tok = ($_noactions) ? 0 : do { {local $^W=0; "\n# line $main::myline \"$XML::XSH2::Functions::SCRIPT\"\n".$item[1]} };
  0         0  
  0         0  
  0         0  
13513 0 0       0 unless (defined $_tok)
13514             {
13515 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
13516             if defined $::RD_TRACE;
13517 0         0 last;
13518             }
13519 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
13520             . $_tok . q{])},
13521             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13522             if defined $::RD_TRACE;
13523 0         0 push @item, $_tok;
13524 0         0 $item{__ACTION1__}=$_tok;
13525            
13526              
13527 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [exp]<<},
13528             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13529             q{perl_expression},
13530             $tracelevel)
13531             if defined $::RD_TRACE;
13532              
13533              
13534              
13535 0         0 $_matched = 1;
13536 0         0 last;
13537             }
13538              
13539              
13540 0 0 0     0 unless ( $_matched || defined($score) )
13541             {
13542            
13543              
13544 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
13545 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
13546             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13547             q{perl_expression},
13548             $tracelevel)
13549             if defined $::RD_TRACE;
13550 0         0 return undef;
13551             }
13552 0 0 0     0 if (!defined($return) && defined($score))
13553             {
13554 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
13555             q{perl_expression},
13556             $tracelevel)
13557             if defined $::RD_TRACE;
13558 0         0 $return = $score_return;
13559             }
13560 0         0 splice @{$thisparser->{errors}}, $err_at;
  0         0  
13561 0 0       0 $return = $item[$#item] unless defined $return;
13562 0 0       0 if (defined $::RD_TRACE)
13563             {
13564 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
13565             $return . q{])}, "",
13566             q{perl_expression},
13567             $tracelevel);
13568 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
13569             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
13570             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13571             , q{perl_expression},
13572             $tracelevel)
13573             }
13574 0         0 $_[1] = $text;
13575 0         0 return $return;
13576             }
13577              
13578             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
13579             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::shell
13580             {
13581 574     574   1266 my $thisparser = $_[0];
13582 8     8   78 use vars q{$tracelevel};
  8         17  
  8         13029  
13583 574   50     1762 local $tracelevel = ($tracelevel||0)+1;
13584 574         980 $ERRORS = 0;
13585 574         1409 my $thisrule = $thisparser->{"rules"}{"shell"};
13586              
13587 574 50       1465 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [shell]},
13588             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13589             q{shell},
13590             $tracelevel)
13591             if defined $::RD_TRACE;
13592              
13593            
13594 574         903 my $err_at = @{$thisparser->{errors}};
  574         1333  
13595              
13596 574         1597 my $score;
13597             my $score_return;
13598 574         0 my $_tok;
13599 574         914 my $return = undef;
13600 574         914 my $_matched=0;
13601 574         936 my $commit=0;
13602 574         1073 my @item = ();
13603 574         984 my %item = ();
13604 574         907 my $repeating = $_[2];
13605 574         914 my $_noactions = $_[3];
13606 574 50       1408 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  574         895  
  574         1140  
13607 574         1007 my $_itempos = $_[5];
13608 574 50       1508 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
13609 574         1637 my $text;
13610             my $lastsep;
13611 574         0 my $current_match;
13612 574         1237 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/!\\s*/});
13613 574         1639 $expectation->at($_[1]);
13614            
13615 574         942 my $thisoffset;
13616 574         1621 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
13617            
13618 574         1019 my $thiscolumn;
13619 574         1528 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
13620            
13621 574         931 my $thisline;
13622 574         1393 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
13623              
13624            
13625              
13626 574   33     2903 while (!$_matched && !$commit)
13627             {
13628            
13629 574 50       1461 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/!\\s*/ /.*/]},
13630             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13631             q{shell},
13632             $tracelevel)
13633             if defined $::RD_TRACE;
13634 574         1286 my $thisprod = $thisrule->{"prods"}[0];
13635 574         1286 $text = $_[1];
13636 574         875 my $_savetext;
13637 574         1295 @item = (q{shell});
13638 574         1410 %item = (__RULE__ => q{shell});
13639 574         914 my $repcount = 0;
13640              
13641              
13642 574 50       1420 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/!\\s*/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
13643             q{shell},
13644             $tracelevel)
13645             if defined $::RD_TRACE;
13646 574         1134 undef $lastsep;
13647 574         1335 $expectation->is(q{})->at($text);
13648            
13649              
13650 574 100 66     5790 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:!\s*)/)
  574 100       5709  
13651             {
13652 573 50       2236 $text = $lastsep . $text if defined $lastsep;
13653 573         1896 $expectation->failed();
13654 573 50       1495 XML::XSH2::Parser::_Runtime::_trace(q{<>},
13655             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13656             if defined $::RD_TRACE;
13657              
13658 573         1460 last;
13659             }
13660 1         36 $current_match = substr($text, $-[0], $+[0] - $-[0]);
13661 1         39 substr($text,0,length($current_match),q{});
13662 1 50       25 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
13663             . $current_match . q{])},
13664             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13665             if defined $::RD_TRACE;
13666 1         16 push @item, $item{__PATTERN1__}=$current_match;
13667            
13668              
13669            
13670              
13671 1 50       17 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
13672             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13673             q{shell},
13674             $tracelevel)
13675             if defined $::RD_TRACE;
13676 1         9 $_tok = do { $commit = 1 };
  1         8  
13677 1 50       18 if (defined($_tok))
13678             {
13679 1 50       21 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
13680             . $_tok . q{])},
13681             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13682             if defined $::RD_TRACE;
13683             }
13684             else
13685             {
13686 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
13687             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13688             if defined $::RD_TRACE;
13689             }
13690            
13691 1 50       16 last unless defined $_tok;
13692 1         18 push @item, $item{__DIRECTIVE1__}=$_tok;
13693            
13694              
13695 1 50       18 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/.*/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
13696             q{shell},
13697             $tracelevel)
13698             if defined $::RD_TRACE;
13699 1         7 undef $lastsep;
13700 1         13 $expectation->is(q{/.*/})->at($text);
13701            
13702              
13703 1 50 33     103 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:.*)/)
  1 50       49  
13704             {
13705 0 0       0 $text = $lastsep . $text if defined $lastsep;
13706 0         0 $expectation->failed();
13707 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
13708             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13709             if defined $::RD_TRACE;
13710              
13711 0         0 last;
13712             }
13713 1         27 $current_match = substr($text, $-[0], $+[0] - $-[0]);
13714 1         10 substr($text,0,length($current_match),q{});
13715 1 50       17 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
13716             . $current_match . q{])},
13717             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13718             if defined $::RD_TRACE;
13719 1         12 push @item, $item{__PATTERN2__}=$current_match;
13720            
13721              
13722 1 50       15 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
13723             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13724             q{shell},
13725             $tracelevel)
13726             if defined $::RD_TRACE;
13727            
13728              
13729 1 50       18 $_tok = ($_noactions) ? 0 : do { [[$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'sh_noev',$item[3]]] };
  1         12  
13730 1 50       12 unless (defined $_tok)
13731             {
13732 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
13733             if defined $::RD_TRACE;
13734 0         0 last;
13735             }
13736 1 50       12 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
13737             . $_tok . q{])},
13738             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13739             if defined $::RD_TRACE;
13740 1         4 push @item, $_tok;
13741 1         7 $item{__ACTION1__}=$_tok;
13742            
13743              
13744 1 50       14 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/!\\s*/ /.*/]<<},
13745             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13746             q{shell},
13747             $tracelevel)
13748             if defined $::RD_TRACE;
13749              
13750              
13751              
13752 1         3 $_matched = 1;
13753 1         8 last;
13754             }
13755              
13756              
13757 574         1721 while (!$_matched)
13758             {
13759            
13760 573 50       1446 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [ ]},
13761             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13762             q{shell},
13763             $tracelevel)
13764             if defined $::RD_TRACE;
13765 573         1138 my $thisprod = $thisrule->{"prods"}[1];
13766            
13767 573         794 my $_savetext;
13768 573         1433 @item = (q{shell});
13769 573         1483 %item = (__RULE__ => q{shell});
13770 573         969 my $repcount = 0;
13771              
13772              
13773            
13774              
13775 573 50       1326 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
13776             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13777             q{shell},
13778             $tracelevel)
13779             if defined $::RD_TRACE;
13780 573 0       804 $_tok = do { if ($commit) { do {push @{$thisparser->{errors}}, [qq{Parse error near: "! }.substr($text,0,40).qq{ ..."},$thisline];} unless $_noactions; undef } else {0} };
  573 50       1463  
  0         0  
  0         0  
  0         0  
  0         0  
  573         1040  
13781 573 50       1274 if (defined($_tok))
13782             {
13783 573 50       1277 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
13784             . $_tok . q{])},
13785             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13786             if defined $::RD_TRACE;
13787             }
13788             else
13789             {
13790 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
13791             XML::XSH2::Parser::_Runtime::_tracefirst($text))
13792             if defined $::RD_TRACE;
13793             }
13794            
13795 573 50       1469 last unless defined $_tok;
13796 573         1503 push @item, $item{__DIRECTIVE1__}=$_tok;
13797            
13798              
13799 573 50       1270 XML::XSH2::Parser::_Runtime::_trace(q{>>Rejecting production<< (found )},
13800             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13801             q{shell},
13802             $tracelevel)
13803             if defined $::RD_TRACE;
13804 573         872 undef $return;
13805            
13806              
13807 573         891 $_tok = undef;
13808            
13809 573 50       1461 last unless defined $_tok;
13810              
13811 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [ ]<<},
13812             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13813             q{shell},
13814             $tracelevel)
13815             if defined $::RD_TRACE;
13816              
13817              
13818              
13819 0         0 $_matched = 1;
13820 0         0 last;
13821             }
13822              
13823              
13824 574 100 66     2429 unless ( $_matched || defined($score) )
13825             {
13826            
13827              
13828 573         1032 $_[1] = $text; # NOT SURE THIS IS NEEDED
13829 573 50       1391 XML::XSH2::Parser::_Runtime::_trace(q{<>},
13830             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13831             q{shell},
13832             $tracelevel)
13833             if defined $::RD_TRACE;
13834 573         4329 return undef;
13835             }
13836 1 50 33     25 if (!defined($return) && defined($score))
13837             {
13838 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
13839             q{shell},
13840             $tracelevel)
13841             if defined $::RD_TRACE;
13842 0         0 $return = $score_return;
13843             }
13844 1         3 splice @{$thisparser->{errors}}, $err_at;
  1         4  
13845 1 50       9 $return = $item[$#item] unless defined $return;
13846 1 50       4 if (defined $::RD_TRACE)
13847             {
13848 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
13849             $return . q{])}, "",
13850             q{shell},
13851             $tracelevel);
13852 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
13853             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
13854             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13855             , q{shell},
13856             $tracelevel)
13857             }
13858 1         12 $_[1] = $text;
13859 1         18 return $return;
13860             }
13861              
13862             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
13863             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::shline
13864             {
13865 20     20   46 my $thisparser = $_[0];
13866 8     8   109 use vars q{$tracelevel};
  8         20  
  8         3194  
13867 20   50     78 local $tracelevel = ($tracelevel||0)+1;
13868 20         29 $ERRORS = 0;
13869 20         55 my $thisrule = $thisparser->{"rules"}{"shline"};
13870              
13871 20 50       59 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [shline]},
13872             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13873             q{shline},
13874             $tracelevel)
13875             if defined $::RD_TRACE;
13876              
13877            
13878 20         27 my $err_at = @{$thisparser->{errors}};
  20         51  
13879              
13880 20         55 my $score;
13881             my $score_return;
13882 20         0 my $_tok;
13883 20         30 my $return = undef;
13884 20         67 my $_matched=0;
13885 20         36 my $commit=0;
13886 20         42 my @item = ();
13887 20         38 my %item = ();
13888 20         31 my $repeating = $_[2];
13889 20         80 my $_noactions = $_[3];
13890 20 50       54 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  20         28  
  20         44  
13891 20         35 my $_itempos = $_[5];
13892 20 50       60 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
13893 20         63 my $text;
13894             my $lastsep;
13895 20         0 my $current_match;
13896 20         64 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{shline_nosc});
13897 20         59 $expectation->at($_[1]);
13898            
13899 20         23 my $thisoffset;
13900 20         74 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
13901            
13902 20         36 my $thiscolumn;
13903 20         55 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
13904            
13905 20         81 my $thisline;
13906 20         78 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
13907              
13908            
13909              
13910 20   33     167 while (!$_matched && !$commit)
13911             {
13912            
13913 20 50       56 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [shline_nosc shline_bracket shline_nosc]},
13914             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
13915             q{shline},
13916             $tracelevel)
13917             if defined $::RD_TRACE;
13918 20         62 my $thisprod = $thisrule->{"prods"}[0];
13919 20         45 $text = $_[1];
13920 20         28 my $_savetext;
13921 20         71 @item = (q{shline});
13922 20         94 %item = (__RULE__ => q{shline});
13923 20         49 my $repcount = 0;
13924              
13925              
13926 20 50       59 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [shline_nosc]},
13927             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13928             q{shline},
13929             $tracelevel)
13930             if defined $::RD_TRACE;
13931 8     8   62 if (1) { no strict qw{refs};
  8         18  
  8         2824  
  20         35  
13932 20         62 $expectation->is(q{})->at($text);
13933 20 50   20   185 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::shline_nosc($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  20         41  
13934             {
13935            
13936 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
13937             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13938             q{shline},
13939             $tracelevel)
13940             if defined $::RD_TRACE;
13941 0         0 $expectation->failed();
13942 0         0 last;
13943             }
13944 20 50       81 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [shline_nosc]<< (return value: [}
13945             . $_tok . q{]},
13946              
13947             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13948             q{shline},
13949             $tracelevel)
13950             if defined $::RD_TRACE;
13951 20         57 $item{q{shline_nosc}} = $_tok;
13952 20         42 push @item, $_tok;
13953            
13954             }
13955              
13956 20 50       57 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [shline_bracket]},
13957             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13958             q{shline},
13959             $tracelevel)
13960             if defined $::RD_TRACE;
13961 20         53 $expectation->is(q{shline_bracket})->at($text);
13962            
13963 20 50   20   177 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::shline_bracket, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  20         45  
13964             {
13965 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
13966             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13967             q{shline},
13968             $tracelevel)
13969             if defined $::RD_TRACE;
13970 0         0 last;
13971             }
13972 20 50       83 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [shline_bracket]<< (}
13973             . @$_tok . q{ times)},
13974              
13975             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13976             q{shline},
13977             $tracelevel)
13978             if defined $::RD_TRACE;
13979 20         99 $item{q{shline_bracket(?)}} = $_tok;
13980 20         47 push @item, $_tok;
13981            
13982              
13983              
13984 20 50       47 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [shline_nosc]},
13985             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13986             q{shline},
13987             $tracelevel)
13988             if defined $::RD_TRACE;
13989 8     8   67 if (1) { no strict qw{refs};
  8         20  
  8         4674  
  20         37  
13990 20         56 $expectation->is(q{shline_nosc})->at($text);
13991 20 50   20   142 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::shline_nosc($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  20         36  
13992             {
13993            
13994 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
13995             XML::XSH2::Parser::_Runtime::_tracefirst($text),
13996             q{shline},
13997             $tracelevel)
13998             if defined $::RD_TRACE;
13999 0         0 $expectation->failed();
14000 0         0 last;
14001             }
14002 20 50       80 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [shline_nosc]<< (return value: [}
14003             . $_tok . q{]},
14004              
14005             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14006             q{shline},
14007             $tracelevel)
14008             if defined $::RD_TRACE;
14009 20         40 $item{q{shline_nosc}} = $_tok;
14010 20         42 push @item, $_tok;
14011            
14012             }
14013              
14014 20 50       57 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
14015             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14016             q{shline},
14017             $tracelevel)
14018             if defined $::RD_TRACE;
14019            
14020              
14021 20 50       49 $_tok = ($_noactions) ? 0 : do { join("",$item[1],@{$item[2]},$item[3]) };
  20         56  
  20         60  
14022 20 50       55 unless (defined $_tok)
14023             {
14024 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
14025             if defined $::RD_TRACE;
14026 0         0 last;
14027             }
14028 20 50       54 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
14029             . $_tok . q{])},
14030             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14031             if defined $::RD_TRACE;
14032 20         38 push @item, $_tok;
14033 20         52 $item{__ACTION1__}=$_tok;
14034            
14035              
14036 20 50       107 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [shline_nosc shline_bracket shline_nosc]<<},
14037             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14038             q{shline},
14039             $tracelevel)
14040             if defined $::RD_TRACE;
14041              
14042              
14043              
14044 20         41 $_matched = 1;
14045 20         40 last;
14046             }
14047              
14048              
14049 20 50 33     83 unless ( $_matched || defined($score) )
14050             {
14051            
14052              
14053 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
14054 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14055             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14056             q{shline},
14057             $tracelevel)
14058             if defined $::RD_TRACE;
14059 0         0 return undef;
14060             }
14061 20 50 33     170 if (!defined($return) && defined($score))
14062             {
14063 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
14064             q{shline},
14065             $tracelevel)
14066             if defined $::RD_TRACE;
14067 0         0 $return = $score_return;
14068             }
14069 20         42 splice @{$thisparser->{errors}}, $err_at;
  20         59  
14070 20 50       71 $return = $item[$#item] unless defined $return;
14071 20 50       65 if (defined $::RD_TRACE)
14072             {
14073 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
14074             $return . q{])}, "",
14075             q{shline},
14076             $tracelevel);
14077 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
14078             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
14079             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14080             , q{shline},
14081             $tracelevel)
14082             }
14083 20         48 $_[1] = $text;
14084 20         156 return $return;
14085             }
14086              
14087             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
14088             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::shline_bracket
14089             {
14090 20     20   41 my $thisparser = $_[0];
14091 8     8   66 use vars q{$tracelevel};
  8         17  
  8         4872  
14092 20   50     77 local $tracelevel = ($tracelevel||0)+1;
14093 20         38 $ERRORS = 0;
14094 20         52 my $thisrule = $thisparser->{"rules"}{"shline_bracket"};
14095              
14096 20 50       48 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [shline_bracket]},
14097             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14098             q{shline_bracket},
14099             $tracelevel)
14100             if defined $::RD_TRACE;
14101              
14102            
14103 20         35 my $err_at = @{$thisparser->{errors}};
  20         37  
14104              
14105 20         70 my $score;
14106             my $score_return;
14107 20         0 my $_tok;
14108 20         39 my $return = undef;
14109 20         26 my $_matched=0;
14110 20         41 my $commit=0;
14111 20         29 my @item = ();
14112 20         38 my %item = ();
14113 20         41 my $repeating = $_[2];
14114 20         94 my $_noactions = $_[3];
14115 20 50       69 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  20         29  
  20         44  
14116 20         37 my $_itempos = $_[5];
14117 20 50       70 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
14118 20         51 my $text;
14119             my $lastsep;
14120 20         0 my $current_match;
14121 20         49 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{'('});
14122 20         60 $expectation->at($_[1]);
14123            
14124 20         29 my $thisoffset;
14125 20         78 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
14126            
14127 20         34 my $thiscolumn;
14128 20         64 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
14129            
14130 20         40 my $thisline;
14131 20         66 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
14132              
14133            
14134              
14135 20   33     211 while (!$_matched && !$commit)
14136             {
14137            
14138 20 50       58 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: ['(' shline_inter shline_bracket shline_inter ')']},
14139             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14140             q{shline_bracket},
14141             $tracelevel)
14142             if defined $::RD_TRACE;
14143 20         62 my $thisprod = $thisrule->{"prods"}[0];
14144 20         50 $text = $_[1];
14145 20         28 my $_savetext;
14146 20         79 @item = (q{shline_bracket});
14147 20         106 %item = (__RULE__ => q{shline_bracket});
14148 20         42 my $repcount = 0;
14149              
14150              
14151 20 50       62 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: ['(']},
14152             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14153             q{shline_bracket},
14154             $tracelevel)
14155             if defined $::RD_TRACE;
14156 20         68 undef $lastsep;
14157 20         84 $expectation->is(q{})->at($text);
14158            
14159              
14160 20 50 33     315 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A\(/)
  20 50       261  
14161             {
14162 20 50       123 $text = $lastsep . $text if defined $lastsep;
14163            
14164 20         64 $expectation->failed();
14165 20 50       50 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
14166             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14167             if defined $::RD_TRACE;
14168 20         51 last;
14169             }
14170 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
14171 0         0 substr($text,0,length($current_match),q{});
14172 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
14173             . $current_match . q{])},
14174             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14175             if defined $::RD_TRACE;
14176 0         0 push @item, $item{__STRING1__}=$current_match;
14177            
14178              
14179 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [shline_inter]},
14180             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14181             q{shline_bracket},
14182             $tracelevel)
14183             if defined $::RD_TRACE;
14184 8     8   75 if (1) { no strict qw{refs};
  8         28  
  8         2807  
  0         0  
14185 0         0 $expectation->is(q{shline_inter})->at($text);
14186 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::shline_inter($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
14187             {
14188            
14189 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14190             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14191             q{shline_bracket},
14192             $tracelevel)
14193             if defined $::RD_TRACE;
14194 0         0 $expectation->failed();
14195 0         0 last;
14196             }
14197 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [shline_inter]<< (return value: [}
14198             . $_tok . q{]},
14199              
14200             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14201             q{shline_bracket},
14202             $tracelevel)
14203             if defined $::RD_TRACE;
14204 0         0 $item{q{shline_inter}} = $_tok;
14205 0         0 push @item, $_tok;
14206            
14207             }
14208              
14209 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [shline_bracket]},
14210             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14211             q{shline_bracket},
14212             $tracelevel)
14213             if defined $::RD_TRACE;
14214 0         0 $expectation->is(q{shline_bracket})->at($text);
14215            
14216 0 0   0   0 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::shline_bracket, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  0         0  
14217             {
14218 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14219             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14220             q{shline_bracket},
14221             $tracelevel)
14222             if defined $::RD_TRACE;
14223 0         0 last;
14224             }
14225 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [shline_bracket]<< (}
14226             . @$_tok . q{ times)},
14227              
14228             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14229             q{shline_bracket},
14230             $tracelevel)
14231             if defined $::RD_TRACE;
14232 0         0 $item{q{shline_bracket(?)}} = $_tok;
14233 0         0 push @item, $_tok;
14234            
14235              
14236              
14237 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [shline_inter]},
14238             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14239             q{shline_bracket},
14240             $tracelevel)
14241             if defined $::RD_TRACE;
14242 8     8   61 if (1) { no strict qw{refs};
  8         17  
  8         6247  
  0         0  
14243 0         0 $expectation->is(q{shline_inter})->at($text);
14244 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::shline_inter($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
14245             {
14246            
14247 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14248             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14249             q{shline_bracket},
14250             $tracelevel)
14251             if defined $::RD_TRACE;
14252 0         0 $expectation->failed();
14253 0         0 last;
14254             }
14255 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [shline_inter]<< (return value: [}
14256             . $_tok . q{]},
14257              
14258             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14259             q{shline_bracket},
14260             $tracelevel)
14261             if defined $::RD_TRACE;
14262 0         0 $item{q{shline_inter}} = $_tok;
14263 0         0 push @item, $_tok;
14264            
14265             }
14266              
14267 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [')']},
14268             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14269             q{shline_bracket},
14270             $tracelevel)
14271             if defined $::RD_TRACE;
14272 0         0 undef $lastsep;
14273 0         0 $expectation->is(q{')'})->at($text);
14274            
14275              
14276 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A\)/)
  0 0       0  
14277             {
14278 0 0       0 $text = $lastsep . $text if defined $lastsep;
14279            
14280 0         0 $expectation->failed();
14281 0 0       0 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
14282             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14283             if defined $::RD_TRACE;
14284 0         0 last;
14285             }
14286 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
14287 0         0 substr($text,0,length($current_match),q{});
14288 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
14289             . $current_match . q{])},
14290             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14291             if defined $::RD_TRACE;
14292 0         0 push @item, $item{__STRING2__}=$current_match;
14293            
14294              
14295 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
14296             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14297             q{shline_bracket},
14298             $tracelevel)
14299             if defined $::RD_TRACE;
14300            
14301              
14302 0 0       0 $_tok = ($_noactions) ? 0 : do { join("",'(',$item[2],@{$item[3]},$item[4],')') };
  0         0  
  0         0  
14303 0 0       0 unless (defined $_tok)
14304             {
14305 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
14306             if defined $::RD_TRACE;
14307 0         0 last;
14308             }
14309 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
14310             . $_tok . q{])},
14311             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14312             if defined $::RD_TRACE;
14313 0         0 push @item, $_tok;
14314 0         0 $item{__ACTION1__}=$_tok;
14315            
14316              
14317 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: ['(' shline_inter shline_bracket shline_inter ')']<<},
14318             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14319             q{shline_bracket},
14320             $tracelevel)
14321             if defined $::RD_TRACE;
14322              
14323              
14324              
14325 0         0 $_matched = 1;
14326 0         0 last;
14327             }
14328              
14329              
14330 20 50 33     141 unless ( $_matched || defined($score) )
14331             {
14332            
14333              
14334 20         52 $_[1] = $text; # NOT SURE THIS IS NEEDED
14335 20 50       47 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14336             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14337             q{shline_bracket},
14338             $tracelevel)
14339             if defined $::RD_TRACE;
14340 20         131 return undef;
14341             }
14342 0 0 0     0 if (!defined($return) && defined($score))
14343             {
14344 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
14345             q{shline_bracket},
14346             $tracelevel)
14347             if defined $::RD_TRACE;
14348 0         0 $return = $score_return;
14349             }
14350 0         0 splice @{$thisparser->{errors}}, $err_at;
  0         0  
14351 0 0       0 $return = $item[$#item] unless defined $return;
14352 0 0       0 if (defined $::RD_TRACE)
14353             {
14354 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
14355             $return . q{])}, "",
14356             q{shline_bracket},
14357             $tracelevel);
14358 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
14359             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
14360             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14361             , q{shline_bracket},
14362             $tracelevel)
14363             }
14364 0         0 $_[1] = $text;
14365 0         0 return $return;
14366             }
14367              
14368             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
14369             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::shline_inter
14370             {
14371 0     0   0 my $thisparser = $_[0];
14372 8     8   71 use vars q{$tracelevel};
  8         17  
  8         7160  
14373 0   0     0 local $tracelevel = ($tracelevel||0)+1;
14374 0         0 $ERRORS = 0;
14375 0         0 my $thisrule = $thisparser->{"rules"}{"shline_inter"};
14376              
14377 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [shline_inter]},
14378             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14379             q{shline_inter},
14380             $tracelevel)
14381             if defined $::RD_TRACE;
14382              
14383            
14384 0         0 my $err_at = @{$thisparser->{errors}};
  0         0  
14385              
14386 0         0 my $score;
14387             my $score_return;
14388 0         0 my $_tok;
14389 0         0 my $return = undef;
14390 0         0 my $_matched=0;
14391 0         0 my $commit=0;
14392 0         0 my @item = ();
14393 0         0 my %item = ();
14394 0         0 my $repeating = $_[2];
14395 0         0 my $_noactions = $_[3];
14396 0 0       0 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  0         0  
  0         0  
14397 0         0 my $_itempos = $_[5];
14398 0 0       0 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
14399 0         0 my $text;
14400             my $lastsep;
14401 0         0 my $current_match;
14402 0         0 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/([^()\\\\"']|\\\\.|\\"([^\\"\\\\]|\\\\.)*\\"|\\'([^\\'\\\\]|\\\\\\'|\\\\\\\\|\\\\[^\\'\\\\])*\\')*/});
14403 0         0 $expectation->at($_[1]);
14404            
14405 0         0 my $thisoffset;
14406 0         0 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
14407            
14408 0         0 my $thiscolumn;
14409 0         0 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
14410            
14411 0         0 my $thisline;
14412 0         0 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
14413              
14414            
14415              
14416 0   0     0 while (!$_matched && !$commit)
14417             {
14418            
14419 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/([^()\\\\"']|\\\\.|\\"([^\\"\\\\]|\\\\.)*\\"|\\'([^\\'\\\\]|\\\\\\'|\\\\\\\\|\\\\[^\\'\\\\])*\\')*/]},
14420             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14421             q{shline_inter},
14422             $tracelevel)
14423             if defined $::RD_TRACE;
14424 0         0 my $thisprod = $thisrule->{"prods"}[0];
14425 0         0 $text = $_[1];
14426 0         0 my $_savetext;
14427 0         0 @item = (q{shline_inter});
14428 0         0 %item = (__RULE__ => q{shline_inter});
14429 0         0 my $repcount = 0;
14430              
14431              
14432 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/([^()\\\\"']|\\\\.|\\"([^\\"\\\\]|\\\\.)*\\"|\\'([^\\'\\\\]|\\\\\\'|\\\\\\\\|\\\\[^\\'\\\\])*\\')*/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
14433             q{shline_inter},
14434             $tracelevel)
14435             if defined $::RD_TRACE;
14436 0         0 undef $lastsep;
14437 0         0 $expectation->is(q{})->at($text);
14438            
14439              
14440 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:([^()\\"']|\\.|\"([^\"\\]|\\.)*\"|\'([^\'\\]|\\\'|\\\\|\\[^\'\\])*\')*)/)
  0 0       0  
14441             {
14442 0 0       0 $text = $lastsep . $text if defined $lastsep;
14443 0         0 $expectation->failed();
14444 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14445             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14446             if defined $::RD_TRACE;
14447              
14448 0         0 last;
14449             }
14450 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
14451 0         0 substr($text,0,length($current_match),q{});
14452 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
14453             . $current_match . q{])},
14454             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14455             if defined $::RD_TRACE;
14456 0         0 push @item, $item{__PATTERN1__}=$current_match;
14457            
14458              
14459 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/([^()\\\\"']|\\\\.|\\"([^\\"\\\\]|\\\\.)*\\"|\\'([^\\'\\\\]|\\\\\\'|\\\\\\\\|\\\\[^\\'\\\\])*\\')*/]<<},
14460             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14461             q{shline_inter},
14462             $tracelevel)
14463             if defined $::RD_TRACE;
14464              
14465              
14466              
14467 0         0 $_matched = 1;
14468 0         0 last;
14469             }
14470              
14471              
14472 0 0 0     0 unless ( $_matched || defined($score) )
14473             {
14474            
14475              
14476 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
14477 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14478             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14479             q{shline_inter},
14480             $tracelevel)
14481             if defined $::RD_TRACE;
14482 0         0 return undef;
14483             }
14484 0 0 0     0 if (!defined($return) && defined($score))
14485             {
14486 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
14487             q{shline_inter},
14488             $tracelevel)
14489             if defined $::RD_TRACE;
14490 0         0 $return = $score_return;
14491             }
14492 0         0 splice @{$thisparser->{errors}}, $err_at;
  0         0  
14493 0 0       0 $return = $item[$#item] unless defined $return;
14494 0 0       0 if (defined $::RD_TRACE)
14495             {
14496 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
14497             $return . q{])}, "",
14498             q{shline_inter},
14499             $tracelevel);
14500 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
14501             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
14502             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14503             , q{shline_inter},
14504             $tracelevel)
14505             }
14506 0         0 $_[1] = $text;
14507 0         0 return $return;
14508             }
14509              
14510             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
14511             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::shline_nosc
14512             {
14513 40     40   80 my $thisparser = $_[0];
14514 8     8   68 use vars q{$tracelevel};
  8         17  
  8         7172  
14515 40   50     100 local $tracelevel = ($tracelevel||0)+1;
14516 40         52 $ERRORS = 0;
14517 40         82 my $thisrule = $thisparser->{"rules"}{"shline_nosc"};
14518              
14519 40 50       86 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [shline_nosc]},
14520             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14521             q{shline_nosc},
14522             $tracelevel)
14523             if defined $::RD_TRACE;
14524              
14525            
14526 40         57 my $err_at = @{$thisparser->{errors}};
  40         82  
14527              
14528 40         104 my $score;
14529             my $score_return;
14530 40         0 my $_tok;
14531 40         62 my $return = undef;
14532 40         46 my $_matched=0;
14533 40         51 my $commit=0;
14534 40         76 my @item = ();
14535 40         80 my %item = ();
14536 40         55 my $repeating = $_[2];
14537 40         62 my $_noactions = $_[3];
14538 40 50       87 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  40         48  
  40         72  
14539 40         56 my $_itempos = $_[5];
14540 40 50       106 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
14541 40         93 my $text;
14542             my $lastsep;
14543 40         0 my $current_match;
14544 40         98 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/([^;()\\\\"'\\|]|\\|[^>]|\\\\.|\\"([^\\"\\\\]|\\\\.)*\\"|\\'([^\\'\\\\]|\\\\\\'|\\\\\\\\|\\\\[^\\'\\\\])*\\')*/});
14545 40         106 $expectation->at($_[1]);
14546            
14547 40         51 my $thisoffset;
14548 40         126 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
14549            
14550 40         106 my $thiscolumn;
14551 40         101 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
14552            
14553 40         53 my $thisline;
14554 40         128 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
14555              
14556            
14557              
14558 40   33     226 while (!$_matched && !$commit)
14559             {
14560            
14561 40 50       94 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/([^;()\\\\"'\\|]|\\|[^>]|\\\\.|\\"([^\\"\\\\]|\\\\.)*\\"|\\'([^\\'\\\\]|\\\\\\'|\\\\\\\\|\\\\[^\\'\\\\])*\\')*/]},
14562             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14563             q{shline_nosc},
14564             $tracelevel)
14565             if defined $::RD_TRACE;
14566 40         112 my $thisprod = $thisrule->{"prods"}[0];
14567 40         75 $text = $_[1];
14568 40         52 my $_savetext;
14569 40         89 @item = (q{shline_nosc});
14570 40         79 %item = (__RULE__ => q{shline_nosc});
14571 40         50 my $repcount = 0;
14572              
14573              
14574 40 50       99 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/([^;()\\\\"'\\|]|\\|[^>]|\\\\.|\\"([^\\"\\\\]|\\\\.)*\\"|\\'([^\\'\\\\]|\\\\\\'|\\\\\\\\|\\\\[^\\'\\\\])*\\')*/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
14575             q{shline_nosc},
14576             $tracelevel)
14577             if defined $::RD_TRACE;
14578 40         81 undef $lastsep;
14579 40         96 $expectation->is(q{})->at($text);
14580            
14581              
14582 40 100 33     455 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:([^;()\\"'\|]|\|[^>]|\\.|\"([^\"\\]|\\.)*\"|\'([^\'\\]|\\\'|\\\\|\\[^\'\\])*\')*)/)
  40 50       2430  
14583             {
14584 0 0       0 $text = $lastsep . $text if defined $lastsep;
14585 0         0 $expectation->failed();
14586 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14587             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14588             if defined $::RD_TRACE;
14589              
14590 0         0 last;
14591             }
14592 40         277 $current_match = substr($text, $-[0], $+[0] - $-[0]);
14593 40         150 substr($text,0,length($current_match),q{});
14594 40 50       93 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
14595             . $current_match . q{])},
14596             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14597             if defined $::RD_TRACE;
14598 40         116 push @item, $item{__PATTERN1__}=$current_match;
14599            
14600              
14601 40 50       81 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/([^;()\\\\"'\\|]|\\|[^>]|\\\\.|\\"([^\\"\\\\]|\\\\.)*\\"|\\'([^\\'\\\\]|\\\\\\'|\\\\\\\\|\\\\[^\\'\\\\])*\\')*/]<<},
14602             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14603             q{shline_nosc},
14604             $tracelevel)
14605             if defined $::RD_TRACE;
14606              
14607              
14608              
14609 40         56 $_matched = 1;
14610 40         69 last;
14611             }
14612              
14613              
14614 40 50 33     96 unless ( $_matched || defined($score) )
14615             {
14616            
14617              
14618 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
14619 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14620             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14621             q{shline_nosc},
14622             $tracelevel)
14623             if defined $::RD_TRACE;
14624 0         0 return undef;
14625             }
14626 40 50 33     205 if (!defined($return) && defined($score))
14627             {
14628 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
14629             q{shline_nosc},
14630             $tracelevel)
14631             if defined $::RD_TRACE;
14632 0         0 $return = $score_return;
14633             }
14634 40         93 splice @{$thisparser->{errors}}, $err_at;
  40         105  
14635 40 50       126 $return = $item[$#item] unless defined $return;
14636 40 50       115 if (defined $::RD_TRACE)
14637             {
14638 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
14639             $return . q{])}, "",
14640             q{shline_nosc},
14641             $tracelevel);
14642 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
14643             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
14644             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14645             , q{shline_nosc},
14646             $tracelevel)
14647             }
14648 40         85 $_[1] = $text;
14649 40         295 return $return;
14650             }
14651              
14652             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
14653             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::startrule
14654             {
14655 574     574   1262 my $thisparser = $_[0];
14656 8     8   72 use vars q{$tracelevel};
  8         24  
  8         3157  
14657 574   50     2591 local $tracelevel = ($tracelevel||0)+1;
14658 574         1114 $ERRORS = 0;
14659 574         1469 my $thisrule = $thisparser->{"rules"}{"startrule"};
14660              
14661 574 50       1593 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [startrule]},
14662             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14663             q{startrule},
14664             $tracelevel)
14665             if defined $::RD_TRACE;
14666              
14667            
14668 574         929 my $err_at = @{$thisparser->{errors}};
  574         1178  
14669              
14670 574         1582 my $score;
14671             my $score_return;
14672 574         0 my $_tok;
14673 574         942 my $return = undef;
14674 574         998 my $_matched=0;
14675 574         1011 my $commit=0;
14676 574         1012 my @item = ();
14677 574         1178 my %item = ();
14678 574         922 my $repeating = $_[2];
14679 574         976 my $_noactions = $_[3];
14680 574 50       1636 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  574         879  
  574         1201  
14681 574         1146 my $_itempos = $_[5];
14682 574 50       1708 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
14683 574         1642 my $text;
14684             my $lastsep;
14685 574         0 my $current_match;
14686 574         2253 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{shell, or complex_command});
14687 574         1800 $expectation->at($_[1]);
14688            
14689 574         904 my $thisoffset;
14690 574         2775 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
14691            
14692 574         1037 my $thiscolumn;
14693 574         2009 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
14694            
14695 574         1089 my $thisline;
14696 574         1973 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
14697              
14698            
14699              
14700 574   33     3466 while (!$_matched && !$commit)
14701             {
14702            
14703 574 50       1682 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [shell eof]},
14704             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14705             q{startrule},
14706             $tracelevel)
14707             if defined $::RD_TRACE;
14708 574         1586 my $thisprod = $thisrule->{"prods"}[0];
14709 574         1203 $text = $_[1];
14710 574         1001 my $_savetext;
14711 574         1384 @item = (q{startrule});
14712 574         1740 %item = (__RULE__ => q{startrule});
14713 574         1114 my $repcount = 0;
14714              
14715              
14716 574 50       1546 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [shell]},
14717             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14718             q{startrule},
14719             $tracelevel)
14720             if defined $::RD_TRACE;
14721 8     8   64 if (1) { no strict qw{refs};
  8         19  
  8         2554  
  574         986  
14722 574         1498 $expectation->is(q{})->at($text);
14723 574 100   574   3451 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::shell($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  574         1186  
14724             {
14725            
14726 573 50       1358 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14727             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14728             q{startrule},
14729             $tracelevel)
14730             if defined $::RD_TRACE;
14731 573         1573 $expectation->failed();
14732 573         982 last;
14733             }
14734 1 50       18 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [shell]<< (return value: [}
14735             . $_tok . q{]},
14736              
14737             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14738             q{startrule},
14739             $tracelevel)
14740             if defined $::RD_TRACE;
14741 1         13 $item{q{shell}} = $_tok;
14742 1         4 push @item, $_tok;
14743            
14744             }
14745              
14746            
14747              
14748 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
14749             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14750             q{startrule},
14751             $tracelevel)
14752             if defined $::RD_TRACE;
14753 1         1 $_tok = do { $commit = 1 };
  1         4  
14754 1 50       8 if (defined($_tok))
14755             {
14756 1 50       12 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
14757             . $_tok . q{])},
14758             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14759             if defined $::RD_TRACE;
14760             }
14761             else
14762             {
14763 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14764             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14765             if defined $::RD_TRACE;
14766             }
14767            
14768 1 50       4 last unless defined $_tok;
14769 1         114 push @item, $item{__DIRECTIVE1__}=$_tok;
14770            
14771              
14772 1 50       16 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [eof]},
14773             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14774             q{startrule},
14775             $tracelevel)
14776             if defined $::RD_TRACE;
14777 8     8   63 if (1) { no strict qw{refs};
  8         16  
  8         5089  
  1         2  
14778 1         9 $expectation->is(q{eof})->at($text);
14779 1 50   1   34 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::eof($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1         10  
14780             {
14781            
14782 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14783             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14784             q{startrule},
14785             $tracelevel)
14786             if defined $::RD_TRACE;
14787 0         0 $expectation->failed();
14788 0         0 last;
14789             }
14790 1 50       16 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [eof]<< (return value: [}
14791             . $_tok . q{]},
14792              
14793             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14794             q{startrule},
14795             $tracelevel)
14796             if defined $::RD_TRACE;
14797 1         7 $item{q{eof}} = $_tok;
14798 1         9 push @item, $_tok;
14799            
14800             }
14801              
14802 1 50       9 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
14803             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14804             q{startrule},
14805             $tracelevel)
14806             if defined $::RD_TRACE;
14807            
14808              
14809 1 50       6 $_tok = ($_noactions) ? 0 : do { $item[1] };
  1         7  
14810 1 50       7 unless (defined $_tok)
14811             {
14812 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
14813             if defined $::RD_TRACE;
14814 0         0 last;
14815             }
14816 1 50       9 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
14817             . $_tok . q{])},
14818             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14819             if defined $::RD_TRACE;
14820 1         7 push @item, $_tok;
14821 1         3 $item{__ACTION1__}=$_tok;
14822            
14823              
14824 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [shell eof]<<},
14825             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14826             q{startrule},
14827             $tracelevel)
14828             if defined $::RD_TRACE;
14829              
14830              
14831              
14832 1         2 $_matched = 1;
14833 1         2 last;
14834             }
14835              
14836              
14837 574   66     3721 while (!$_matched && !$commit)
14838             {
14839            
14840 573 50       1319 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [complex_command eof]},
14841             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14842             q{startrule},
14843             $tracelevel)
14844             if defined $::RD_TRACE;
14845 573         1218 my $thisprod = $thisrule->{"prods"}[1];
14846 573         1125 $text = $_[1];
14847 573         817 my $_savetext;
14848 573         1287 @item = (q{startrule});
14849 573         1570 %item = (__RULE__ => q{startrule});
14850 573         1032 my $repcount = 0;
14851              
14852              
14853 573 50       1268 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [complex_command]},
14854             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14855             q{startrule},
14856             $tracelevel)
14857             if defined $::RD_TRACE;
14858 573         1150 $expectation->is(q{})->at($text);
14859            
14860 573 50   1384   3207 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::complex_command, 1, 100000000, $_noactions,$expectation,sub { \@arg },undef)))
  1384         2638  
14861             {
14862 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14863             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14864             q{startrule},
14865             $tracelevel)
14866             if defined $::RD_TRACE;
14867 0         0 last;
14868             }
14869 573 50       2456 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [complex_command]<< (}
14870             . @$_tok . q{ times)},
14871              
14872             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14873             q{startrule},
14874             $tracelevel)
14875             if defined $::RD_TRACE;
14876 573         1315 $item{q{complex_command(s)}} = $_tok;
14877 573         1100 push @item, $_tok;
14878            
14879              
14880              
14881            
14882              
14883 573 50       1298 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
14884             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14885             q{startrule},
14886             $tracelevel)
14887             if defined $::RD_TRACE;
14888 573         797 $_tok = do { $commit = 1 };
  573         975  
14889 573 50       1417 if (defined($_tok))
14890             {
14891 573 50       1288 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
14892             . $_tok . q{])},
14893             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14894             if defined $::RD_TRACE;
14895             }
14896             else
14897             {
14898 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14899             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14900             if defined $::RD_TRACE;
14901             }
14902            
14903 573 50       1221 last unless defined $_tok;
14904 573         1166 push @item, $item{__DIRECTIVE1__}=$_tok;
14905            
14906              
14907 573 50       1265 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [eof]},
14908             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14909             q{startrule},
14910             $tracelevel)
14911             if defined $::RD_TRACE;
14912 8     8   72 if (1) { no strict qw{refs};
  8         16  
  8         5111  
  573         754  
14913 573         1421 $expectation->is(q{eof})->at($text);
14914 573 50   573   3169 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::eof($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  573         1267  
14915             {
14916            
14917 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14918             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14919             q{startrule},
14920             $tracelevel)
14921             if defined $::RD_TRACE;
14922 0         0 $expectation->failed();
14923 0         0 last;
14924             }
14925 573 50       2223 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [eof]<< (return value: [}
14926             . $_tok . q{]},
14927              
14928             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14929             q{startrule},
14930             $tracelevel)
14931             if defined $::RD_TRACE;
14932 573         1274 $item{q{eof}} = $_tok;
14933 573         1058 push @item, $_tok;
14934            
14935             }
14936              
14937 573 50       1156 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
14938             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14939             q{startrule},
14940             $tracelevel)
14941             if defined $::RD_TRACE;
14942            
14943              
14944 573 50       1270 $_tok = ($_noactions) ? 0 : do { $item[1] };
  573         1005  
14945 573 50       1277 unless (defined $_tok)
14946             {
14947 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
14948             if defined $::RD_TRACE;
14949 0         0 last;
14950             }
14951 573 50       1171 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
14952             . $_tok . q{])},
14953             XML::XSH2::Parser::_Runtime::_tracefirst($text))
14954             if defined $::RD_TRACE;
14955 573         925 push @item, $_tok;
14956 573         923 $item{__ACTION1__}=$_tok;
14957            
14958              
14959 573 50       1207 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [complex_command eof]<<},
14960             XML::XSH2::Parser::_Runtime::_tracefirst($text),
14961             q{startrule},
14962             $tracelevel)
14963             if defined $::RD_TRACE;
14964              
14965              
14966              
14967 573         761 $_matched = 1;
14968 573         945 last;
14969             }
14970              
14971              
14972 574 50 33     1269 unless ( $_matched || defined($score) )
14973             {
14974            
14975              
14976 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
14977 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
14978             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
14979             q{startrule},
14980             $tracelevel)
14981             if defined $::RD_TRACE;
14982 0         0 return undef;
14983             }
14984 574 50 33     2288 if (!defined($return) && defined($score))
14985             {
14986 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
14987             q{startrule},
14988             $tracelevel)
14989             if defined $::RD_TRACE;
14990 0         0 $return = $score_return;
14991             }
14992 574         819 splice @{$thisparser->{errors}}, $err_at;
  574         1184  
14993 574 50       1763 $return = $item[$#item] unless defined $return;
14994 574 50       1190 if (defined $::RD_TRACE)
14995             {
14996 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
14997             $return . q{])}, "",
14998             q{startrule},
14999             $tracelevel);
15000 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
15001             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
15002             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15003             , q{startrule},
15004             $tracelevel)
15005             }
15006 574         1289 $_[1] = $text;
15007 574         4190 return $return;
15008             }
15009              
15010             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
15011             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::statement
15012             {
15013 264     264   557 my $thisparser = $_[0];
15014 8     8   71 use vars q{$tracelevel};
  8         20  
  8         8948  
15015 264   50     836 local $tracelevel = ($tracelevel||0)+1;
15016 264         506 $ERRORS = 0;
15017 264         653 my $thisrule = $thisparser->{"rules"}{"statement"};
15018              
15019 264 50       712 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [statement]},
15020             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
15021             q{statement},
15022             $tracelevel)
15023             if defined $::RD_TRACE;
15024              
15025            
15026 264         391 my $err_at = @{$thisparser->{errors}};
  264         616  
15027              
15028 264         710 my $score;
15029             my $score_return;
15030 264         0 my $_tok;
15031 264         475 my $return = undef;
15032 264         390 my $_matched=0;
15033 264         400 my $commit=0;
15034 264         468 my @item = ();
15035 264         444 my %item = ();
15036 264         438 my $repeating = $_[2];
15037 264         441 my $_noactions = $_[3];
15038 264 50       615 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  264         401  
  264         512  
15039 264         458 my $_itempos = $_[5];
15040 264 50       809 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
15041 264         730 my $text;
15042             my $lastsep;
15043 264         0 my $current_match;
15044 264         630 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(?=\\s*[\}\{;])/, or /(if)\\b/, or /(unless)\\b/, or /(while)\\b/, or /(foreach|for)\\b/, or /(try)\\b/, or /(iterate)\\b/, or /(def|define)\\b/});
15045 264         762 $expectation->at($_[1]);
15046            
15047 264         373 my $thisoffset;
15048 264         1009 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
15049            
15050 264         489 my $thiscolumn;
15051 264         744 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
15052            
15053 264         454 my $thisline;
15054 264         749 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
15055              
15056            
15057              
15058 264   33     1327 while (!$_matched && !$commit)
15059             {
15060            
15061 264 50       687 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?=\\s*[\}\{;])/ ]},
15062             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
15063             q{statement},
15064             $tracelevel)
15065             if defined $::RD_TRACE;
15066 264         665 my $thisprod = $thisrule->{"prods"}[0];
15067 264         555 $text = $_[1];
15068 264         453 my $_savetext;
15069 264         573 @item = (q{statement});
15070 264         580 %item = (__RULE__ => q{statement});
15071 264         401 my $repcount = 0;
15072              
15073              
15074 264 50       674 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?=\\s*[\}\{;])/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
15075             q{statement},
15076             $tracelevel)
15077             if defined $::RD_TRACE;
15078 264         553 undef $lastsep;
15079 264         640 $expectation->is(q{})->at($text);
15080            
15081              
15082 264 50 33     2560 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?=\s*[}{;]))/)
  264 50       2625  
15083             {
15084 264 50       905 $text = $lastsep . $text if defined $lastsep;
15085 264         853 $expectation->failed();
15086 264 50       627 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15087             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15088             if defined $::RD_TRACE;
15089              
15090 264         618 last;
15091             }
15092 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
15093 0         0 substr($text,0,length($current_match),q{});
15094 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
15095             . $current_match . q{])},
15096             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15097             if defined $::RD_TRACE;
15098 0         0 push @item, $item{__PATTERN1__}=$current_match;
15099            
15100              
15101            
15102              
15103 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
15104             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15105             q{statement},
15106             $tracelevel)
15107             if defined $::RD_TRACE;
15108 0         0 $_tok = do { $commit = 1 };
  0         0  
15109 0 0       0 if (defined($_tok))
15110             {
15111 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
15112             . $_tok . q{])},
15113             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15114             if defined $::RD_TRACE;
15115             }
15116             else
15117             {
15118 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15119             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15120             if defined $::RD_TRACE;
15121             }
15122            
15123 0 0       0 last unless defined $_tok;
15124 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
15125            
15126              
15127 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Rejecting production<< (found )},
15128             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15129             q{statement},
15130             $tracelevel)
15131             if defined $::RD_TRACE;
15132 0         0 undef $return;
15133            
15134              
15135 0         0 $_tok = undef;
15136            
15137 0 0       0 last unless defined $_tok;
15138              
15139 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?=\\s*[\}\{;])/ ]<<},
15140             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15141             q{statement},
15142             $tracelevel)
15143             if defined $::RD_TRACE;
15144              
15145              
15146              
15147 0         0 $_matched = 1;
15148 0         0 last;
15149             }
15150              
15151              
15152 264   33     1178 while (!$_matched && !$commit)
15153             {
15154            
15155 264 50       637 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(if)\\b/ exp block elsif_block else_block]},
15156             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
15157             q{statement},
15158             $tracelevel)
15159             if defined $::RD_TRACE;
15160 264         525 my $thisprod = $thisrule->{"prods"}[1];
15161 264         513 $text = $_[1];
15162 264         398 my $_savetext;
15163 264         608 @item = (q{statement});
15164 264         660 %item = (__RULE__ => q{statement});
15165 264         481 my $repcount = 0;
15166              
15167              
15168 264 50       619 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(if)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
15169             q{statement},
15170             $tracelevel)
15171             if defined $::RD_TRACE;
15172 264         478 undef $lastsep;
15173 264         585 $expectation->is(q{})->at($text);
15174            
15175              
15176 264 50 66     1939 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(if)\b)/)
  264 100       2184  
15177             {
15178 260 50       840 $text = $lastsep . $text if defined $lastsep;
15179 260         757 $expectation->failed();
15180 260 50       705 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15181             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15182             if defined $::RD_TRACE;
15183              
15184 260         544 last;
15185             }
15186 4         44 $current_match = substr($text, $-[0], $+[0] - $-[0]);
15187 4         28 substr($text,0,length($current_match),q{});
15188 4 50       33 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
15189             . $current_match . q{])},
15190             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15191             if defined $::RD_TRACE;
15192 4         22 push @item, $item{__PATTERN1__}=$current_match;
15193            
15194              
15195            
15196              
15197 4 50       27 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
15198             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15199             q{statement},
15200             $tracelevel)
15201             if defined $::RD_TRACE;
15202 4         15 $_tok = do { $commit = 1 };
  4         9  
15203 4 50       33 if (defined($_tok))
15204             {
15205 4 50       23 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
15206             . $_tok . q{])},
15207             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15208             if defined $::RD_TRACE;
15209             }
15210             else
15211             {
15212 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15213             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15214             if defined $::RD_TRACE;
15215             }
15216            
15217 4 50       24 last unless defined $_tok;
15218 4         12 push @item, $item{__DIRECTIVE1__}=$_tok;
15219            
15220              
15221 4 50       22 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
15222             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15223             q{statement},
15224             $tracelevel)
15225             if defined $::RD_TRACE;
15226 8     8   71 if (1) { no strict qw{refs};
  8         37  
  8         1531  
  4         12  
15227 4         18 $expectation->is(q{exp})->at($text);
15228 4 50   4   61 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  4         19  
15229             {
15230            
15231 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15232             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15233             q{statement},
15234             $tracelevel)
15235             if defined $::RD_TRACE;
15236 0         0 $expectation->failed();
15237 0         0 last;
15238             }
15239 4 50       30 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
15240             . $_tok . q{]},
15241              
15242             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15243             q{statement},
15244             $tracelevel)
15245             if defined $::RD_TRACE;
15246 4         25 $item{q{exp}} = $_tok;
15247 4         18 push @item, $_tok;
15248            
15249             }
15250              
15251 4 50       21 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
15252             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15253             q{statement},
15254             $tracelevel)
15255             if defined $::RD_TRACE;
15256 8     8   72 if (1) { no strict qw{refs};
  8         19  
  8         1647  
  4         17  
15257 4         18 $expectation->is(q{block})->at($text);
15258 4 50   4   46 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  4         17  
15259             {
15260            
15261 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15262             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15263             q{statement},
15264             $tracelevel)
15265             if defined $::RD_TRACE;
15266 0         0 $expectation->failed();
15267 0         0 last;
15268             }
15269 4 50       30 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
15270             . $_tok . q{]},
15271              
15272             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15273             q{statement},
15274             $tracelevel)
15275             if defined $::RD_TRACE;
15276 4         24 $item{q{block}} = $_tok;
15277 4         17 push @item, $_tok;
15278            
15279             }
15280              
15281 4 50       25 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [elsif_block]},
15282             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15283             q{statement},
15284             $tracelevel)
15285             if defined $::RD_TRACE;
15286 8     8   56 if (1) { no strict qw{refs};
  8         17  
  8         1591  
  4         9  
15287 4         18 $expectation->is(q{elsif_block})->at($text);
15288 4 50   4   40 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::elsif_block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  4         18  
15289             {
15290            
15291 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15292             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15293             q{statement},
15294             $tracelevel)
15295             if defined $::RD_TRACE;
15296 0         0 $expectation->failed();
15297 0         0 last;
15298             }
15299 4 50       17 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [elsif_block]<< (return value: [}
15300             . $_tok . q{]},
15301              
15302             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15303             q{statement},
15304             $tracelevel)
15305             if defined $::RD_TRACE;
15306 4         10 $item{q{elsif_block}} = $_tok;
15307 4         9 push @item, $_tok;
15308            
15309             }
15310              
15311 4 50       12 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [else_block]},
15312             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15313             q{statement},
15314             $tracelevel)
15315             if defined $::RD_TRACE;
15316 8     8   78 if (1) { no strict qw{refs};
  8         18  
  8         5881  
  4         7  
15317 4         13 $expectation->is(q{else_block})->at($text);
15318 4 50   4   36 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::else_block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  4         13  
15319             {
15320            
15321 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15322             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15323             q{statement},
15324             $tracelevel)
15325             if defined $::RD_TRACE;
15326 0         0 $expectation->failed();
15327 0         0 last;
15328             }
15329 4 50       26 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [else_block]<< (return value: [}
15330             . $_tok . q{]},
15331              
15332             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15333             q{statement},
15334             $tracelevel)
15335             if defined $::RD_TRACE;
15336 4         13 $item{q{else_block}} = $_tok;
15337 4         8 push @item, $_tok;
15338            
15339             }
15340              
15341 4 50       22 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
15342             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15343             q{statement},
15344             $tracelevel)
15345             if defined $::RD_TRACE;
15346            
15347              
15348 4 50       21 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'if_statement',[$item[3],$item[4]],@{$item[5]},@{$item[6]}] };
  4         13  
  4         9  
  4         27  
15349 4 50       15 unless (defined $_tok)
15350             {
15351 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
15352             if defined $::RD_TRACE;
15353 0         0 last;
15354             }
15355 4 50       13 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
15356             . $_tok . q{])},
15357             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15358             if defined $::RD_TRACE;
15359 4         7 push @item, $_tok;
15360 4         10 $item{__ACTION1__}=$_tok;
15361            
15362              
15363 4 50       10 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(if)\\b/ exp block elsif_block else_block]<<},
15364             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15365             q{statement},
15366             $tracelevel)
15367             if defined $::RD_TRACE;
15368              
15369              
15370              
15371 4         12 $_matched = 1;
15372 4         12 last;
15373             }
15374              
15375              
15376 264   66     1223 while (!$_matched && !$commit)
15377             {
15378            
15379 260 50       632 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(unless)\\b/ exp block else_block]},
15380             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
15381             q{statement},
15382             $tracelevel)
15383             if defined $::RD_TRACE;
15384 260         583 my $thisprod = $thisrule->{"prods"}[2];
15385 260         553 $text = $_[1];
15386 260         377 my $_savetext;
15387 260         617 @item = (q{statement});
15388 260         633 %item = (__RULE__ => q{statement});
15389 260         421 my $repcount = 0;
15390              
15391              
15392 260 50       622 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(unless)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
15393             q{statement},
15394             $tracelevel)
15395             if defined $::RD_TRACE;
15396 260         517 undef $lastsep;
15397 260         608 $expectation->is(q{})->at($text);
15398            
15399              
15400 260 50 66     1921 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(unless)\b)/)
  260 100       2482  
15401             {
15402 37 50       140 $text = $lastsep . $text if defined $lastsep;
15403 37         136 $expectation->failed();
15404 37 50       110 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15405             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15406             if defined $::RD_TRACE;
15407              
15408 37         79 last;
15409             }
15410 223         1623 $current_match = substr($text, $-[0], $+[0] - $-[0]);
15411 223         855 substr($text,0,length($current_match),q{});
15412 223 50       644 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
15413             . $current_match . q{])},
15414             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15415             if defined $::RD_TRACE;
15416 223         650 push @item, $item{__PATTERN1__}=$current_match;
15417            
15418              
15419            
15420              
15421 223 50       556 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
15422             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15423             q{statement},
15424             $tracelevel)
15425             if defined $::RD_TRACE;
15426 223         329 $_tok = do { $commit = 1 };
  223         442  
15427 223 50       503 if (defined($_tok))
15428             {
15429 223 50       530 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
15430             . $_tok . q{])},
15431             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15432             if defined $::RD_TRACE;
15433             }
15434             else
15435             {
15436 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15437             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15438             if defined $::RD_TRACE;
15439             }
15440            
15441 223 50       597 last unless defined $_tok;
15442 223         530 push @item, $item{__DIRECTIVE1__}=$_tok;
15443            
15444              
15445 223 50       542 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
15446             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15447             q{statement},
15448             $tracelevel)
15449             if defined $::RD_TRACE;
15450 8     8   63 if (1) { no strict qw{refs};
  8         17  
  8         1512  
  223         354  
15451 223         513 $expectation->is(q{exp})->at($text);
15452 223 50   223   1334 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  223         495  
15453             {
15454            
15455 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15456             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15457             q{statement},
15458             $tracelevel)
15459             if defined $::RD_TRACE;
15460 0         0 $expectation->failed();
15461 0         0 last;
15462             }
15463 223 50       944 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
15464             . $_tok . q{]},
15465              
15466             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15467             q{statement},
15468             $tracelevel)
15469             if defined $::RD_TRACE;
15470 223         579 $item{q{exp}} = $_tok;
15471 223         474 push @item, $_tok;
15472            
15473             }
15474              
15475 223 50       547 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
15476             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15477             q{statement},
15478             $tracelevel)
15479             if defined $::RD_TRACE;
15480 8     8   59 if (1) { no strict qw{refs};
  8         24  
  8         7285  
  223         329  
15481 223         708 $expectation->is(q{block})->at($text);
15482 223 100   223   1460 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  223         508  
15483             {
15484            
15485 219 50       556 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15486             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15487             q{statement},
15488             $tracelevel)
15489             if defined $::RD_TRACE;
15490 219         624 $expectation->failed();
15491 219         504 last;
15492             }
15493 4 50       20 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
15494             . $_tok . q{]},
15495              
15496             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15497             q{statement},
15498             $tracelevel)
15499             if defined $::RD_TRACE;
15500 4         11 $item{q{block}} = $_tok;
15501 4         12 push @item, $_tok;
15502            
15503             }
15504              
15505 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [else_block]},
15506             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15507             q{statement},
15508             $tracelevel)
15509             if defined $::RD_TRACE;
15510 4         12 $expectation->is(q{else_block})->at($text);
15511            
15512 4 50   4   25 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::else_block, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  4         9  
15513             {
15514 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15515             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15516             q{statement},
15517             $tracelevel)
15518             if defined $::RD_TRACE;
15519 0         0 last;
15520             }
15521 4 50       17 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [else_block]<< (}
15522             . @$_tok . q{ times)},
15523              
15524             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15525             q{statement},
15526             $tracelevel)
15527             if defined $::RD_TRACE;
15528 4         12 $item{q{else_block(?)}} = $_tok;
15529 4         8 push @item, $_tok;
15530            
15531              
15532              
15533 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
15534             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15535             q{statement},
15536             $tracelevel)
15537             if defined $::RD_TRACE;
15538            
15539              
15540 4 50       8 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'unless_statement',$item[3],$item[4],@{$item[5]}] };
  4         9  
  4         15  
15541 4 50       12 unless (defined $_tok)
15542             {
15543 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
15544             if defined $::RD_TRACE;
15545 0         0 last;
15546             }
15547 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
15548             . $_tok . q{])},
15549             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15550             if defined $::RD_TRACE;
15551 4         8 push @item, $_tok;
15552 4         27 $item{__ACTION1__}=$_tok;
15553            
15554              
15555 4 50       14 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(unless)\\b/ exp block else_block]<<},
15556             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15557             q{statement},
15558             $tracelevel)
15559             if defined $::RD_TRACE;
15560              
15561              
15562              
15563 4         6 $_matched = 1;
15564 4         10 last;
15565             }
15566              
15567              
15568 264   100     1561 while (!$_matched && !$commit)
15569             {
15570            
15571 37 50       89 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(while)\\b/ exp block]},
15572             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
15573             q{statement},
15574             $tracelevel)
15575             if defined $::RD_TRACE;
15576 37         88 my $thisprod = $thisrule->{"prods"}[3];
15577 37         76 $text = $_[1];
15578 37         69 my $_savetext;
15579 37         98 @item = (q{statement});
15580 37         394 %item = (__RULE__ => q{statement});
15581 37         71 my $repcount = 0;
15582              
15583              
15584 37 50       99 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(while)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
15585             q{statement},
15586             $tracelevel)
15587             if defined $::RD_TRACE;
15588 37         66 undef $lastsep;
15589 37         90 $expectation->is(q{})->at($text);
15590            
15591              
15592 37 50 66     442 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(while)\b)/)
  37 100       367  
15593             {
15594 30 50       162 $text = $lastsep . $text if defined $lastsep;
15595 30         123 $expectation->failed();
15596 30 50       85 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15597             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15598             if defined $::RD_TRACE;
15599              
15600 30         83 last;
15601             }
15602 7         45 $current_match = substr($text, $-[0], $+[0] - $-[0]);
15603 7         31 substr($text,0,length($current_match),q{});
15604 7 50       27 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
15605             . $current_match . q{])},
15606             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15607             if defined $::RD_TRACE;
15608 7         24 push @item, $item{__PATTERN1__}=$current_match;
15609            
15610              
15611            
15612              
15613 7 50       20 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
15614             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15615             q{statement},
15616             $tracelevel)
15617             if defined $::RD_TRACE;
15618 7         10 $_tok = do { $commit = 1 };
  7         15  
15619 7 50       23 if (defined($_tok))
15620             {
15621 7 50       21 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
15622             . $_tok . q{])},
15623             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15624             if defined $::RD_TRACE;
15625             }
15626             else
15627             {
15628 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15629             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15630             if defined $::RD_TRACE;
15631             }
15632            
15633 7 50       20 last unless defined $_tok;
15634 7         19 push @item, $item{__DIRECTIVE1__}=$_tok;
15635            
15636              
15637 7 50       37 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
15638             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15639             q{statement},
15640             $tracelevel)
15641             if defined $::RD_TRACE;
15642 8     8   67 if (1) { no strict qw{refs};
  8         16  
  8         1530  
  7         13  
15643 7         27 $expectation->is(q{exp})->at($text);
15644 7 50   7   50 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  7         15  
15645             {
15646            
15647 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15648             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15649             q{statement},
15650             $tracelevel)
15651             if defined $::RD_TRACE;
15652 0         0 $expectation->failed();
15653 0         0 last;
15654             }
15655 7 50       32 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
15656             . $_tok . q{]},
15657              
15658             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15659             q{statement},
15660             $tracelevel)
15661             if defined $::RD_TRACE;
15662 7         18 $item{q{exp}} = $_tok;
15663 7         17 push @item, $_tok;
15664            
15665             }
15666              
15667 7 50       24 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
15668             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15669             q{statement},
15670             $tracelevel)
15671             if defined $::RD_TRACE;
15672 8     8   59 if (1) { no strict qw{refs};
  8         16  
  8         7553  
  7         17  
15673 7         27 $expectation->is(q{block})->at($text);
15674 7 50   7   67 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  7         17  
15675             {
15676            
15677 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15678             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15679             q{statement},
15680             $tracelevel)
15681             if defined $::RD_TRACE;
15682 0         0 $expectation->failed();
15683 0         0 last;
15684             }
15685 7 50       41 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
15686             . $_tok . q{]},
15687              
15688             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15689             q{statement},
15690             $tracelevel)
15691             if defined $::RD_TRACE;
15692 7         27 $item{q{block}} = $_tok;
15693 7         58 push @item, $_tok;
15694            
15695             }
15696              
15697 7 50       27 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
15698             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15699             q{statement},
15700             $tracelevel)
15701             if defined $::RD_TRACE;
15702            
15703              
15704 7 50       24 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'while_statement',$item[3],$item[4]] };
  7         38  
15705 7 50       29 unless (defined $_tok)
15706             {
15707 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
15708             if defined $::RD_TRACE;
15709 0         0 last;
15710             }
15711 7 50       22 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
15712             . $_tok . q{])},
15713             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15714             if defined $::RD_TRACE;
15715 7         17 push @item, $_tok;
15716 7         15 $item{__ACTION1__}=$_tok;
15717            
15718              
15719 7 50       24 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(while)\\b/ exp block]<<},
15720             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15721             q{statement},
15722             $tracelevel)
15723             if defined $::RD_TRACE;
15724              
15725              
15726              
15727 7         12 $_matched = 1;
15728 7         20 last;
15729             }
15730              
15731              
15732 264   100     1255 while (!$_matched && !$commit)
15733             {
15734            
15735 30 50       119 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(foreach|for)\\b/ local_var_in exp block]},
15736             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
15737             q{statement},
15738             $tracelevel)
15739             if defined $::RD_TRACE;
15740 30         99 my $thisprod = $thisrule->{"prods"}[4];
15741 30         69 $text = $_[1];
15742 30         59 my $_savetext;
15743 30         75 @item = (q{statement});
15744 30         83 %item = (__RULE__ => q{statement});
15745 30         52 my $repcount = 0;
15746              
15747              
15748 30 50       84 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(foreach|for)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
15749             q{statement},
15750             $tracelevel)
15751             if defined $::RD_TRACE;
15752 30         66 undef $lastsep;
15753 30         80 $expectation->is(q{})->at($text);
15754            
15755              
15756 30 50 66     511 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(foreach|for)\b)/)
  30 100       333  
15757             {
15758 16 50       84 $text = $lastsep . $text if defined $lastsep;
15759 16         75 $expectation->failed();
15760 16 50       50 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15761             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15762             if defined $::RD_TRACE;
15763              
15764 16         46 last;
15765             }
15766 14         102 $current_match = substr($text, $-[0], $+[0] - $-[0]);
15767 14         78 substr($text,0,length($current_match),q{});
15768 14 50       53 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
15769             . $current_match . q{])},
15770             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15771             if defined $::RD_TRACE;
15772 14         48 push @item, $item{__PATTERN1__}=$current_match;
15773            
15774              
15775            
15776              
15777 14 50       44 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
15778             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15779             q{statement},
15780             $tracelevel)
15781             if defined $::RD_TRACE;
15782 14         27 $_tok = do { $commit = 1 };
  14         29  
15783 14 50       57 if (defined($_tok))
15784             {
15785 14 50       46 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
15786             . $_tok . q{])},
15787             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15788             if defined $::RD_TRACE;
15789             }
15790             else
15791             {
15792 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15793             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15794             if defined $::RD_TRACE;
15795             }
15796            
15797 14 50       51 last unless defined $_tok;
15798 14         40 push @item, $item{__DIRECTIVE1__}=$_tok;
15799            
15800              
15801 14 50       44 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [local_var_in]},
15802             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15803             q{statement},
15804             $tracelevel)
15805             if defined $::RD_TRACE;
15806 14         56 $expectation->is(q{local_var_in})->at($text);
15807            
15808 14 50   14   142 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::local_var_in, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  14         33  
15809             {
15810 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15811             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15812             q{statement},
15813             $tracelevel)
15814             if defined $::RD_TRACE;
15815 0         0 last;
15816             }
15817 14 50       64 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [local_var_in]<< (}
15818             . @$_tok . q{ times)},
15819              
15820             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15821             q{statement},
15822             $tracelevel)
15823             if defined $::RD_TRACE;
15824 14         44 $item{q{local_var_in(?)}} = $_tok;
15825 14         36 push @item, $_tok;
15826            
15827              
15828              
15829 14 50       37 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [exp]},
15830             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15831             q{statement},
15832             $tracelevel)
15833             if defined $::RD_TRACE;
15834 8     8   87 if (1) { no strict qw{refs};
  8         27  
  8         1772  
  14         29  
15835 14         49 $expectation->is(q{exp})->at($text);
15836 14 50   14   104 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::exp($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  14         33  
15837             {
15838            
15839 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15840             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15841             q{statement},
15842             $tracelevel)
15843             if defined $::RD_TRACE;
15844 0         0 $expectation->failed();
15845 0         0 last;
15846             }
15847 14 50       64 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [exp]<< (return value: [}
15848             . $_tok . q{]},
15849              
15850             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15851             q{statement},
15852             $tracelevel)
15853             if defined $::RD_TRACE;
15854 14         45 $item{q{exp}} = $_tok;
15855 14         30 push @item, $_tok;
15856            
15857             }
15858              
15859 14 50       50 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
15860             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15861             q{statement},
15862             $tracelevel)
15863             if defined $::RD_TRACE;
15864 8     8   58 if (1) { no strict qw{refs};
  8         19  
  8         6189  
  14         22  
15865 14         44 $expectation->is(q{block})->at($text);
15866 14 100   14   103 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  14         38  
15867             {
15868            
15869 3 50       10 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15870             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15871             q{statement},
15872             $tracelevel)
15873             if defined $::RD_TRACE;
15874 3         9 $expectation->failed();
15875 3         7 last;
15876             }
15877 11 50       55 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
15878             . $_tok . q{]},
15879              
15880             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15881             q{statement},
15882             $tracelevel)
15883             if defined $::RD_TRACE;
15884 11         59 $item{q{block}} = $_tok;
15885 11         30 push @item, $_tok;
15886            
15887             }
15888              
15889 11 50       33 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
15890             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15891             q{statement},
15892             $tracelevel)
15893             if defined $::RD_TRACE;
15894            
15895              
15896 11 50       35 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'foreach_statement',@item[4,5],@{$item[3]}] };
  11         37  
  11         44  
15897 11 50       63 unless (defined $_tok)
15898             {
15899 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
15900             if defined $::RD_TRACE;
15901 0         0 last;
15902             }
15903 11 50       36 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
15904             . $_tok . q{])},
15905             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15906             if defined $::RD_TRACE;
15907 11         27 push @item, $_tok;
15908 11         27 $item{__ACTION1__}=$_tok;
15909            
15910              
15911 11 50       30 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(foreach|for)\\b/ local_var_in exp block]<<},
15912             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15913             q{statement},
15914             $tracelevel)
15915             if defined $::RD_TRACE;
15916              
15917              
15918              
15919 11         22 $_matched = 1;
15920 11         28 last;
15921             }
15922              
15923              
15924 264   100     1221 while (!$_matched && !$commit)
15925             {
15926            
15927 16 50       45 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(try)\\b/ block 'catch' local_var block]},
15928             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
15929             q{statement},
15930             $tracelevel)
15931             if defined $::RD_TRACE;
15932 16         42 my $thisprod = $thisrule->{"prods"}[5];
15933 16         35 $text = $_[1];
15934 16         30 my $_savetext;
15935 16         46 @item = (q{statement});
15936 16         44 %item = (__RULE__ => q{statement});
15937 16         33 my $repcount = 0;
15938              
15939              
15940 16 50       45 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(try)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
15941             q{statement},
15942             $tracelevel)
15943             if defined $::RD_TRACE;
15944 16         40 undef $lastsep;
15945 16         61 $expectation->is(q{})->at($text);
15946            
15947              
15948 16 50 66     284 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(try)\b)/)
  16 100       203  
15949             {
15950 10 50       72 $text = $lastsep . $text if defined $lastsep;
15951 10         50 $expectation->failed();
15952 10 50       29 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15953             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15954             if defined $::RD_TRACE;
15955              
15956 10         26 last;
15957             }
15958 6         49 $current_match = substr($text, $-[0], $+[0] - $-[0]);
15959 6         27 substr($text,0,length($current_match),q{});
15960 6 50       22 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
15961             . $current_match . q{])},
15962             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15963             if defined $::RD_TRACE;
15964 6         20 push @item, $item{__PATTERN1__}=$current_match;
15965            
15966              
15967            
15968              
15969 6 50       16 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
15970             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15971             q{statement},
15972             $tracelevel)
15973             if defined $::RD_TRACE;
15974 6         12 $_tok = do { $commit = 1 };
  6         12  
15975 6 50       18 if (defined($_tok))
15976             {
15977 6 50       20 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
15978             . $_tok . q{])},
15979             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15980             if defined $::RD_TRACE;
15981             }
15982             else
15983             {
15984 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
15985             XML::XSH2::Parser::_Runtime::_tracefirst($text))
15986             if defined $::RD_TRACE;
15987             }
15988            
15989 6 50       39 last unless defined $_tok;
15990 6         19 push @item, $item{__DIRECTIVE1__}=$_tok;
15991            
15992              
15993 6 50       28 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
15994             XML::XSH2::Parser::_Runtime::_tracefirst($text),
15995             q{statement},
15996             $tracelevel)
15997             if defined $::RD_TRACE;
15998 8     8   95 if (1) { no strict qw{refs};
  8         19  
  8         5188  
  6         11  
15999 6         62 $expectation->is(q{block})->at($text);
16000 6 50   6   56 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  6         13  
16001             {
16002            
16003 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16004             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16005             q{statement},
16006             $tracelevel)
16007             if defined $::RD_TRACE;
16008 0         0 $expectation->failed();
16009 0         0 last;
16010             }
16011 6 50       32 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
16012             . $_tok . q{]},
16013              
16014             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16015             q{statement},
16016             $tracelevel)
16017             if defined $::RD_TRACE;
16018 6         21 $item{q{block}} = $_tok;
16019 6         15 push @item, $_tok;
16020            
16021             }
16022              
16023 6 50       18 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: ['catch']},
16024             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16025             q{statement},
16026             $tracelevel)
16027             if defined $::RD_TRACE;
16028 6         11 undef $lastsep;
16029 6         17 $expectation->is(q{'catch'})->at($text);
16030            
16031              
16032 6 50 33     187 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\Acatch/)
  6 50       103  
16033             {
16034 0 0       0 $text = $lastsep . $text if defined $lastsep;
16035            
16036 0         0 $expectation->failed();
16037 0 0       0 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
16038             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16039             if defined $::RD_TRACE;
16040 0         0 last;
16041             }
16042 6         45 $current_match = substr($text, $-[0], $+[0] - $-[0]);
16043 6         23 substr($text,0,length($current_match),q{});
16044 6 50       24 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
16045             . $current_match . q{])},
16046             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16047             if defined $::RD_TRACE;
16048 6         20 push @item, $item{__STRING1__}=$current_match;
16049            
16050              
16051 6 50       56 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [local_var]},
16052             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16053             q{statement},
16054             $tracelevel)
16055             if defined $::RD_TRACE;
16056 6         22 $expectation->is(q{local_var})->at($text);
16057            
16058 6 50   6   46 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::local_var, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  6         16  
16059             {
16060 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16061             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16062             q{statement},
16063             $tracelevel)
16064             if defined $::RD_TRACE;
16065 0         0 last;
16066             }
16067 6 50       27 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [local_var]<< (}
16068             . @$_tok . q{ times)},
16069              
16070             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16071             q{statement},
16072             $tracelevel)
16073             if defined $::RD_TRACE;
16074 6         16 $item{q{local_var(?)}} = $_tok;
16075 6         13 push @item, $_tok;
16076            
16077              
16078              
16079 6 50       19 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
16080             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16081             q{statement},
16082             $tracelevel)
16083             if defined $::RD_TRACE;
16084 8     8   65 if (1) { no strict qw{refs};
  8         17  
  8         6356  
  6         11  
16085 6         32 $expectation->is(q{block})->at($text);
16086 6 50   6   41 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  6         14  
16087             {
16088            
16089 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16090             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16091             q{statement},
16092             $tracelevel)
16093             if defined $::RD_TRACE;
16094 0         0 $expectation->failed();
16095 0         0 last;
16096             }
16097 6 50       28 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
16098             . $_tok . q{]},
16099              
16100             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16101             q{statement},
16102             $tracelevel)
16103             if defined $::RD_TRACE;
16104 6         18 $item{q{block}} = $_tok;
16105 6         13 push @item, $_tok;
16106            
16107             }
16108              
16109 6 50       20 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
16110             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16111             q{statement},
16112             $tracelevel)
16113             if defined $::RD_TRACE;
16114            
16115              
16116 6 50       19 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'try_catch',$item[3],$item[6],@{$item[5]}] };
  6         19  
  6         21  
16117 6 50       23 unless (defined $_tok)
16118             {
16119 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
16120             if defined $::RD_TRACE;
16121 0         0 last;
16122             }
16123 6 50       20 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
16124             . $_tok . q{])},
16125             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16126             if defined $::RD_TRACE;
16127 6         12 push @item, $_tok;
16128 6         15 $item{__ACTION1__}=$_tok;
16129            
16130              
16131 6 50       18 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(try)\\b/ block 'catch' local_var block]<<},
16132             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16133             q{statement},
16134             $tracelevel)
16135             if defined $::RD_TRACE;
16136              
16137              
16138              
16139 6         12 $_matched = 1;
16140 6         14 last;
16141             }
16142              
16143              
16144 264   100     1148 while (!$_matched && !$commit)
16145             {
16146            
16147 10 50       51 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(iterate)\\b/ xpstep block]},
16148             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
16149             q{statement},
16150             $tracelevel)
16151             if defined $::RD_TRACE;
16152 10         43 my $thisprod = $thisrule->{"prods"}[6];
16153 10         37 $text = $_[1];
16154 10         18 my $_savetext;
16155 10         56 @item = (q{statement});
16156 10         35 %item = (__RULE__ => q{statement});
16157 10         23 my $repcount = 0;
16158              
16159              
16160 10 50       29 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(iterate)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
16161             q{statement},
16162             $tracelevel)
16163             if defined $::RD_TRACE;
16164 10         50 undef $lastsep;
16165 10         48 $expectation->is(q{})->at($text);
16166            
16167              
16168 10 50 33     255 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(iterate)\b)/)
  10 50       159  
16169             {
16170 10 50       44 $text = $lastsep . $text if defined $lastsep;
16171 10         42 $expectation->failed();
16172 10 50       62 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16173             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16174             if defined $::RD_TRACE;
16175              
16176 10         29 last;
16177             }
16178 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
16179 0         0 substr($text,0,length($current_match),q{});
16180 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
16181             . $current_match . q{])},
16182             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16183             if defined $::RD_TRACE;
16184 0         0 push @item, $item{__PATTERN1__}=$current_match;
16185            
16186              
16187            
16188              
16189 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
16190             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16191             q{statement},
16192             $tracelevel)
16193             if defined $::RD_TRACE;
16194 0         0 $_tok = do { $commit = 1 };
  0         0  
16195 0 0       0 if (defined($_tok))
16196             {
16197 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
16198             . $_tok . q{])},
16199             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16200             if defined $::RD_TRACE;
16201             }
16202             else
16203             {
16204 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16205             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16206             if defined $::RD_TRACE;
16207             }
16208            
16209 0 0       0 last unless defined $_tok;
16210 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
16211            
16212              
16213 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpstep]},
16214             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16215             q{statement},
16216             $tracelevel)
16217             if defined $::RD_TRACE;
16218 8     8   82 if (1) { no strict qw{refs};
  8         16  
  8         1921  
  0         0  
16219 0         0 $expectation->is(q{xpstep})->at($text);
16220 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpstep($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
16221             {
16222            
16223 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16224             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16225             q{statement},
16226             $tracelevel)
16227             if defined $::RD_TRACE;
16228 0         0 $expectation->failed();
16229 0         0 last;
16230             }
16231 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpstep]<< (return value: [}
16232             . $_tok . q{]},
16233              
16234             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16235             q{statement},
16236             $tracelevel)
16237             if defined $::RD_TRACE;
16238 0         0 $item{q{xpstep}} = $_tok;
16239 0         0 push @item, $_tok;
16240            
16241             }
16242              
16243 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
16244             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16245             q{statement},
16246             $tracelevel)
16247             if defined $::RD_TRACE;
16248 8     8   59 if (1) { no strict qw{refs};
  8         14  
  8         6813  
  0         0  
16249 0         0 $expectation->is(q{block})->at($text);
16250 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
16251             {
16252            
16253 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16254             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16255             q{statement},
16256             $tracelevel)
16257             if defined $::RD_TRACE;
16258 0         0 $expectation->failed();
16259 0         0 last;
16260             }
16261 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
16262             . $_tok . q{]},
16263              
16264             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16265             q{statement},
16266             $tracelevel)
16267             if defined $::RD_TRACE;
16268 0         0 $item{q{block}} = $_tok;
16269 0         0 push @item, $_tok;
16270            
16271             }
16272              
16273 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
16274             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16275             q{statement},
16276             $tracelevel)
16277             if defined $::RD_TRACE;
16278            
16279              
16280 0 0       0 $_tok = ($_noactions) ? 0 : do { [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'iterate',$item[4],@{$item[3]}] };
  0         0  
  0         0  
16281 0 0       0 unless (defined $_tok)
16282             {
16283 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
16284             if defined $::RD_TRACE;
16285 0         0 last;
16286             }
16287 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
16288             . $_tok . q{])},
16289             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16290             if defined $::RD_TRACE;
16291 0         0 push @item, $_tok;
16292 0         0 $item{__ACTION1__}=$_tok;
16293            
16294              
16295 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(iterate)\\b/ xpstep block]<<},
16296             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16297             q{statement},
16298             $tracelevel)
16299             if defined $::RD_TRACE;
16300              
16301              
16302              
16303 0         0 $_matched = 1;
16304 0         0 last;
16305             }
16306              
16307              
16308 264   100     1400 while (!$_matched && !$commit)
16309             {
16310            
16311 10 50       47 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(def|define)\\b/ ID variable block]},
16312             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
16313             q{statement},
16314             $tracelevel)
16315             if defined $::RD_TRACE;
16316 10         27 my $thisprod = $thisrule->{"prods"}[7];
16317 10         24 $text = $_[1];
16318 10         17 my $_savetext;
16319 10         26 @item = (q{statement});
16320 10         33 %item = (__RULE__ => q{statement});
16321 10         24 my $repcount = 0;
16322              
16323              
16324 10 50       48 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(def|define)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
16325             q{statement},
16326             $tracelevel)
16327             if defined $::RD_TRACE;
16328 10         23 undef $lastsep;
16329 10         28 $expectation->is(q{})->at($text);
16330            
16331              
16332 10 50 33     319 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(def|define)\b)/)
  10 50       141  
16333             {
16334 0 0       0 $text = $lastsep . $text if defined $lastsep;
16335 0         0 $expectation->failed();
16336 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16337             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16338             if defined $::RD_TRACE;
16339              
16340 0         0 last;
16341             }
16342 10         79 $current_match = substr($text, $-[0], $+[0] - $-[0]);
16343 10         54 substr($text,0,length($current_match),q{});
16344 10 50       32 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
16345             . $current_match . q{])},
16346             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16347             if defined $::RD_TRACE;
16348 10         34 push @item, $item{__PATTERN1__}=$current_match;
16349            
16350              
16351            
16352              
16353 10 50       38 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
16354             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16355             q{statement},
16356             $tracelevel)
16357             if defined $::RD_TRACE;
16358 10         17 $_tok = do { $commit = 1 };
  10         23  
16359 10 50       46 if (defined($_tok))
16360             {
16361 10 50       47 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
16362             . $_tok . q{])},
16363             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16364             if defined $::RD_TRACE;
16365             }
16366             else
16367             {
16368 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16369             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16370             if defined $::RD_TRACE;
16371             }
16372            
16373 10 50       72 last unless defined $_tok;
16374 10         33 push @item, $item{__DIRECTIVE1__}=$_tok;
16375            
16376              
16377 10 50       30 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [ID]},
16378             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16379             q{statement},
16380             $tracelevel)
16381             if defined $::RD_TRACE;
16382 8     8   66 if (1) { no strict qw{refs};
  8         17  
  8         4323  
  10         17  
16383 10         47 $expectation->is(q{ID})->at($text);
16384 10 50   10   102 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::ID($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  10         25  
16385             {
16386            
16387 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16388             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16389             q{statement},
16390             $tracelevel)
16391             if defined $::RD_TRACE;
16392 0         0 $expectation->failed();
16393 0         0 last;
16394             }
16395 10 50       51 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [ID]<< (return value: [}
16396             . $_tok . q{]},
16397              
16398             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16399             q{statement},
16400             $tracelevel)
16401             if defined $::RD_TRACE;
16402 10         26 $item{q{ID}} = $_tok;
16403 10         22 push @item, $_tok;
16404            
16405             }
16406              
16407 10 50       45 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
16408             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16409             q{statement},
16410             $tracelevel)
16411             if defined $::RD_TRACE;
16412            
16413              
16414 10 50       34 $_tok = ($_noactions) ? 0 : do { XML::XSH2::Functions::is_command($item[3])?undef:1 };
  10 50       67  
16415 10 50       39 unless (defined $_tok)
16416             {
16417 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
16418             if defined $::RD_TRACE;
16419 0         0 last;
16420             }
16421 10 50       60 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
16422             . $_tok . q{])},
16423             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16424             if defined $::RD_TRACE;
16425 10         33 push @item, $_tok;
16426 10         33 $item{__ACTION1__}=$_tok;
16427            
16428              
16429 10 50       34 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [variable]},
16430             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16431             q{statement},
16432             $tracelevel)
16433             if defined $::RD_TRACE;
16434 10         33 $expectation->is(q{variable})->at($text);
16435            
16436 10 50   22   94 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::variable, 0, 100000000, $_noactions,$expectation,sub { \@arg },undef)))
  22         73  
16437             {
16438 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16439             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16440             q{statement},
16441             $tracelevel)
16442             if defined $::RD_TRACE;
16443 0         0 last;
16444             }
16445 10 50       52 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [variable]<< (}
16446             . @$_tok . q{ times)},
16447              
16448             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16449             q{statement},
16450             $tracelevel)
16451             if defined $::RD_TRACE;
16452 10         26 $item{q{variable(s?)}} = $_tok;
16453 10         29 push @item, $_tok;
16454            
16455              
16456              
16457 10 50       31 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
16458             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16459             q{statement},
16460             $tracelevel)
16461             if defined $::RD_TRACE;
16462 8     8   59 if (1) { no strict qw{refs};
  8         18  
  8         8013  
  10         15  
16463 10         36 $expectation->is(q{block})->at($text);
16464 10 50   10   72 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  10         26  
16465             {
16466            
16467 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16468             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16469             q{statement},
16470             $tracelevel)
16471             if defined $::RD_TRACE;
16472 0         0 $expectation->failed();
16473 0         0 last;
16474             }
16475 10 50       54 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
16476             . $_tok . q{]},
16477              
16478             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16479             q{statement},
16480             $tracelevel)
16481             if defined $::RD_TRACE;
16482 10         37 $item{q{block}} = $_tok;
16483 10         28 push @item, $_tok;
16484            
16485             }
16486              
16487 10 50       30 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
16488             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16489             q{statement},
16490             $tracelevel)
16491             if defined $::RD_TRACE;
16492            
16493              
16494 10 50       29 $_tok = ($_noactions) ? 0 : do {
16495 10         45 [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'def',$item[3],$item[6],$item[5]]
16496             };
16497 10 50       38 unless (defined $_tok)
16498             {
16499 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
16500             if defined $::RD_TRACE;
16501 0         0 last;
16502             }
16503 10 50       44 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
16504             . $_tok . q{])},
16505             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16506             if defined $::RD_TRACE;
16507 10         33 push @item, $_tok;
16508 10         90 $item{__ACTION2__}=$_tok;
16509            
16510              
16511 10 50       33 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(def|define)\\b/ ID variable block]<<},
16512             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16513             q{statement},
16514             $tracelevel)
16515             if defined $::RD_TRACE;
16516              
16517              
16518              
16519 10         19 $_matched = 1;
16520 10         32 last;
16521             }
16522              
16523              
16524 264 100 66     1013 unless ( $_matched || defined($score) )
16525             {
16526            
16527              
16528 222         579 $_[1] = $text; # NOT SURE THIS IS NEEDED
16529 222 50       585 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16530             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
16531             q{statement},
16532             $tracelevel)
16533             if defined $::RD_TRACE;
16534 222         1685 return undef;
16535             }
16536 42 50 33     245 if (!defined($return) && defined($score))
16537             {
16538 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
16539             q{statement},
16540             $tracelevel)
16541             if defined $::RD_TRACE;
16542 0         0 $return = $score_return;
16543             }
16544 42         74 splice @{$thisparser->{errors}}, $err_at;
  42         118  
16545 42 50       137 $return = $item[$#item] unless defined $return;
16546 42 50       127 if (defined $::RD_TRACE)
16547             {
16548 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
16549             $return . q{])}, "",
16550             q{statement},
16551             $tracelevel);
16552 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
16553             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
16554             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16555             , q{statement},
16556             $tracelevel)
16557             }
16558 42         131 $_[1] = $text;
16559 42         401 return $return;
16560             }
16561              
16562             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
16563             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::stream_select
16564             {
16565 4     4   10 my $thisparser = $_[0];
16566 8     8   77 use vars q{$tracelevel};
  8         24  
  8         4817  
16567 4   50     14 local $tracelevel = ($tracelevel||0)+1;
16568 4         7 $ERRORS = 0;
16569 4         10 my $thisrule = $thisparser->{"rules"}{"stream_select"};
16570              
16571 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [stream_select]},
16572             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
16573             q{stream_select},
16574             $tracelevel)
16575             if defined $::RD_TRACE;
16576              
16577            
16578 4         7 my $err_at = @{$thisparser->{errors}};
  4         8  
16579              
16580 4         13 my $score;
16581             my $score_return;
16582 4         0 my $_tok;
16583 4         7 my $return = undef;
16584 4         6 my $_matched=0;
16585 4         7 my $commit=0;
16586 4         8 my @item = ();
16587 4         7 my %item = ();
16588 4         8 my $repeating = $_[2];
16589 4         6 my $_noactions = $_[3];
16590 4 50       13 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  4         6  
  4         9  
16591 4         8 my $_itempos = $_[5];
16592 4 50       15 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
16593 4         11 my $text;
16594             my $lastsep;
16595 4         0 my $current_match;
16596 4         12 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/select\\s/});
16597 4         14 $expectation->at($_[1]);
16598            
16599 4         5 my $thisoffset;
16600 4         15 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
16601            
16602 4         5 my $thiscolumn;
16603 4         14 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
16604            
16605 4         7 my $thisline;
16606 4         12 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
16607              
16608            
16609              
16610 4   33     27 while (!$_matched && !$commit)
16611             {
16612            
16613 4 50       11 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/select\\s/ xpath block]},
16614             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
16615             q{stream_select},
16616             $tracelevel)
16617             if defined $::RD_TRACE;
16618 4         21 my $thisprod = $thisrule->{"prods"}[0];
16619 4         8 $text = $_[1];
16620 4         6 my $_savetext;
16621 4         8 @item = (q{stream_select});
16622 4         11 %item = (__RULE__ => q{stream_select});
16623 4         5 my $repcount = 0;
16624              
16625              
16626 4 50       12 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/select\\s/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
16627             q{stream_select},
16628             $tracelevel)
16629             if defined $::RD_TRACE;
16630 4         9 undef $lastsep;
16631 4         10 $expectation->is(q{})->at($text);
16632            
16633              
16634 4 50 66     66 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:select\s)/)
  4 100       56  
16635             {
16636 2 50       10 $text = $lastsep . $text if defined $lastsep;
16637 2         7 $expectation->failed();
16638 2 50       7 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16639             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16640             if defined $::RD_TRACE;
16641              
16642 2         5 last;
16643             }
16644 2         16 $current_match = substr($text, $-[0], $+[0] - $-[0]);
16645 2         8 substr($text,0,length($current_match),q{});
16646 2 50       7 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
16647             . $current_match . q{])},
16648             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16649             if defined $::RD_TRACE;
16650 2         9 push @item, $item{__PATTERN1__}=$current_match;
16651            
16652              
16653 2 50       8 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpath]},
16654             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16655             q{stream_select},
16656             $tracelevel)
16657             if defined $::RD_TRACE;
16658 8     8   67 if (1) { no strict qw{refs};
  8         16  
  8         1529  
  2         4  
16659 2         7 $expectation->is(q{xpath})->at($text);
16660 2 50   2   15 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpath($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  2         5  
16661             {
16662            
16663 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16664             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16665             q{stream_select},
16666             $tracelevel)
16667             if defined $::RD_TRACE;
16668 0         0 $expectation->failed();
16669 0         0 last;
16670             }
16671 2 50       12 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpath]<< (return value: [}
16672             . $_tok . q{]},
16673              
16674             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16675             q{stream_select},
16676             $tracelevel)
16677             if defined $::RD_TRACE;
16678 2         7 $item{q{xpath}} = $_tok;
16679 2         6 push @item, $_tok;
16680            
16681             }
16682              
16683 2 50       10 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [block]},
16684             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16685             q{stream_select},
16686             $tracelevel)
16687             if defined $::RD_TRACE;
16688 8     8   59 if (1) { no strict qw{refs};
  8         20  
  8         4861  
  2         4  
16689 2         8 $expectation->is(q{block})->at($text);
16690 2 50   2   23 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::block($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  2         4  
16691             {
16692            
16693 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16694             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16695             q{stream_select},
16696             $tracelevel)
16697             if defined $::RD_TRACE;
16698 0         0 $expectation->failed();
16699 0         0 last;
16700             }
16701 2 50       10 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [block]<< (return value: [}
16702             . $_tok . q{]},
16703              
16704             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16705             q{stream_select},
16706             $tracelevel)
16707             if defined $::RD_TRACE;
16708 2         7 $item{q{block}} = $_tok;
16709 2         5 push @item, $_tok;
16710            
16711             }
16712              
16713 2 50       7 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
16714             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16715             q{stream_select},
16716             $tracelevel)
16717             if defined $::RD_TRACE;
16718            
16719              
16720 2 50       7 $_tok = ($_noactions) ? 0 : do { [$item[2],$item[3]] };
  2         6  
16721 2 50       8 unless (defined $_tok)
16722             {
16723 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
16724             if defined $::RD_TRACE;
16725 0         0 last;
16726             }
16727 2 50       10 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
16728             . $_tok . q{])},
16729             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16730             if defined $::RD_TRACE;
16731 2         6 push @item, $_tok;
16732 2         5 $item{__ACTION1__}=$_tok;
16733            
16734              
16735 2 50       7 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/select\\s/ xpath block]<<},
16736             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16737             q{stream_select},
16738             $tracelevel)
16739             if defined $::RD_TRACE;
16740              
16741              
16742              
16743 2         3 $_matched = 1;
16744 2         6 last;
16745             }
16746              
16747              
16748 4 100 66     25 unless ( $_matched || defined($score) )
16749             {
16750            
16751              
16752 2         9 $_[1] = $text; # NOT SURE THIS IS NEEDED
16753 2 50       6 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16754             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
16755             q{stream_select},
16756             $tracelevel)
16757             if defined $::RD_TRACE;
16758 2         14 return undef;
16759             }
16760 2 50 33     21 if (!defined($return) && defined($score))
16761             {
16762 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
16763             q{stream_select},
16764             $tracelevel)
16765             if defined $::RD_TRACE;
16766 0         0 $return = $score_return;
16767             }
16768 2         5 splice @{$thisparser->{errors}}, $err_at;
  2         6  
16769 2 50       7 $return = $item[$#item] unless defined $return;
16770 2 50       7 if (defined $::RD_TRACE)
16771             {
16772 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
16773             $return . q{])}, "",
16774             q{stream_select},
16775             $tracelevel);
16776 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
16777             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
16778             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16779             , q{stream_select},
16780             $tracelevel)
16781             }
16782 2         9 $_[1] = $text;
16783 2         17 return $return;
16784             }
16785              
16786             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
16787             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::trail
16788             {
16789 908     908   1521 my $thisparser = $_[0];
16790 8     8   63 use vars q{$tracelevel};
  8         20  
  8         9097  
16791 908   50     2249 local $tracelevel = ($tracelevel||0)+1;
16792 908         1373 $ERRORS = 0;
16793 908         1956 my $thisrule = $thisparser->{"rules"}{"trail"};
16794              
16795 908 50       1796 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [trail]},
16796             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
16797             q{trail},
16798             $tracelevel)
16799             if defined $::RD_TRACE;
16800              
16801            
16802 908         1180 my $err_at = @{$thisparser->{errors}};
  908         1553  
16803              
16804 908         2138 my $score;
16805             my $score_return;
16806 908         0 my $_tok;
16807 908         1291 my $return = undef;
16808 908         1196 my $_matched=0;
16809 908         1194 my $commit=0;
16810 908         1357 my @item = ();
16811 908         1316 my %item = ();
16812 908         1288 my $repeating = $_[2];
16813 908         1305 my $_noactions = $_[3];
16814 908 50       1831 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  908         1291  
  908         1548  
16815 908         1523 my $_itempos = $_[5];
16816 908 50       2329 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
16817 908         2051 my $text;
16818             my $lastsep;
16819 908         0 my $current_match;
16820 908         2047 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(?=\\s*[\};]|\\s*\\Z)/, or '|>', or '|'});
16821 908         2341 $expectation->at($_[1]);
16822            
16823 908         1167 my $thisoffset;
16824 908         3135 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
16825            
16826 908         1556 my $thiscolumn;
16827 908         2391 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
16828            
16829 908         1446 my $thisline;
16830 908         2324 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
16831              
16832            
16833              
16834 908   33     3794 while (!$_matched && !$commit)
16835             {
16836            
16837 908 50       1964 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?=\\s*[\};]|\\s*\\Z)/ ]},
16838             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
16839             q{trail},
16840             $tracelevel)
16841             if defined $::RD_TRACE;
16842 908         1941 my $thisprod = $thisrule->{"prods"}[0];
16843 908         1595 $text = $_[1];
16844 908         1219 my $_savetext;
16845 908         1827 @item = (q{trail});
16846 908         1750 %item = (__RULE__ => q{trail});
16847 908         1308 my $repcount = 0;
16848              
16849              
16850 908 50       1778 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?=\\s*[\};]|\\s*\\Z)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
16851             q{trail},
16852             $tracelevel)
16853             if defined $::RD_TRACE;
16854 908         1588 undef $lastsep;
16855 908         1952 $expectation->is(q{})->at($text);
16856            
16857              
16858 908 100 66     7653 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?=\s*[};]|\s*\Z))/)
  908 100       8263  
16859             {
16860 25 50       116 $text = $lastsep . $text if defined $lastsep;
16861 25         95 $expectation->failed();
16862 25 50       72 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16863             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16864             if defined $::RD_TRACE;
16865              
16866 25         71 last;
16867             }
16868 883         4993 $current_match = substr($text, $-[0], $+[0] - $-[0]);
16869 883         2961 substr($text,0,length($current_match),q{});
16870 883 50       1913 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
16871             . $current_match . q{])},
16872             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16873             if defined $::RD_TRACE;
16874 883         2265 push @item, $item{__PATTERN1__}=$current_match;
16875            
16876              
16877            
16878              
16879 883 50       1808 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
16880             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16881             q{trail},
16882             $tracelevel)
16883             if defined $::RD_TRACE;
16884 883         1288 $_tok = do { $commit = 1 };
  883         1437  
16885 883 50       1824 if (defined($_tok))
16886             {
16887 883 50       1760 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
16888             . $_tok . q{])},
16889             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16890             if defined $::RD_TRACE;
16891             }
16892             else
16893             {
16894 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16895             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16896             if defined $::RD_TRACE;
16897             }
16898            
16899 883 50       1759 last unless defined $_tok;
16900 883         1620 push @item, $item{__DIRECTIVE1__}=$_tok;
16901            
16902              
16903 883 50       1723 XML::XSH2::Parser::_Runtime::_trace(q{>>Rejecting production<< (found )},
16904             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16905             q{trail},
16906             $tracelevel)
16907             if defined $::RD_TRACE;
16908 883         1320 undef $return;
16909            
16910              
16911 883         1179 $_tok = undef;
16912            
16913 883 50       2315 last unless defined $_tok;
16914              
16915 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?=\\s*[\};]|\\s*\\Z)/ ]<<},
16916             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16917             q{trail},
16918             $tracelevel)
16919             if defined $::RD_TRACE;
16920              
16921              
16922              
16923 0         0 $_matched = 1;
16924 0         0 last;
16925             }
16926              
16927              
16928 908   66     3640 while (!$_matched && !$commit)
16929             {
16930            
16931 25 50       62 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: ['|>' variable]},
16932             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
16933             q{trail},
16934             $tracelevel)
16935             if defined $::RD_TRACE;
16936 25         56 my $thisprod = $thisrule->{"prods"}[1];
16937 25         49 $text = $_[1];
16938 25         40 my $_savetext;
16939 25         67 @item = (q{trail});
16940 25         75 %item = (__RULE__ => q{trail});
16941 25         62 my $repcount = 0;
16942              
16943              
16944 25 50       60 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: ['|>']},
16945             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16946             q{trail},
16947             $tracelevel)
16948             if defined $::RD_TRACE;
16949 25         35 undef $lastsep;
16950 25         59 $expectation->is(q{})->at($text);
16951            
16952              
16953 25 50 66     390 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A\|\>/)
  25 100       441  
16954             {
16955 24 50       114 $text = $lastsep . $text if defined $lastsep;
16956            
16957 24         83 $expectation->failed();
16958 24 50       80 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
16959             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16960             if defined $::RD_TRACE;
16961 24         49 last;
16962             }
16963 1         10 $current_match = substr($text, $-[0], $+[0] - $-[0]);
16964 1         6 substr($text,0,length($current_match),q{});
16965 1 50       5 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
16966             . $current_match . q{])},
16967             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16968             if defined $::RD_TRACE;
16969 1         10 push @item, $item{__STRING1__}=$current_match;
16970            
16971              
16972            
16973              
16974 1 50       5 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
16975             XML::XSH2::Parser::_Runtime::_tracefirst($text),
16976             q{trail},
16977             $tracelevel)
16978             if defined $::RD_TRACE;
16979 1         2 $_tok = do { $commit = 1 };
  1         3  
16980 1 50       5 if (defined($_tok))
16981             {
16982 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
16983             . $_tok . q{])},
16984             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16985             if defined $::RD_TRACE;
16986             }
16987             else
16988             {
16989 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
16990             XML::XSH2::Parser::_Runtime::_tracefirst($text))
16991             if defined $::RD_TRACE;
16992             }
16993            
16994 1 50       4 last unless defined $_tok;
16995 1         3 push @item, $item{__DIRECTIVE1__}=$_tok;
16996            
16997              
16998 1 50       4 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [variable]},
16999             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17000             q{trail},
17001             $tracelevel)
17002             if defined $::RD_TRACE;
17003 8     8   68 if (1) { no strict qw{refs};
  8         17  
  8         5367  
  1         2  
17004 1         4 $expectation->is(q{variable})->at($text);
17005 1 50   1   7 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::variable($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1         2  
17006             {
17007            
17008 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17009             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17010             q{trail},
17011             $tracelevel)
17012             if defined $::RD_TRACE;
17013 0         0 $expectation->failed();
17014 0         0 last;
17015             }
17016 1 50       6 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [variable]<< (return value: [}
17017             . $_tok . q{]},
17018              
17019             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17020             q{trail},
17021             $tracelevel)
17022             if defined $::RD_TRACE;
17023 1         4 $item{q{variable}} = $_tok;
17024 1         4 push @item, $_tok;
17025            
17026             }
17027              
17028 1 50       16 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
17029             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17030             q{trail},
17031             $tracelevel)
17032             if defined $::RD_TRACE;
17033            
17034              
17035 1 50       6 $_tok = ($_noactions) ? 0 : do { ['var',$item[3]] };
  1         4  
17036 1 50       5 unless (defined $_tok)
17037             {
17038 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
17039             if defined $::RD_TRACE;
17040 0         0 last;
17041             }
17042 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
17043             . $_tok . q{])},
17044             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17045             if defined $::RD_TRACE;
17046 1         3 push @item, $_tok;
17047 1         2 $item{__ACTION1__}=$_tok;
17048            
17049              
17050 1 50       3 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: ['|>' variable]<<},
17051             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17052             q{trail},
17053             $tracelevel)
17054             if defined $::RD_TRACE;
17055              
17056              
17057              
17058 1         2 $_matched = 1;
17059 1         3 last;
17060             }
17061              
17062              
17063 908   100     3308 while (!$_matched && !$commit)
17064             {
17065            
17066 24 50       54 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: ['|' shline]},
17067             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
17068             q{trail},
17069             $tracelevel)
17070             if defined $::RD_TRACE;
17071 24         77 my $thisprod = $thisrule->{"prods"}[2];
17072 24         64 $text = $_[1];
17073 24         37 my $_savetext;
17074 24         93 @item = (q{trail});
17075 24         72 %item = (__RULE__ => q{trail});
17076 24         48 my $repcount = 0;
17077              
17078              
17079 24 50       82 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: ['|']},
17080             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17081             q{trail},
17082             $tracelevel)
17083             if defined $::RD_TRACE;
17084 24         54 undef $lastsep;
17085 24         175 $expectation->is(q{})->at($text);
17086            
17087              
17088 24 50 66     295 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A\|/)
  24 100       473  
17089             {
17090 4 50       50 $text = $lastsep . $text if defined $lastsep;
17091            
17092 4         19 $expectation->failed();
17093 4 50       12 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
17094             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17095             if defined $::RD_TRACE;
17096 4         9 last;
17097             }
17098 20         188 $current_match = substr($text, $-[0], $+[0] - $-[0]);
17099 20         91 substr($text,0,length($current_match),q{});
17100 20 50       75 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
17101             . $current_match . q{])},
17102             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17103             if defined $::RD_TRACE;
17104 20         87 push @item, $item{__STRING1__}=$current_match;
17105            
17106              
17107            
17108              
17109 20 50       61 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
17110             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17111             q{trail},
17112             $tracelevel)
17113             if defined $::RD_TRACE;
17114 20         42 $_tok = do { $commit = 1 };
  20         41  
17115 20 50       54 if (defined($_tok))
17116             {
17117 20 50       54 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
17118             . $_tok . q{])},
17119             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17120             if defined $::RD_TRACE;
17121             }
17122             else
17123             {
17124 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17125             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17126             if defined $::RD_TRACE;
17127             }
17128            
17129 20 50       52 last unless defined $_tok;
17130 20         51 push @item, $item{__DIRECTIVE1__}=$_tok;
17131            
17132              
17133 20 50       47 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [shline]},
17134             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17135             q{trail},
17136             $tracelevel)
17137             if defined $::RD_TRACE;
17138 8     8   65 if (1) { no strict qw{refs};
  8         20  
  8         5482  
  20         28  
17139 20         58 $expectation->is(q{shline})->at($text);
17140 20 50   20   239 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::shline($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  20         53  
17141             {
17142            
17143 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17144             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17145             q{trail},
17146             $tracelevel)
17147             if defined $::RD_TRACE;
17148 0         0 $expectation->failed();
17149 0         0 last;
17150             }
17151 20 50       83 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [shline]<< (return value: [}
17152             . $_tok . q{]},
17153              
17154             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17155             q{trail},
17156             $tracelevel)
17157             if defined $::RD_TRACE;
17158 20         55 $item{q{shline}} = $_tok;
17159 20         41 push @item, $_tok;
17160            
17161             }
17162              
17163 20 50       54 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
17164             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17165             q{trail},
17166             $tracelevel)
17167             if defined $::RD_TRACE;
17168            
17169              
17170 20 50       43 $_tok = ($_noactions) ? 0 : do { ['pipe',$item[3]] };
  20         72  
17171 20 50       56 unless (defined $_tok)
17172             {
17173 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
17174             if defined $::RD_TRACE;
17175 0         0 last;
17176             }
17177 20 50       70 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
17178             . $_tok . q{])},
17179             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17180             if defined $::RD_TRACE;
17181 20         47 push @item, $_tok;
17182 20         38 $item{__ACTION1__}=$_tok;
17183            
17184              
17185 20 50       50 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: ['|' shline]<<},
17186             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17187             q{trail},
17188             $tracelevel)
17189             if defined $::RD_TRACE;
17190              
17191              
17192              
17193 20         31 $_matched = 1;
17194 20         38 last;
17195             }
17196              
17197              
17198 908 100 66     3221 unless ( $_matched || defined($score) )
17199             {
17200            
17201              
17202 887         1677 $_[1] = $text; # NOT SURE THIS IS NEEDED
17203 887 50       1567 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17204             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
17205             q{trail},
17206             $tracelevel)
17207             if defined $::RD_TRACE;
17208 887         5838 return undef;
17209             }
17210 21 50 33     156 if (!defined($return) && defined($score))
17211             {
17212 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
17213             q{trail},
17214             $tracelevel)
17215             if defined $::RD_TRACE;
17216 0         0 $return = $score_return;
17217             }
17218 21         41 splice @{$thisparser->{errors}}, $err_at;
  21         55  
17219 21 50       69 $return = $item[$#item] unless defined $return;
17220 21 50       49 if (defined $::RD_TRACE)
17221             {
17222 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
17223             $return . q{])}, "",
17224             q{trail},
17225             $tracelevel);
17226 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
17227             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
17228             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17229             , q{trail},
17230             $tracelevel)
17231             }
17232 21         49 $_[1] = $text;
17233 21         156 return $return;
17234             }
17235              
17236             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
17237             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::undef
17238             {
17239 0     0   0 my $thisparser = $_[0];
17240 8     8   77 use vars q{$tracelevel};
  8         19  
  8         10403  
17241 0   0     0 local $tracelevel = ($tracelevel||0)+1;
17242 0         0 $ERRORS = 0;
17243 0         0 my $thisrule = $thisparser->{"rules"}{"undef"};
17244              
17245 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [undef]},
17246             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
17247             q{undef},
17248             $tracelevel)
17249             if defined $::RD_TRACE;
17250              
17251            
17252 0         0 my $err_at = @{$thisparser->{errors}};
  0         0  
17253              
17254 0         0 my $score;
17255             my $score_return;
17256 0         0 my $_tok;
17257 0         0 my $return = undef;
17258 0         0 my $_matched=0;
17259 0         0 my $commit=0;
17260 0         0 my @item = ();
17261 0         0 my %item = ();
17262 0         0 my $repeating = $_[2];
17263 0         0 my $_noactions = $_[3];
17264 0 0       0 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  0         0  
  0         0  
17265 0         0 my $_itempos = $_[5];
17266 0 0       0 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
17267 0         0 my $text;
17268             my $lastsep;
17269 0         0 my $current_match;
17270 0         0 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(undef|undefine)\\b/});
17271 0         0 $expectation->at($_[1]);
17272            
17273 0         0 my $thisoffset;
17274 0         0 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
17275            
17276 0         0 my $thiscolumn;
17277 0         0 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
17278            
17279 0         0 my $thisline;
17280 0         0 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
17281              
17282            
17283              
17284 0   0     0 while (!$_matched && !$commit)
17285             {
17286            
17287 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(undef|undefine)\\b/ /\\$?[a-zA-Z_][a-zA-Z0-9_]*/]},
17288             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
17289             q{undef},
17290             $tracelevel)
17291             if defined $::RD_TRACE;
17292 0         0 my $thisprod = $thisrule->{"prods"}[0];
17293 0         0 $text = $_[1];
17294 0         0 my $_savetext;
17295 0         0 @item = (q{undef});
17296 0         0 %item = (__RULE__ => q{undef});
17297 0         0 my $repcount = 0;
17298              
17299              
17300 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(undef|undefine)\\b/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
17301             q{undef},
17302             $tracelevel)
17303             if defined $::RD_TRACE;
17304 0         0 undef $lastsep;
17305 0         0 $expectation->is(q{})->at($text);
17306            
17307              
17308 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(undef|undefine)\b)/)
  0 0       0  
17309             {
17310 0 0       0 $text = $lastsep . $text if defined $lastsep;
17311 0         0 $expectation->failed();
17312 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17313             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17314             if defined $::RD_TRACE;
17315              
17316 0         0 last;
17317             }
17318 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
17319 0         0 substr($text,0,length($current_match),q{});
17320 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
17321             . $current_match . q{])},
17322             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17323             if defined $::RD_TRACE;
17324 0         0 push @item, $item{__PATTERN1__}=$current_match;
17325            
17326              
17327            
17328              
17329 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
17330             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17331             q{undef},
17332             $tracelevel)
17333             if defined $::RD_TRACE;
17334 0         0 $_tok = do { $commit = 1 };
  0         0  
17335 0 0       0 if (defined($_tok))
17336             {
17337 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
17338             . $_tok . q{])},
17339             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17340             if defined $::RD_TRACE;
17341             }
17342             else
17343             {
17344 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17345             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17346             if defined $::RD_TRACE;
17347             }
17348            
17349 0 0       0 last unless defined $_tok;
17350 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
17351            
17352              
17353 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/\\$?[a-zA-Z_][a-zA-Z0-9_]*/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
17354             q{undef},
17355             $tracelevel)
17356             if defined $::RD_TRACE;
17357 0         0 undef $lastsep;
17358 0         0 $expectation->is(q{/\\$?[a-zA-Z_][a-zA-Z0-9_]*/})->at($text);
17359            
17360              
17361 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:\$?[a-zA-Z_][a-zA-Z0-9_]*)/)
  0 0       0  
17362             {
17363 0 0       0 $text = $lastsep . $text if defined $lastsep;
17364 0         0 $expectation->failed();
17365 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17366             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17367             if defined $::RD_TRACE;
17368              
17369 0         0 last;
17370             }
17371 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
17372 0         0 substr($text,0,length($current_match),q{});
17373 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
17374             . $current_match . q{])},
17375             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17376             if defined $::RD_TRACE;
17377 0         0 push @item, $item{__PATTERN2__}=$current_match;
17378            
17379              
17380 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
17381             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17382             q{undef},
17383             $tracelevel)
17384             if defined $::RD_TRACE;
17385            
17386              
17387 0 0       0 $_tok = ($_noactions) ? 0 : do {
17388 0         0 [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,'undefine',$item[3]];
17389             };
17390 0 0       0 unless (defined $_tok)
17391             {
17392 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
17393             if defined $::RD_TRACE;
17394 0         0 last;
17395             }
17396 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
17397             . $_tok . q{])},
17398             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17399             if defined $::RD_TRACE;
17400 0         0 push @item, $_tok;
17401 0         0 $item{__ACTION1__}=$_tok;
17402            
17403              
17404 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(undef|undefine)\\b/ /\\$?[a-zA-Z_][a-zA-Z0-9_]*/]<<},
17405             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17406             q{undef},
17407             $tracelevel)
17408             if defined $::RD_TRACE;
17409              
17410              
17411              
17412 0         0 $_matched = 1;
17413 0         0 last;
17414             }
17415              
17416              
17417 0 0 0     0 unless ( $_matched || defined($score) )
17418             {
17419            
17420              
17421 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
17422 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17423             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
17424             q{undef},
17425             $tracelevel)
17426             if defined $::RD_TRACE;
17427 0         0 return undef;
17428             }
17429 0 0 0     0 if (!defined($return) && defined($score))
17430             {
17431 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
17432             q{undef},
17433             $tracelevel)
17434             if defined $::RD_TRACE;
17435 0         0 $return = $score_return;
17436             }
17437 0         0 splice @{$thisparser->{errors}}, $err_at;
  0         0  
17438 0 0       0 $return = $item[$#item] unless defined $return;
17439 0 0       0 if (defined $::RD_TRACE)
17440             {
17441 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
17442             $return . q{])}, "",
17443             q{undef},
17444             $tracelevel);
17445 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
17446             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
17447             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17448             , q{undef},
17449             $tracelevel)
17450             }
17451 0         0 $_[1] = $text;
17452 0         0 return $return;
17453             }
17454              
17455             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
17456             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::variable
17457             {
17458 288     288   634 my $thisparser = $_[0];
17459 8     8   72 use vars q{$tracelevel};
  8         18  
  8         6640  
17460 288   50     784 local $tracelevel = ($tracelevel||0)+1;
17461 288         450 $ERRORS = 0;
17462 288         639 my $thisrule = $thisparser->{"rules"}{"variable"};
17463              
17464 288 50       668 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [variable]},
17465             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
17466             q{variable},
17467             $tracelevel)
17468             if defined $::RD_TRACE;
17469              
17470            
17471 288         430 my $err_at = @{$thisparser->{errors}};
  288         537  
17472              
17473 288         808 my $score;
17474             my $score_return;
17475 288         0 my $_tok;
17476 288         541 my $return = undef;
17477 288         419 my $_matched=0;
17478 288         413 my $commit=0;
17479 288         534 my @item = ();
17480 288         501 my %item = ();
17481 288         492 my $repeating = $_[2];
17482 288         416 my $_noactions = $_[3];
17483 288 50       695 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  288         422  
  288         532  
17484 288         1021 my $_itempos = $_[5];
17485 288 50       796 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
17486 288         769 my $text;
17487             my $lastsep;
17488 288         0 my $current_match;
17489 288         624 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/\\$[a-zA-Z_][a-zA-Z0-9_]*/});
17490 288         995 $expectation->at($_[1]);
17491            
17492 288         443 my $thisoffset;
17493 288         1127 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
17494            
17495 288         500 my $thiscolumn;
17496 288         751 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
17497            
17498 288         529 my $thisline;
17499 288         786 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
17500              
17501            
17502              
17503 288   33     1406 while (!$_matched && !$commit)
17504             {
17505            
17506 288 50       764 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/\\$[a-zA-Z_][a-zA-Z0-9_]*/]},
17507             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
17508             q{variable},
17509             $tracelevel)
17510             if defined $::RD_TRACE;
17511 288         666 my $thisprod = $thisrule->{"prods"}[0];
17512 288         608 $text = $_[1];
17513 288         731 my $_savetext;
17514 288         631 @item = (q{variable});
17515 288         718 %item = (__RULE__ => q{variable});
17516 288         438 my $repcount = 0;
17517              
17518              
17519 288 50       607 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/\\$[a-zA-Z_][a-zA-Z0-9_]*/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
17520             q{variable},
17521             $tracelevel)
17522             if defined $::RD_TRACE;
17523 288         565 undef $lastsep;
17524 288         713 $expectation->is(q{})->at($text);
17525            
17526              
17527 288 100 66     2908 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:\$[a-zA-Z_][a-zA-Z0-9_]*)/)
  288 100       2990  
17528             {
17529 26 50       114 $text = $lastsep . $text if defined $lastsep;
17530 26         95 $expectation->failed();
17531 26 50       64 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17532             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17533             if defined $::RD_TRACE;
17534              
17535 26         57 last;
17536             }
17537 262         1727 $current_match = substr($text, $-[0], $+[0] - $-[0]);
17538 262         1058 substr($text,0,length($current_match),q{});
17539 262 50       651 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
17540             . $current_match . q{])},
17541             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17542             if defined $::RD_TRACE;
17543 262         725 push @item, $item{__PATTERN1__}=$current_match;
17544            
17545              
17546 262 50       625 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/\\$[a-zA-Z_][a-zA-Z0-9_]*/]<<},
17547             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17548             q{variable},
17549             $tracelevel)
17550             if defined $::RD_TRACE;
17551              
17552              
17553              
17554 262         396 $_matched = 1;
17555 262         494 last;
17556             }
17557              
17558              
17559 288 100 66     840 unless ( $_matched || defined($score) )
17560             {
17561            
17562              
17563 26         84 $_[1] = $text; # NOT SURE THIS IS NEEDED
17564 26 50       74 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17565             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
17566             q{variable},
17567             $tracelevel)
17568             if defined $::RD_TRACE;
17569 26         187 return undef;
17570             }
17571 262 50 33     1118 if (!defined($return) && defined($score))
17572             {
17573 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
17574             q{variable},
17575             $tracelevel)
17576             if defined $::RD_TRACE;
17577 0         0 $return = $score_return;
17578             }
17579 262         421 splice @{$thisparser->{errors}}, $err_at;
  262         725  
17580 262 50       816 $return = $item[$#item] unless defined $return;
17581 262 50       690 if (defined $::RD_TRACE)
17582             {
17583 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
17584             $return . q{])}, "",
17585             q{variable},
17586             $tracelevel);
17587 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
17588             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
17589             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17590             , q{variable},
17591             $tracelevel)
17592             }
17593 262         573 $_[1] = $text;
17594 262         1993 return $return;
17595             }
17596              
17597             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
17598             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpath
17599             {
17600 2266     2266   3518 my $thisparser = $_[0];
17601 8     8   68 use vars q{$tracelevel};
  8         28  
  8         5436  
17602 2266   50     5203 local $tracelevel = ($tracelevel||0)+1;
17603 2266         3130 $ERRORS = 0;
17604 2266         4590 my $thisrule = $thisparser->{"rules"}{"xpath"};
17605              
17606 2266 50       4029 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xpath]},
17607             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
17608             q{xpath},
17609             $tracelevel)
17610             if defined $::RD_TRACE;
17611              
17612            
17613 2266         3023 my $err_at = @{$thisparser->{errors}};
  2266         4044  
17614              
17615 2266         5439 my $score;
17616             my $score_return;
17617 2266         0 my $_tok;
17618 2266         3268 my $return = undef;
17619 2266         2953 my $_matched=0;
17620 2266         2819 my $commit=0;
17621 2266         3476 my @item = ();
17622 2266         3139 my %item = ();
17623 2266         2943 my $repeating = $_[2];
17624 2266         3072 my $_noactions = $_[3];
17625 2266 50       4177 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  2266         2910  
  2266         3574  
17626 2266         3259 my $_itempos = $_[5];
17627 2266 50       4624 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
17628 2266         4738 my $text;
17629             my $lastsep;
17630 2266         0 my $current_match;
17631 2266         4517 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(?=['"])/, or xpsimple});
17632 2266         5266 $expectation->at($_[1]);
17633            
17634 2266         2863 my $thisoffset;
17635 2266         7074 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
17636            
17637 2266         3521 my $thiscolumn;
17638 2266         5171 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
17639            
17640 2266         3423 my $thisline;
17641 2266         5191 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
17642              
17643            
17644              
17645 2266   33     9053 while (!$_matched && !$commit)
17646             {
17647            
17648 2266 50       4630 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?=['"])/ xpstring]},
17649             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
17650             q{xpath},
17651             $tracelevel)
17652             if defined $::RD_TRACE;
17653 2266         4572 my $thisprod = $thisrule->{"prods"}[0];
17654 2266         3944 $text = $_[1];
17655 2266         3107 my $_savetext;
17656 2266         4286 @item = (q{xpath});
17657 2266         4135 %item = (__RULE__ => q{xpath});
17658 2266         3054 my $repcount = 0;
17659              
17660              
17661 2266 50       4152 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?=['"])/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
17662             q{xpath},
17663             $tracelevel)
17664             if defined $::RD_TRACE;
17665 2266         3656 undef $lastsep;
17666 2266         4361 $expectation->is(q{})->at($text);
17667            
17668              
17669 2266 100 66     49318 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?=['"]))/)
  2266 100       20159  
17670             {
17671 1763 50       5156 $text = $lastsep . $text if defined $lastsep;
17672 1763         4843 $expectation->failed();
17673 1763 50       3416 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17674             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17675             if defined $::RD_TRACE;
17676              
17677 1763         3503 last;
17678             }
17679 503         3037 $current_match = substr($text, $-[0], $+[0] - $-[0]);
17680 503         1935 substr($text,0,length($current_match),q{});
17681 503 50       1186 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
17682             . $current_match . q{])},
17683             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17684             if defined $::RD_TRACE;
17685 503         1396 push @item, $item{__PATTERN1__}=$current_match;
17686            
17687              
17688            
17689              
17690 503 50       1102 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
17691             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17692             q{xpath},
17693             $tracelevel)
17694             if defined $::RD_TRACE;
17695 503         690 $_tok = do { $commit = 1 };
  503         884  
17696 503 50       1114 if (defined($_tok))
17697             {
17698 503 50       1058 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
17699             . $_tok . q{])},
17700             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17701             if defined $::RD_TRACE;
17702             }
17703             else
17704             {
17705 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17706             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17707             if defined $::RD_TRACE;
17708             }
17709            
17710 503 50       1085 last unless defined $_tok;
17711 503         1154 push @item, $item{__DIRECTIVE1__}=$_tok;
17712            
17713              
17714 503 50       1046 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpstring]},
17715             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17716             q{xpath},
17717             $tracelevel)
17718             if defined $::RD_TRACE;
17719 8     8   78 if (1) { no strict qw{refs};
  8         27  
  8         3339  
  503         685  
17720 503         1240 $expectation->is(q{xpstring})->at($text);
17721 503 50   503   2716 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpstring($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  503         1079  
17722             {
17723            
17724 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17725             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17726             q{xpath},
17727             $tracelevel)
17728             if defined $::RD_TRACE;
17729 0         0 $expectation->failed();
17730 0         0 last;
17731             }
17732 503 50       1955 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpstring]<< (return value: [}
17733             . $_tok . q{]},
17734              
17735             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17736             q{xpath},
17737             $tracelevel)
17738             if defined $::RD_TRACE;
17739 503         1089 $item{q{xpstring}} = $_tok;
17740 503         965 push @item, $_tok;
17741            
17742             }
17743              
17744 503 50       1040 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
17745             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17746             q{xpath},
17747             $tracelevel)
17748             if defined $::RD_TRACE;
17749            
17750              
17751 503 50       1015 $_tok = ($_noactions) ? 0 : do { $item[3] };
  503         993  
17752 503 50       1127 unless (defined $_tok)
17753             {
17754 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
17755             if defined $::RD_TRACE;
17756 0         0 last;
17757             }
17758 503 50       1177 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
17759             . $_tok . q{])},
17760             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17761             if defined $::RD_TRACE;
17762 503         754 push @item, $_tok;
17763 503         955 $item{__ACTION1__}=$_tok;
17764            
17765              
17766 503 50       983 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?=['"])/ xpstring]<<},
17767             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17768             q{xpath},
17769             $tracelevel)
17770             if defined $::RD_TRACE;
17771              
17772              
17773              
17774 503         704 $_matched = 1;
17775 503         938 last;
17776             }
17777              
17778              
17779 2266   66     8030 while (!$_matched && !$commit)
17780             {
17781 1763 50       4339 local $skip = defined($skip) ? $skip : $XML::XSH2::Parser::_Runtime::skip;
17782 1763 50       3243 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xpsimple xpcont]},
17783             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
17784             q{xpath},
17785             $tracelevel)
17786             if defined $::RD_TRACE;
17787 1763         3178 my $thisprod = $thisrule->{"prods"}[1];
17788 1763         3317 $text = $_[1];
17789 1763         2392 my $_savetext;
17790 1763         3671 @item = (q{xpath});
17791 1763         3752 %item = (__RULE__ => q{xpath});
17792 1763         2728 my $repcount = 0;
17793              
17794              
17795 1763 50       3054 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpsimple]},
17796             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17797             q{xpath},
17798             $tracelevel)
17799             if defined $::RD_TRACE;
17800 8     8   63 if (1) { no strict qw{refs};
  8         18  
  8         9664  
  1763         2287  
17801 1763         3356 $expectation->is(q{})->at($text);
17802 1763 100   1763   8870 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpsimple($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1763         2996  
17803             {
17804            
17805 832 50       1721 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17806             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17807             q{xpath},
17808             $tracelevel)
17809             if defined $::RD_TRACE;
17810 832         2250 $expectation->failed();
17811 832         1430 last;
17812             }
17813 931 50       3414 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpsimple]<< (return value: [}
17814             . $_tok . q{]},
17815              
17816             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17817             q{xpath},
17818             $tracelevel)
17819             if defined $::RD_TRACE;
17820 931         1959 $item{q{xpsimple}} = $_tok;
17821 931         1755 push @item, $_tok;
17822            
17823             }
17824              
17825            
17826              
17827 931 50       2066 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
17828             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17829             q{xpath},
17830             $tracelevel)
17831             if defined $::RD_TRACE;
17832 931         1268 $_tok = do { my $oldskip = $skip; $skip=""; $oldskip };
  931         1386  
  931         1541  
  931         1711  
17833 931 50       2061 if (defined($_tok))
17834             {
17835 931 50       1974 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
17836             . $_tok . q{])},
17837             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17838             if defined $::RD_TRACE;
17839             }
17840             else
17841             {
17842 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17843             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17844             if defined $::RD_TRACE;
17845             }
17846            
17847 931 50       1978 last unless defined $_tok;
17848 931         1940 push @item, $item{__DIRECTIVE1__}=$_tok;
17849            
17850              
17851 931 50       1873 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [xpcont]},
17852             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17853             q{xpath},
17854             $tracelevel)
17855             if defined $::RD_TRACE;
17856 931         2206 $expectation->is(q{xpcont})->at($text);
17857            
17858 931 50   931   5344 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpcont, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  931         1807  
17859             {
17860 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17861             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17862             q{xpath},
17863             $tracelevel)
17864             if defined $::RD_TRACE;
17865 0         0 last;
17866             }
17867 931 50       3072 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [xpcont]<< (}
17868             . @$_tok . q{ times)},
17869              
17870             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17871             q{xpath},
17872             $tracelevel)
17873             if defined $::RD_TRACE;
17874 931         2018 $item{q{xpcont(?)}} = $_tok;
17875 931         1563 push @item, $_tok;
17876            
17877              
17878              
17879 931 50       1802 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
17880             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17881             q{xpath},
17882             $tracelevel)
17883             if defined $::RD_TRACE;
17884            
17885              
17886 931 50       1697 $_tok = ($_noactions) ? 0 : do { $item[1].join("",@{$item[3]}) };
  931         1456  
  931         2877  
17887 931 50       1970 unless (defined $_tok)
17888             {
17889 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
17890             if defined $::RD_TRACE;
17891 0         0 last;
17892             }
17893 931 50       1884 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
17894             . $_tok . q{])},
17895             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17896             if defined $::RD_TRACE;
17897 931         1483 push @item, $_tok;
17898 931         1719 $item{__ACTION1__}=$_tok;
17899            
17900              
17901 931 50       1683 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xpsimple xpcont]<<},
17902             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17903             q{xpath},
17904             $tracelevel)
17905             if defined $::RD_TRACE;
17906              
17907              
17908              
17909 931         1366 $_matched = 1;
17910 931         1518 last;
17911             }
17912              
17913              
17914 2266         5265 while (!$_matched)
17915             {
17916            
17917 832 50       1705 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: []},
17918             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
17919             q{xpath},
17920             $tracelevel)
17921             if defined $::RD_TRACE;
17922 832         1632 my $thisprod = $thisrule->{"prods"}[2];
17923            
17924 832         1158 my $_savetext;
17925 832         1777 @item = (q{xpath});
17926 832         1717 %item = (__RULE__ => q{xpath});
17927 832         1280 my $repcount = 0;
17928              
17929              
17930            
17931              
17932 832 50       1665 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
17933             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17934             q{xpath},
17935             $tracelevel)
17936             if defined $::RD_TRACE;
17937 832 50       1115 $_tok = do { if (1) { do {push @{$thisparser->{errors}}, [qq{expected XPath, but got "}.substr($text,0,40).qq{ ..."},$thisline];} unless $_noactions; undef } else {0} };
  832         1055  
  832         1611  
  832         1092  
  832         5510  
  832         1705  
17938 832 50       1997 if (defined($_tok))
17939             {
17940 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
17941             . $_tok . q{])},
17942             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17943             if defined $::RD_TRACE;
17944             }
17945             else
17946             {
17947 832 50       1843 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17948             XML::XSH2::Parser::_Runtime::_tracefirst($text))
17949             if defined $::RD_TRACE;
17950             }
17951            
17952 832 50       1904 last unless defined $_tok;
17953 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
17954            
17955              
17956 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: []<<},
17957             XML::XSH2::Parser::_Runtime::_tracefirst($text),
17958             q{xpath},
17959             $tracelevel)
17960             if defined $::RD_TRACE;
17961              
17962              
17963              
17964 0         0 $_matched = 1;
17965 0         0 last;
17966             }
17967              
17968              
17969 2266 100 66     6013 unless ( $_matched || defined($score) )
17970             {
17971            
17972              
17973 832         1475 $_[1] = $text; # NOT SURE THIS IS NEEDED
17974 832 50       1583 XML::XSH2::Parser::_Runtime::_trace(q{<>},
17975             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
17976             q{xpath},
17977             $tracelevel)
17978             if defined $::RD_TRACE;
17979 832         5025 return undef;
17980             }
17981 1434 50 33     5111 if (!defined($return) && defined($score))
17982             {
17983 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
17984             q{xpath},
17985             $tracelevel)
17986             if defined $::RD_TRACE;
17987 0         0 $return = $score_return;
17988             }
17989 1434         1992 splice @{$thisparser->{errors}}, $err_at;
  1434         2876  
17990 1434 50       3915 $return = $item[$#item] unless defined $return;
17991 1434 50       2884 if (defined $::RD_TRACE)
17992             {
17993 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
17994             $return . q{])}, "",
17995             q{xpath},
17996             $tracelevel);
17997 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
17998             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
17999             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18000             , q{xpath},
18001             $tracelevel)
18002             }
18003 1434         2691 $_[1] = $text;
18004 1434         9511 return $return;
18005             }
18006              
18007             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
18008             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpaxis
18009             {
18010 0     0   0 my $thisparser = $_[0];
18011 8     8   72 use vars q{$tracelevel};
  8         18  
  8         6983  
18012 0   0     0 local $tracelevel = ($tracelevel||0)+1;
18013 0         0 $ERRORS = 0;
18014 0         0 my $thisrule = $thisparser->{"rules"}{"xpaxis"};
18015              
18016 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xpaxis]},
18017             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18018             q{xpaxis},
18019             $tracelevel)
18020             if defined $::RD_TRACE;
18021              
18022            
18023 0         0 my $err_at = @{$thisparser->{errors}};
  0         0  
18024              
18025 0         0 my $score;
18026             my $score_return;
18027 0         0 my $_tok;
18028 0         0 my $return = undef;
18029 0         0 my $_matched=0;
18030 0         0 my $commit=0;
18031 0         0 my @item = ();
18032 0         0 my %item = ();
18033 0         0 my $repeating = $_[2];
18034 0         0 my $_noactions = $_[3];
18035 0 0       0 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  0         0  
  0         0  
18036 0         0 my $_itempos = $_[5];
18037 0 0       0 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
18038 0         0 my $text;
18039             my $lastsep;
18040 0         0 my $current_match;
18041 0         0 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/[-a-z]+::/});
18042 0         0 $expectation->at($_[1]);
18043            
18044 0         0 my $thisoffset;
18045 0         0 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
18046            
18047 0         0 my $thiscolumn;
18048 0         0 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
18049            
18050 0         0 my $thisline;
18051 0         0 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
18052              
18053            
18054              
18055 0   0     0 while (!$_matched && !$commit)
18056             {
18057            
18058 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/[-a-z]+::/]},
18059             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18060             q{xpaxis},
18061             $tracelevel)
18062             if defined $::RD_TRACE;
18063 0         0 my $thisprod = $thisrule->{"prods"}[0];
18064 0         0 $text = $_[1];
18065 0         0 my $_savetext;
18066 0         0 @item = (q{xpaxis});
18067 0         0 %item = (__RULE__ => q{xpaxis});
18068 0         0 my $repcount = 0;
18069              
18070              
18071 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/[-a-z]+::/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
18072             q{xpaxis},
18073             $tracelevel)
18074             if defined $::RD_TRACE;
18075 0         0 undef $lastsep;
18076 0         0 $expectation->is(q{})->at($text);
18077            
18078              
18079 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:[-a-z]+::)/)
  0 0       0  
18080             {
18081 0 0       0 $text = $lastsep . $text if defined $lastsep;
18082 0         0 $expectation->failed();
18083 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18084             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18085             if defined $::RD_TRACE;
18086              
18087 0         0 last;
18088             }
18089 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
18090 0         0 substr($text,0,length($current_match),q{});
18091 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
18092             . $current_match . q{])},
18093             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18094             if defined $::RD_TRACE;
18095 0         0 push @item, $item{__PATTERN1__}=$current_match;
18096            
18097              
18098 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/[-a-z]+::/]<<},
18099             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18100             q{xpaxis},
18101             $tracelevel)
18102             if defined $::RD_TRACE;
18103              
18104              
18105              
18106 0         0 $_matched = 1;
18107 0         0 last;
18108             }
18109              
18110              
18111 0 0 0     0 unless ( $_matched || defined($score) )
18112             {
18113            
18114              
18115 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
18116 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18117             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18118             q{xpaxis},
18119             $tracelevel)
18120             if defined $::RD_TRACE;
18121 0         0 return undef;
18122             }
18123 0 0 0     0 if (!defined($return) && defined($score))
18124             {
18125 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
18126             q{xpaxis},
18127             $tracelevel)
18128             if defined $::RD_TRACE;
18129 0         0 $return = $score_return;
18130             }
18131 0         0 splice @{$thisparser->{errors}}, $err_at;
  0         0  
18132 0 0       0 $return = $item[$#item] unless defined $return;
18133 0 0       0 if (defined $::RD_TRACE)
18134             {
18135 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
18136             $return . q{])}, "",
18137             q{xpaxis},
18138             $tracelevel);
18139 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
18140             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
18141             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18142             , q{xpaxis},
18143             $tracelevel)
18144             }
18145 0         0 $_[1] = $text;
18146 0         0 return $return;
18147             }
18148              
18149             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
18150             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpbracket
18151             {
18152 839     839   1413 my $thisparser = $_[0];
18153 8     8   69 use vars q{$tracelevel};
  8         18  
  8         5645  
18154 839   50     1951 local $tracelevel = ($tracelevel||0)+1;
18155 839         1127 $ERRORS = 0;
18156 839         1628 my $thisrule = $thisparser->{"rules"}{"xpbracket"};
18157              
18158 839 50       1607 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xpbracket]},
18159             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18160             q{xpbracket},
18161             $tracelevel)
18162             if defined $::RD_TRACE;
18163              
18164            
18165 839         1112 my $err_at = @{$thisparser->{errors}};
  839         1415  
18166              
18167 839         1911 my $score;
18168             my $score_return;
18169 839         0 my $_tok;
18170 839         1167 my $return = undef;
18171 839         1023 my $_matched=0;
18172 839         1070 my $commit=0;
18173 839         1302 my @item = ();
18174 839         1249 my %item = ();
18175 839         1137 my $repeating = $_[2];
18176 839         1266 my $_noactions = $_[3];
18177 839 50       1610 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  839         1074  
  839         1301  
18178 839         1264 my $_itempos = $_[5];
18179 839 50       1829 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
18180 839         1872 my $text;
18181             my $lastsep;
18182 839         0 my $current_match;
18183 839         1622 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{'('});
18184 839         2086 $expectation->at($_[1]);
18185            
18186 839         1184 my $thisoffset;
18187 839         2574 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
18188            
18189 839         1251 my $thiscolumn;
18190 839         1929 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
18191            
18192 839         1270 my $thisline;
18193 839         1852 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
18194              
18195            
18196              
18197 839   33     3482 while (!$_matched && !$commit)
18198             {
18199 839 50       1857 local $skip = defined($skip) ? $skip : $XML::XSH2::Parser::_Runtime::skip;
18200 839 50       1606 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: ['(' xpinter ')']},
18201             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18202             q{xpbracket},
18203             $tracelevel)
18204             if defined $::RD_TRACE;
18205 839         1695 my $thisprod = $thisrule->{"prods"}[0];
18206 839         1456 $text = $_[1];
18207 839         1070 my $_savetext;
18208 839         1503 @item = (q{xpbracket});
18209 839         1558 %item = (__RULE__ => q{xpbracket});
18210 839         1159 my $repcount = 0;
18211              
18212              
18213 839 50       1567 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: ['(']},
18214             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18215             q{xpbracket},
18216             $tracelevel)
18217             if defined $::RD_TRACE;
18218 839         1438 undef $lastsep;
18219 839         1658 $expectation->is(q{})->at($text);
18220            
18221              
18222 839 50 33     8415 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A\(/)
  839 50       7234  
18223             {
18224 0 0       0 $text = $lastsep . $text if defined $lastsep;
18225            
18226 0         0 $expectation->failed();
18227 0 0       0 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
18228             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18229             if defined $::RD_TRACE;
18230 0         0 last;
18231             }
18232 839         5385 $current_match = substr($text, $-[0], $+[0] - $-[0]);
18233 839         3004 substr($text,0,length($current_match),q{});
18234 839 50       1796 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
18235             . $current_match . q{])},
18236             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18237             if defined $::RD_TRACE;
18238 839         2242 push @item, $item{__STRING1__}=$current_match;
18239            
18240              
18241            
18242              
18243 839 50       1585 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
18244             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18245             q{xpbracket},
18246             $tracelevel)
18247             if defined $::RD_TRACE;
18248 839         1075 $_tok = do { my $oldskip = $skip; $skip=""; $oldskip };
  839         1261  
  839         1325  
  839         1511  
18249 839 50       1709 if (defined($_tok))
18250             {
18251 839 50       1763 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
18252             . $_tok . q{])},
18253             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18254             if defined $::RD_TRACE;
18255             }
18256             else
18257             {
18258 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18259             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18260             if defined $::RD_TRACE;
18261             }
18262            
18263 839 50       1662 last unless defined $_tok;
18264 839         1856 push @item, $item{__DIRECTIVE1__}=$_tok;
18265            
18266              
18267 839 50       1609 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpinter]},
18268             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18269             q{xpbracket},
18270             $tracelevel)
18271             if defined $::RD_TRACE;
18272 8     8   69 if (1) { no strict qw{refs};
  8         20  
  8         6274  
  839         1092  
18273 839         1787 $expectation->is(q{xpinter})->at($text);
18274 839 50   839   4789 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpinter($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  839         1623  
18275             {
18276            
18277 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18278             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18279             q{xpbracket},
18280             $tracelevel)
18281             if defined $::RD_TRACE;
18282 0         0 $expectation->failed();
18283 0         0 last;
18284             }
18285 839 50       2642 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpinter]<< (return value: [}
18286             . $_tok . q{]},
18287              
18288             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18289             q{xpbracket},
18290             $tracelevel)
18291             if defined $::RD_TRACE;
18292 839         1763 $item{q{xpinter}} = $_tok;
18293 839         1423 push @item, $_tok;
18294            
18295             }
18296              
18297 839 50       1561 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [')']},
18298             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18299             q{xpbracket},
18300             $tracelevel)
18301             if defined $::RD_TRACE;
18302 839         1356 undef $lastsep;
18303 839         1881 $expectation->is(q{')'})->at($text);
18304            
18305              
18306 839 50 33     4635 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A\)/)
  839 50       6826  
18307             {
18308 0 0       0 $text = $lastsep . $text if defined $lastsep;
18309            
18310 0         0 $expectation->failed();
18311 0 0       0 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
18312             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18313             if defined $::RD_TRACE;
18314 0         0 last;
18315             }
18316 839         4524 $current_match = substr($text, $-[0], $+[0] - $-[0]);
18317 839         2892 substr($text,0,length($current_match),q{});
18318 839 50       1730 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
18319             . $current_match . q{])},
18320             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18321             if defined $::RD_TRACE;
18322 839         2064 push @item, $item{__STRING2__}=$current_match;
18323            
18324              
18325 839 50       1614 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
18326             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18327             q{xpbracket},
18328             $tracelevel)
18329             if defined $::RD_TRACE;
18330            
18331              
18332 839 50       1471 $_tok = ($_noactions) ? 0 : do { "($item[3])" };
  839         1914  
18333 839 50       1584 unless (defined $_tok)
18334             {
18335 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
18336             if defined $::RD_TRACE;
18337 0         0 last;
18338             }
18339 839 50       1578 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
18340             . $_tok . q{])},
18341             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18342             if defined $::RD_TRACE;
18343 839         1331 push @item, $_tok;
18344 839         1309 $item{__ACTION1__}=$_tok;
18345            
18346              
18347 839 50       1611 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: ['(' xpinter ')']<<},
18348             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18349             q{xpbracket},
18350             $tracelevel)
18351             if defined $::RD_TRACE;
18352              
18353              
18354              
18355 839         1099 $_matched = 1;
18356 839         1714 last;
18357             }
18358              
18359              
18360 839 50 33     1814 unless ( $_matched || defined($score) )
18361             {
18362            
18363              
18364 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
18365 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18366             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18367             q{xpbracket},
18368             $tracelevel)
18369             if defined $::RD_TRACE;
18370 0         0 return undef;
18371             }
18372 839 50 33     2859 if (!defined($return) && defined($score))
18373             {
18374 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
18375             q{xpbracket},
18376             $tracelevel)
18377             if defined $::RD_TRACE;
18378 0         0 $return = $score_return;
18379             }
18380 839         1089 splice @{$thisparser->{errors}}, $err_at;
  839         1608  
18381 839 50       1985 $return = $item[$#item] unless defined $return;
18382 839 50       1688 if (defined $::RD_TRACE)
18383             {
18384 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
18385             $return . q{])}, "",
18386             q{xpbracket},
18387             $tracelevel);
18388 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
18389             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
18390             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18391             , q{xpbracket},
18392             $tracelevel)
18393             }
18394 839         1667 $_[1] = $text;
18395 839         5753 return $return;
18396             }
18397              
18398             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
18399             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpbrackets
18400             {
18401 3439     3439   5619 my $thisparser = $_[0];
18402 8     8   74 use vars q{$tracelevel};
  8         30  
  8         4989  
18403 3439   50     7954 local $tracelevel = ($tracelevel||0)+1;
18404 3439         4717 $ERRORS = 0;
18405 3439         6521 my $thisrule = $thisparser->{"rules"}{"xpbrackets"};
18406              
18407 3439 50       6005 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xpbrackets]},
18408             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18409             q{xpbrackets},
18410             $tracelevel)
18411             if defined $::RD_TRACE;
18412              
18413            
18414 3439         4095 my $err_at = @{$thisparser->{errors}};
  3439         5712  
18415              
18416 3439         7855 my $score;
18417             my $score_return;
18418 3439         0 my $_tok;
18419 3439         4304 my $return = undef;
18420 3439         4578 my $_matched=0;
18421 3439         4644 my $commit=0;
18422 3439         5185 my @item = ();
18423 3439         4503 my %item = ();
18424 3439         4686 my $repeating = $_[2];
18425 3439         4835 my $_noactions = $_[3];
18426 3439 50       6133 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  3439         4158  
  3439         5559  
18427 3439         4831 my $_itempos = $_[5];
18428 3439 50       6964 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
18429 3439         7471 my $text;
18430             my $lastsep;
18431 3439         0 my $current_match;
18432 3439         7245 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(?=\\()/});
18433 3439         8024 $expectation->at($_[1]);
18434            
18435 3439         4345 my $thisoffset;
18436 3439         9996 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
18437            
18438 3439         5072 my $thiscolumn;
18439 3439         7774 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
18440            
18441 3439         5022 my $thisline;
18442 3439         7403 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
18443              
18444            
18445              
18446 3439   33     11946 while (!$_matched && !$commit)
18447             {
18448 3439 50       7040 local $skip = defined($skip) ? $skip : $XML::XSH2::Parser::_Runtime::skip;
18449 3439 50       6358 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?=\\()/ xpbracket xpfilters]},
18450             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18451             q{xpbrackets},
18452             $tracelevel)
18453             if defined $::RD_TRACE;
18454 3439         6444 my $thisprod = $thisrule->{"prods"}[0];
18455 3439         4989 $text = $_[1];
18456 3439         4253 my $_savetext;
18457 3439         5898 @item = (q{xpbrackets});
18458 3439         5643 %item = (__RULE__ => q{xpbrackets});
18459 3439         4667 my $repcount = 0;
18460              
18461              
18462 3439 50       6001 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?=\\()/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
18463             q{xpbrackets},
18464             $tracelevel)
18465             if defined $::RD_TRACE;
18466 3439         5722 undef $lastsep;
18467 3439         6404 $expectation->is(q{})->at($text);
18468            
18469              
18470 3439 100 66     24051 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?=\())/)
  3439 100       25832  
18471             {
18472 2600 50       7723 $text = $lastsep . $text if defined $lastsep;
18473 2600         6636 $expectation->failed();
18474 2600 50       5046 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18475             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18476             if defined $::RD_TRACE;
18477              
18478 2600         5330 last;
18479             }
18480 839         5046 $current_match = substr($text, $-[0], $+[0] - $-[0]);
18481 839         2942 substr($text,0,length($current_match),q{});
18482 839 50       1792 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
18483             . $current_match . q{])},
18484             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18485             if defined $::RD_TRACE;
18486 839         2109 push @item, $item{__PATTERN1__}=$current_match;
18487            
18488              
18489 839 50       1592 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpbracket]},
18490             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18491             q{xpbrackets},
18492             $tracelevel)
18493             if defined $::RD_TRACE;
18494 8     8   76 if (1) { no strict qw{refs};
  8         17  
  8         6839  
  839         1077  
18495 839         2051 $expectation->is(q{xpbracket})->at($text);
18496 839 50   839   4410 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpbracket($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  839         1464  
18497             {
18498            
18499 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18500             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18501             q{xpbrackets},
18502             $tracelevel)
18503             if defined $::RD_TRACE;
18504 0         0 $expectation->failed();
18505 0         0 last;
18506             }
18507 839 50       2821 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpbracket]<< (return value: [}
18508             . $_tok . q{]},
18509              
18510             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18511             q{xpbrackets},
18512             $tracelevel)
18513             if defined $::RD_TRACE;
18514 839         1653 $item{q{xpbracket}} = $_tok;
18515 839         1506 push @item, $_tok;
18516            
18517             }
18518              
18519            
18520              
18521 839 50       1705 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
18522             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18523             q{xpbrackets},
18524             $tracelevel)
18525             if defined $::RD_TRACE;
18526 839         1113 $_tok = do { my $oldskip = $skip; $skip=""; $oldskip };
  839         1236  
  839         1338  
  839         1357  
18527 839 50       1701 if (defined($_tok))
18528             {
18529 839 50       1625 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
18530             . $_tok . q{])},
18531             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18532             if defined $::RD_TRACE;
18533             }
18534             else
18535             {
18536 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18537             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18538             if defined $::RD_TRACE;
18539             }
18540            
18541 839 50       1534 last unless defined $_tok;
18542 839         1663 push @item, $item{__DIRECTIVE1__}=$_tok;
18543            
18544              
18545 839 50       1644 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [xpfilters]},
18546             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18547             q{xpbrackets},
18548             $tracelevel)
18549             if defined $::RD_TRACE;
18550 839         1802 $expectation->is(q{xpfilters})->at($text);
18551            
18552 839 50   839   4191 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpfilters, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  839         1626  
18553             {
18554 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18555             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18556             q{xpbrackets},
18557             $tracelevel)
18558             if defined $::RD_TRACE;
18559 0         0 last;
18560             }
18561 839 50       2802 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [xpfilters]<< (}
18562             . @$_tok . q{ times)},
18563              
18564             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18565             q{xpbrackets},
18566             $tracelevel)
18567             if defined $::RD_TRACE;
18568 839         1750 $item{q{xpfilters(?)}} = $_tok;
18569 839         1393 push @item, $_tok;
18570            
18571              
18572              
18573 839 50       1593 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
18574             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18575             q{xpbrackets},
18576             $tracelevel)
18577             if defined $::RD_TRACE;
18578            
18579              
18580 839 50       1478 $_tok = ($_noactions) ? 0 : do { join "",$item[2],@{$item[4]} };
  839         1093  
  839         2273  
18581 839 50       1668 unless (defined $_tok)
18582             {
18583 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
18584             if defined $::RD_TRACE;
18585 0         0 last;
18586             }
18587 839 50       1474 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
18588             . $_tok . q{])},
18589             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18590             if defined $::RD_TRACE;
18591 839         1360 push @item, $_tok;
18592 839         1434 $item{__ACTION1__}=$_tok;
18593            
18594              
18595 839 50       1580 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?=\\()/ xpbracket xpfilters]<<},
18596             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18597             q{xpbrackets},
18598             $tracelevel)
18599             if defined $::RD_TRACE;
18600              
18601              
18602              
18603 839         1179 $_matched = 1;
18604 839         1613 last;
18605             }
18606              
18607              
18608 3439 100 66     10923 unless ( $_matched || defined($score) )
18609             {
18610            
18611              
18612 2600         4272 $_[1] = $text; # NOT SURE THIS IS NEEDED
18613 2600 50       4657 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18614             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18615             q{xpbrackets},
18616             $tracelevel)
18617             if defined $::RD_TRACE;
18618 2600         14303 return undef;
18619             }
18620 839 50 33     2898 if (!defined($return) && defined($score))
18621             {
18622 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
18623             q{xpbrackets},
18624             $tracelevel)
18625             if defined $::RD_TRACE;
18626 0         0 $return = $score_return;
18627             }
18628 839         1098 splice @{$thisparser->{errors}}, $err_at;
  839         1773  
18629 839 50       2116 $return = $item[$#item] unless defined $return;
18630 839 50       2007 if (defined $::RD_TRACE)
18631             {
18632 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
18633             $return . q{])}, "",
18634             q{xpbrackets},
18635             $tracelevel);
18636 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
18637             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
18638             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18639             , q{xpbrackets},
18640             $tracelevel)
18641             }
18642 839         1741 $_[1] = $text;
18643 839         5559 return $return;
18644             }
18645              
18646             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
18647             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpcont
18648             {
18649 931     931   1458 my $thisparser = $_[0];
18650 8     8   65 use vars q{$tracelevel};
  8         20  
  8         3379  
18651 931   50     2371 local $tracelevel = ($tracelevel||0)+1;
18652 931         1462 $ERRORS = 0;
18653 931         1894 my $thisrule = $thisparser->{"rules"}{"xpcont"};
18654              
18655 931 50       1863 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xpcont]},
18656             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18657             q{xpcont},
18658             $tracelevel)
18659             if defined $::RD_TRACE;
18660              
18661            
18662 931         1242 my $err_at = @{$thisparser->{errors}};
  931         1540  
18663              
18664 931         2039 my $score;
18665             my $score_return;
18666 931         0 my $_tok;
18667 931         1519 my $return = undef;
18668 931         1200 my $_matched=0;
18669 931         1356 my $commit=0;
18670 931         1423 my @item = ();
18671 931         1396 my %item = ();
18672 931         1380 my $repeating = $_[2];
18673 931         1266 my $_noactions = $_[3];
18674 931 50       1762 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  931         1538  
  931         1570  
18675 931         1474 my $_itempos = $_[5];
18676 931 50       2147 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
18677 931         2125 my $text;
18678             my $lastsep;
18679 931         0 my $current_match;
18680 931         2097 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{xpfilters, or xpbrackets, or xpath});
18681 931         2303 $expectation->at($_[1]);
18682            
18683 931         1235 my $thisoffset;
18684 931         3010 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
18685            
18686 931         1486 my $thiscolumn;
18687 931         2244 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
18688            
18689 931         1426 my $thisline;
18690 931         2257 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
18691              
18692            
18693              
18694 931   33     3860 while (!$_matched && !$commit)
18695             {
18696 931 50       2069 local $skip = defined($skip) ? $skip : $XML::XSH2::Parser::_Runtime::skip;
18697 931 50       1987 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xpfilters, or xpbrackets xpath]},
18698             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18699             q{xpcont},
18700             $tracelevel)
18701             if defined $::RD_TRACE;
18702 931         1937 my $thisprod = $thisrule->{"prods"}[0];
18703 931         1518 $text = $_[1];
18704 931         1329 my $_savetext;
18705 931         1732 @item = (q{xpcont});
18706 931         1776 %item = (__RULE__ => q{xpcont});
18707 931         1358 my $repcount = 0;
18708              
18709              
18710 931 50       1847 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [_alternation_1_of_production_1_of_rule_xpcont]},
18711             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18712             q{xpcont},
18713             $tracelevel)
18714             if defined $::RD_TRACE;
18715 8     8   66 if (1) { no strict qw{refs};
  8         25  
  8         5629  
  931         1287  
18716 931         1823 $expectation->is(q{})->at($text);
18717 931 100   931   4443 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::_alternation_1_of_production_1_of_rule_xpcont($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  931         1655  
18718             {
18719            
18720 618 50       1276 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18721             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18722             q{xpcont},
18723             $tracelevel)
18724             if defined $::RD_TRACE;
18725 618         1733 $expectation->failed();
18726 618         1166 last;
18727             }
18728 313 50       1115 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_xpcont]<< (return value: [}
18729             . $_tok . q{]},
18730              
18731             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18732             q{xpcont},
18733             $tracelevel)
18734             if defined $::RD_TRACE;
18735 313         735 $item{q{_alternation_1_of_production_1_of_rule_xpcont}} = $_tok;
18736 313         624 push @item, $_tok;
18737            
18738             }
18739              
18740            
18741              
18742 313 50       761 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
18743             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18744             q{xpcont},
18745             $tracelevel)
18746             if defined $::RD_TRACE;
18747 313         403 $_tok = do { my $oldskip = $skip; $skip=""; $oldskip };
  313         476  
  313         518  
  313         553  
18748 313 50       678 if (defined($_tok))
18749             {
18750 313 50       655 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
18751             . $_tok . q{])},
18752             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18753             if defined $::RD_TRACE;
18754             }
18755             else
18756             {
18757 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18758             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18759             if defined $::RD_TRACE;
18760             }
18761            
18762 313 50       693 last unless defined $_tok;
18763 313         632 push @item, $item{__DIRECTIVE1__}=$_tok;
18764            
18765              
18766 313 50       717 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [xpath]},
18767             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18768             q{xpcont},
18769             $tracelevel)
18770             if defined $::RD_TRACE;
18771 313         819 $expectation->is(q{xpath})->at($text);
18772            
18773 313 50   313   1882 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpath, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  313         632  
18774             {
18775 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18776             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18777             q{xpcont},
18778             $tracelevel)
18779             if defined $::RD_TRACE;
18780 0         0 last;
18781             }
18782 313 50       1177 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [xpath]<< (}
18783             . @$_tok . q{ times)},
18784              
18785             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18786             q{xpcont},
18787             $tracelevel)
18788             if defined $::RD_TRACE;
18789 313         758 $item{q{xpath(?)}} = $_tok;
18790 313         708 push @item, $_tok;
18791            
18792              
18793              
18794 313 50       690 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
18795             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18796             q{xpcont},
18797             $tracelevel)
18798             if defined $::RD_TRACE;
18799            
18800              
18801 313 50       641 $_tok = ($_noactions) ? 0 : do { $item[1].join("",@{$item[3]}) };
  313         505  
  313         920  
18802 313 50       814 unless (defined $_tok)
18803             {
18804 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
18805             if defined $::RD_TRACE;
18806 0         0 last;
18807             }
18808 313 50       1216 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
18809             . $_tok . q{])},
18810             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18811             if defined $::RD_TRACE;
18812 313         552 push @item, $_tok;
18813 313         600 $item{__ACTION1__}=$_tok;
18814            
18815              
18816 313 50       725 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xpfilters, or xpbrackets xpath]<<},
18817             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18818             q{xpcont},
18819             $tracelevel)
18820             if defined $::RD_TRACE;
18821              
18822              
18823              
18824 313         506 $_matched = 1;
18825 313         606 last;
18826             }
18827              
18828              
18829 931   66     3754 while (!$_matched && !$commit)
18830             {
18831            
18832 618 50       1282 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xpath]},
18833             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18834             q{xpcont},
18835             $tracelevel)
18836             if defined $::RD_TRACE;
18837 618         1182 my $thisprod = $thisrule->{"prods"}[1];
18838 618         1124 $text = $_[1];
18839 618         848 my $_savetext;
18840 618         1350 @item = (q{xpcont});
18841 618         1417 %item = (__RULE__ => q{xpcont});
18842 618         914 my $repcount = 0;
18843              
18844              
18845 618 50       1238 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpath]},
18846             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18847             q{xpcont},
18848             $tracelevel)
18849             if defined $::RD_TRACE;
18850 8     8   67 if (1) { no strict qw{refs};
  8         17  
  8         4585  
  618         913  
18851 618         1272 $expectation->is(q{})->at($text);
18852 618 100   618   3035 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpath($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  618         1128  
18853             {
18854            
18855 516 50       1072 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18856             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18857             q{xpcont},
18858             $tracelevel)
18859             if defined $::RD_TRACE;
18860 516         1285 $expectation->failed();
18861 516         849 last;
18862             }
18863 102 50       367 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpath]<< (return value: [}
18864             . $_tok . q{]},
18865              
18866             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18867             q{xpcont},
18868             $tracelevel)
18869             if defined $::RD_TRACE;
18870 102         240 $item{q{xpath}} = $_tok;
18871 102         201 push @item, $_tok;
18872            
18873             }
18874              
18875 102 50       221 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
18876             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18877             q{xpcont},
18878             $tracelevel)
18879             if defined $::RD_TRACE;
18880            
18881              
18882 102 50       546 $_tok = ($_noactions) ? 0 : do { $item[1] };
  102         218  
18883 102 50       218 unless (defined $_tok)
18884             {
18885 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
18886             if defined $::RD_TRACE;
18887 0         0 last;
18888             }
18889 102 50       197 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
18890             . $_tok . q{])},
18891             XML::XSH2::Parser::_Runtime::_tracefirst($text))
18892             if defined $::RD_TRACE;
18893 102         163 push @item, $_tok;
18894 102         180 $item{__ACTION1__}=$_tok;
18895            
18896              
18897 102 50       190 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xpath]<<},
18898             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18899             q{xpcont},
18900             $tracelevel)
18901             if defined $::RD_TRACE;
18902              
18903              
18904              
18905 102         136 $_matched = 1;
18906 102         166 last;
18907             }
18908              
18909              
18910 931 100 66     3497 unless ( $_matched || defined($score) )
18911             {
18912            
18913              
18914 516         1114 $_[1] = $text; # NOT SURE THIS IS NEEDED
18915 516 50       1168 XML::XSH2::Parser::_Runtime::_trace(q{<>},
18916             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18917             q{xpcont},
18918             $tracelevel)
18919             if defined $::RD_TRACE;
18920 516         2775 return undef;
18921             }
18922 415 50 33     1642 if (!defined($return) && defined($score))
18923             {
18924 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
18925             q{xpcont},
18926             $tracelevel)
18927             if defined $::RD_TRACE;
18928 0         0 $return = $score_return;
18929             }
18930 415         641 splice @{$thisparser->{errors}}, $err_at;
  415         969  
18931 415 50       1270 $return = $item[$#item] unless defined $return;
18932 415 50       908 if (defined $::RD_TRACE)
18933             {
18934 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
18935             $return . q{])}, "",
18936             q{xpcont},
18937             $tracelevel);
18938 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
18939             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
18940             XML::XSH2::Parser::_Runtime::_tracefirst($text),
18941             , q{xpcont},
18942             $tracelevel)
18943             }
18944 415         921 $_[1] = $text;
18945 415         2547 return $return;
18946             }
18947              
18948             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
18949             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpfilter
18950             {
18951 240     240   380 my $thisparser = $_[0];
18952 8     8   77 use vars q{$tracelevel};
  8         19  
  8         4959  
18953 240   50     571 local $tracelevel = ($tracelevel||0)+1;
18954 240         350 $ERRORS = 0;
18955 240         466 my $thisrule = $thisparser->{"rules"}{"xpfilter"};
18956              
18957 240 50       521 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xpfilter]},
18958             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
18959             q{xpfilter},
18960             $tracelevel)
18961             if defined $::RD_TRACE;
18962              
18963            
18964 240         309 my $err_at = @{$thisparser->{errors}};
  240         423  
18965              
18966 240         629 my $score;
18967             my $score_return;
18968 240         0 my $_tok;
18969 240         320 my $return = undef;
18970 240         312 my $_matched=0;
18971 240         313 my $commit=0;
18972 240         371 my @item = ();
18973 240         348 my %item = ();
18974 240         333 my $repeating = $_[2];
18975 240         331 my $_noactions = $_[3];
18976 240 50       466 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  240         336  
  240         426  
18977 240         372 my $_itempos = $_[5];
18978 240 50       536 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
18979 240         516 my $text;
18980             my $lastsep;
18981 240         0 my $current_match;
18982 240         497 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{'['});
18983 240         583 $expectation->at($_[1]);
18984            
18985 240         294 my $thisoffset;
18986 240         732 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
18987            
18988 240         355 my $thiscolumn;
18989 240         611 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
18990            
18991 240         399 my $thisline;
18992 240         571 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
18993              
18994            
18995              
18996 240   33     1060 while (!$_matched && !$commit)
18997             {
18998            
18999 240 50       501 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: ['[' xpinter ']']},
19000             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19001             q{xpfilter},
19002             $tracelevel)
19003             if defined $::RD_TRACE;
19004 240         480 my $thisprod = $thisrule->{"prods"}[0];
19005 240         374 $text = $_[1];
19006 240         334 my $_savetext;
19007 240         423 @item = (q{xpfilter});
19008 240         463 %item = (__RULE__ => q{xpfilter});
19009 240         353 my $repcount = 0;
19010              
19011              
19012 240 50       478 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: ['[']},
19013             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19014             q{xpfilter},
19015             $tracelevel)
19016             if defined $::RD_TRACE;
19017 240         410 undef $lastsep;
19018 240         476 $expectation->is(q{})->at($text);
19019            
19020              
19021 240 50 66     1479 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A\[/)
  240 100       1923  
19022             {
19023 120 50       409 $text = $lastsep . $text if defined $lastsep;
19024            
19025 120         342 $expectation->failed();
19026 120 50       274 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
19027             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19028             if defined $::RD_TRACE;
19029 120         226 last;
19030             }
19031 120         692 $current_match = substr($text, $-[0], $+[0] - $-[0]);
19032 120         444 substr($text,0,length($current_match),q{});
19033 120 50       450 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
19034             . $current_match . q{])},
19035             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19036             if defined $::RD_TRACE;
19037 120         325 push @item, $item{__STRING1__}=$current_match;
19038            
19039              
19040 120 50       293 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpinter]},
19041             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19042             q{xpfilter},
19043             $tracelevel)
19044             if defined $::RD_TRACE;
19045 8     8   67 if (1) { no strict qw{refs};
  8         19  
  8         6264  
  120         172  
19046 120         286 $expectation->is(q{xpinter})->at($text);
19047 120 50   120   761 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpinter($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  120         221  
19048             {
19049            
19050 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19051             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19052             q{xpfilter},
19053             $tracelevel)
19054             if defined $::RD_TRACE;
19055 0         0 $expectation->failed();
19056 0         0 last;
19057             }
19058 120 50       440 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpinter]<< (return value: [}
19059             . $_tok . q{]},
19060              
19061             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19062             q{xpfilter},
19063             $tracelevel)
19064             if defined $::RD_TRACE;
19065 120         262 $item{q{xpinter}} = $_tok;
19066 120         216 push @item, $_tok;
19067            
19068             }
19069              
19070 120 50       262 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [']']},
19071             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19072             q{xpfilter},
19073             $tracelevel)
19074             if defined $::RD_TRACE;
19075 120         190 undef $lastsep;
19076 120         313 $expectation->is(q{']'})->at($text);
19077            
19078              
19079 120 50 33     762 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A\]/)
  120 50       1142  
19080             {
19081 0 0       0 $text = $lastsep . $text if defined $lastsep;
19082            
19083 0         0 $expectation->failed();
19084 0 0       0 XML::XSH2::Parser::_Runtime::_trace(qq{<>},
19085             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19086             if defined $::RD_TRACE;
19087 0         0 last;
19088             }
19089 120         695 $current_match = substr($text, $-[0], $+[0] - $-[0]);
19090 120         440 substr($text,0,length($current_match),q{});
19091 120 50       288 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
19092             . $current_match . q{])},
19093             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19094             if defined $::RD_TRACE;
19095 120         360 push @item, $item{__STRING2__}=$current_match;
19096            
19097              
19098 120 50       285 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
19099             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19100             q{xpfilter},
19101             $tracelevel)
19102             if defined $::RD_TRACE;
19103            
19104              
19105 120 50       269 $_tok = ($_noactions) ? 0 : do { "[$item[2]]" };
  120         331  
19106 120 50       258 unless (defined $_tok)
19107             {
19108 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
19109             if defined $::RD_TRACE;
19110 0         0 last;
19111             }
19112 120 50       259 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
19113             . $_tok . q{])},
19114             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19115             if defined $::RD_TRACE;
19116 120         214 push @item, $_tok;
19117 120         228 $item{__ACTION1__}=$_tok;
19118            
19119              
19120 120 50       262 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: ['[' xpinter ']']<<},
19121             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19122             q{xpfilter},
19123             $tracelevel)
19124             if defined $::RD_TRACE;
19125              
19126              
19127              
19128 120         191 $_matched = 1;
19129 120         237 last;
19130             }
19131              
19132              
19133 240 100 66     811 unless ( $_matched || defined($score) )
19134             {
19135            
19136              
19137 120         233 $_[1] = $text; # NOT SURE THIS IS NEEDED
19138 120 50       264 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19139             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19140             q{xpfilter},
19141             $tracelevel)
19142             if defined $::RD_TRACE;
19143 120         640 return undef;
19144             }
19145 120 50 33     534 if (!defined($return) && defined($score))
19146             {
19147 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
19148             q{xpfilter},
19149             $tracelevel)
19150             if defined $::RD_TRACE;
19151 0         0 $return = $score_return;
19152             }
19153 120         177 splice @{$thisparser->{errors}}, $err_at;
  120         283  
19154 120 50       364 $return = $item[$#item] unless defined $return;
19155 120 50       279 if (defined $::RD_TRACE)
19156             {
19157 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
19158             $return . q{])}, "",
19159             q{xpfilter},
19160             $tracelevel);
19161 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
19162             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
19163             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19164             , q{xpfilter},
19165             $tracelevel)
19166             }
19167 120         310 $_[1] = $text;
19168 120         845 return $return;
19169             }
19170              
19171             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
19172             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpfilters
19173             {
19174 3417     3417   5806 my $thisparser = $_[0];
19175 8     8   63 use vars q{$tracelevel};
  8         20  
  8         8854  
19176 3417   50     8057 local $tracelevel = ($tracelevel||0)+1;
19177 3417         4853 $ERRORS = 0;
19178 3417         6404 my $thisrule = $thisparser->{"rules"}{"xpfilters"};
19179              
19180 3417 50       6846 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xpfilters]},
19181             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19182             q{xpfilters},
19183             $tracelevel)
19184             if defined $::RD_TRACE;
19185              
19186            
19187 3417         4152 my $err_at = @{$thisparser->{errors}};
  3417         5818  
19188              
19189 3417         7231 my $score;
19190             my $score_return;
19191 3417         0 my $_tok;
19192 3417         4521 my $return = undef;
19193 3417         4365 my $_matched=0;
19194 3417         4086 my $commit=0;
19195 3417         4642 my @item = ();
19196 3417         4748 my %item = ();
19197 3417         4477 my $repeating = $_[2];
19198 3417         4384 my $_noactions = $_[3];
19199 3417 50       5747 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  3417         4344  
  3417         5309  
19200 3417         4909 my $_itempos = $_[5];
19201 3417 50       7637 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
19202 3417         7156 my $text;
19203             my $lastsep;
19204 3417         0 my $current_match;
19205 3417         6424 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(?=\\[)/});
19206 3417         7954 $expectation->at($_[1]);
19207            
19208 3417         4132 my $thisoffset;
19209 3417         9068 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
19210            
19211 3417         5618 my $thiscolumn;
19212 3417         7190 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
19213            
19214 3417         4758 my $thisline;
19215 3417         7238 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
19216              
19217            
19218              
19219 3417   33     12508 while (!$_matched && !$commit)
19220             {
19221            
19222 3417 50       6785 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?=\\[)/ xpfilter]},
19223             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19224             q{xpfilters},
19225             $tracelevel)
19226             if defined $::RD_TRACE;
19227 3417         6598 my $thisprod = $thisrule->{"prods"}[0];
19228 3417         5679 $text = $_[1];
19229 3417         4025 my $_savetext;
19230 3417         5912 @item = (q{xpfilters});
19231 3417         6053 %item = (__RULE__ => q{xpfilters});
19232 3417         4931 my $repcount = 0;
19233              
19234              
19235 3417 50       5879 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?=\\[)/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
19236             q{xpfilters},
19237             $tracelevel)
19238             if defined $::RD_TRACE;
19239 3417         5543 undef $lastsep;
19240 3417         6493 $expectation->is(q{})->at($text);
19241            
19242              
19243 3417 50 66     22193 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?=\[))/)
  3417 100       26667  
19244             {
19245 3297 50       10166 $text = $lastsep . $text if defined $lastsep;
19246 3297         8834 $expectation->failed();
19247 3297 50       5821 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19248             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19249             if defined $::RD_TRACE;
19250              
19251 3297         6576 last;
19252             }
19253 120         758 $current_match = substr($text, $-[0], $+[0] - $-[0]);
19254 120         557 substr($text,0,length($current_match),q{});
19255 120 50       302 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
19256             . $current_match . q{])},
19257             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19258             if defined $::RD_TRACE;
19259 120         335 push @item, $item{__PATTERN1__}=$current_match;
19260            
19261              
19262 120 50       290 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [xpfilter]},
19263             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19264             q{xpfilters},
19265             $tracelevel)
19266             if defined $::RD_TRACE;
19267 120         298 $expectation->is(q{xpfilter})->at($text);
19268            
19269 120 50   240   718 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpfilter, 1, 100000000, $_noactions,$expectation,sub { \@arg },undef)))
  240         455  
19270             {
19271 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19272             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19273             q{xpfilters},
19274             $tracelevel)
19275             if defined $::RD_TRACE;
19276 0         0 last;
19277             }
19278 120 50       466 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [xpfilter]<< (}
19279             . @$_tok . q{ times)},
19280              
19281             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19282             q{xpfilters},
19283             $tracelevel)
19284             if defined $::RD_TRACE;
19285 120         286 $item{q{xpfilter(s)}} = $_tok;
19286 120         201 push @item, $_tok;
19287            
19288              
19289              
19290 120 50       279 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
19291             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19292             q{xpfilters},
19293             $tracelevel)
19294             if defined $::RD_TRACE;
19295            
19296              
19297 120 50       242 $_tok = ($_noactions) ? 0 : do { join("",@{$item[2]}) };
  120         167  
  120         337  
19298 120 50       312 unless (defined $_tok)
19299             {
19300 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
19301             if defined $::RD_TRACE;
19302 0         0 last;
19303             }
19304 120 50       250 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
19305             . $_tok . q{])},
19306             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19307             if defined $::RD_TRACE;
19308 120         185 push @item, $_tok;
19309 120         247 $item{__ACTION1__}=$_tok;
19310            
19311              
19312 120 50       297 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?=\\[)/ xpfilter]<<},
19313             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19314             q{xpfilters},
19315             $tracelevel)
19316             if defined $::RD_TRACE;
19317              
19318              
19319              
19320 120         166 $_matched = 1;
19321 120         201 last;
19322             }
19323              
19324              
19325 3417 100 66     11289 unless ( $_matched || defined($score) )
19326             {
19327            
19328              
19329 3297         5384 $_[1] = $text; # NOT SURE THIS IS NEEDED
19330 3297 50       5745 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19331             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19332             q{xpfilters},
19333             $tracelevel)
19334             if defined $::RD_TRACE;
19335 3297         18893 return undef;
19336             }
19337 120 50 33     529 if (!defined($return) && defined($score))
19338             {
19339 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
19340             q{xpfilters},
19341             $tracelevel)
19342             if defined $::RD_TRACE;
19343 0         0 $return = $score_return;
19344             }
19345 120         178 splice @{$thisparser->{errors}}, $err_at;
  120         257  
19346 120 50       377 $return = $item[$#item] unless defined $return;
19347 120 50       279 if (defined $::RD_TRACE)
19348             {
19349 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
19350             $return . q{])}, "",
19351             q{xpfilters},
19352             $tracelevel);
19353 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
19354             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
19355             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19356             , q{xpfilters},
19357             $tracelevel)
19358             }
19359 120         298 $_[1] = $text;
19360 120         862 return $return;
19361             }
19362              
19363             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
19364             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpinter
19365             {
19366 1647     1647   2599 my $thisparser = $_[0];
19367 8     8   100 use vars q{$tracelevel};
  8         21  
  8         3178  
19368 1647   50     4009 local $tracelevel = ($tracelevel||0)+1;
19369 1647         2192 $ERRORS = 0;
19370 1647         3028 my $thisrule = $thisparser->{"rules"}{"xpinter"};
19371              
19372 1647 50       2984 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xpinter]},
19373             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19374             q{xpinter},
19375             $tracelevel)
19376             if defined $::RD_TRACE;
19377              
19378            
19379 1647         2008 my $err_at = @{$thisparser->{errors}};
  1647         2677  
19380              
19381 1647         3814 my $score;
19382             my $score_return;
19383 1647         0 my $_tok;
19384 1647         2140 my $return = undef;
19385 1647         2221 my $_matched=0;
19386 1647         2036 my $commit=0;
19387 1647         2380 my @item = ();
19388 1647         2288 my %item = ();
19389 1647         2289 my $repeating = $_[2];
19390 1647         2103 my $_noactions = $_[3];
19391 1647 50       2905 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  1647         1983  
  1647         2757  
19392 1647         2461 my $_itempos = $_[5];
19393 1647 50       3241 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
19394 1647         3514 my $text;
19395             my $lastsep;
19396 1647         0 my $current_match;
19397 1647         3427 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{xps});
19398 1647         4107 $expectation->at($_[1]);
19399            
19400 1647         2131 my $thisoffset;
19401 1647         5040 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
19402            
19403 1647         2433 my $thiscolumn;
19404 1647         3733 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
19405            
19406 1647         2392 my $thisline;
19407 1647         3661 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
19408              
19409            
19410              
19411 1647   33     6333 while (!$_matched && !$commit)
19412             {
19413 1647 50       3355 local $skip = defined($skip) ? $skip : $XML::XSH2::Parser::_Runtime::skip;
19414 1647 50       3024 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xps xpintercont]},
19415             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19416             q{xpinter},
19417             $tracelevel)
19418             if defined $::RD_TRACE;
19419 1647         3081 my $thisprod = $thisrule->{"prods"}[0];
19420 1647         2785 $text = $_[1];
19421 1647         2052 my $_savetext;
19422 1647         2990 @item = (q{xpinter});
19423 1647         2942 %item = (__RULE__ => q{xpinter});
19424 1647         2236 my $repcount = 0;
19425              
19426              
19427 1647 50       2918 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xps]},
19428             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19429             q{xpinter},
19430             $tracelevel)
19431             if defined $::RD_TRACE;
19432 8     8   73 if (1) { no strict qw{refs};
  8         20  
  8         6755  
  1647         2277  
19433 1647         3226 $expectation->is(q{})->at($text);
19434 1647 50   988   7671 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xps($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1647         2801  
19435             {
19436            
19437 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19438             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19439             q{xpinter},
19440             $tracelevel)
19441             if defined $::RD_TRACE;
19442 0         0 $expectation->failed();
19443 0         0 last;
19444             }
19445 1647 50       5717 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xps]<< (return value: [}
19446             . $_tok . q{]},
19447              
19448             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19449             q{xpinter},
19450             $tracelevel)
19451             if defined $::RD_TRACE;
19452 1647         3526 $item{q{xps}} = $_tok;
19453 1647         2722 push @item, $_tok;
19454            
19455             }
19456              
19457            
19458              
19459 1647 50       2946 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
19460             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19461             q{xpinter},
19462             $tracelevel)
19463             if defined $::RD_TRACE;
19464 1647         2197 $_tok = do { my $oldskip = $skip; $skip=""; $oldskip };
  1647         2305  
  1647         2542  
  1647         2622  
19465 1647 50       3399 if (defined($_tok))
19466             {
19467 1647 50       3165 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
19468             . $_tok . q{])},
19469             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19470             if defined $::RD_TRACE;
19471             }
19472             else
19473             {
19474 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19475             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19476             if defined $::RD_TRACE;
19477             }
19478            
19479 1647 50       2878 last unless defined $_tok;
19480 1647         3761 push @item, $item{__DIRECTIVE1__}=$_tok;
19481            
19482              
19483 1647 50       2967 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [xpintercont]},
19484             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19485             q{xpinter},
19486             $tracelevel)
19487             if defined $::RD_TRACE;
19488 1647         3648 $expectation->is(q{xpintercont})->at($text);
19489            
19490 1647 50   988   8632 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpintercont, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  1647         2734  
19491             {
19492 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19493             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19494             q{xpinter},
19495             $tracelevel)
19496             if defined $::RD_TRACE;
19497 0         0 last;
19498             }
19499 1647 50       4667 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [xpintercont]<< (}
19500             . @$_tok . q{ times)},
19501              
19502             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19503             q{xpinter},
19504             $tracelevel)
19505             if defined $::RD_TRACE;
19506 1647         3227 $item{q{xpintercont(?)}} = $_tok;
19507 1647         2714 push @item, $_tok;
19508            
19509              
19510              
19511 1647 50       2985 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
19512             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19513             q{xpinter},
19514             $tracelevel)
19515             if defined $::RD_TRACE;
19516            
19517              
19518 1647 50       2920 $_tok = ($_noactions) ? 0 : do { join("",$item[1],@{$item[3]}) };
  1647         2285  
  1647         4276  
19519 1647 50       3261 unless (defined $_tok)
19520             {
19521 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
19522             if defined $::RD_TRACE;
19523 0         0 last;
19524             }
19525 1647 50       2945 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
19526             . $_tok . q{])},
19527             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19528             if defined $::RD_TRACE;
19529 1647         2527 push @item, $_tok;
19530 1647         2780 $item{__ACTION1__}=$_tok;
19531            
19532              
19533 1647 50       3087 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xps xpintercont]<<},
19534             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19535             q{xpinter},
19536             $tracelevel)
19537             if defined $::RD_TRACE;
19538              
19539              
19540              
19541 1647         2104 $_matched = 1;
19542 1647         2745 last;
19543             }
19544              
19545              
19546 1647 50 33     3269 unless ( $_matched || defined($score) )
19547             {
19548            
19549              
19550 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
19551 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19552             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19553             q{xpinter},
19554             $tracelevel)
19555             if defined $::RD_TRACE;
19556 0         0 return undef;
19557             }
19558 1647 50 33     5353 if (!defined($return) && defined($score))
19559             {
19560 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
19561             q{xpinter},
19562             $tracelevel)
19563             if defined $::RD_TRACE;
19564 0         0 $return = $score_return;
19565             }
19566 1647         2159 splice @{$thisparser->{errors}}, $err_at;
  1647         3269  
19567 1647 50       3810 $return = $item[$#item] unless defined $return;
19568 1647 50       2980 if (defined $::RD_TRACE)
19569             {
19570 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
19571             $return . q{])}, "",
19572             q{xpinter},
19573             $tracelevel);
19574 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
19575             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
19576             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19577             , q{xpinter},
19578             $tracelevel)
19579             }
19580 1647         2923 $_[1] = $text;
19581 1647         10221 return $return;
19582             }
19583              
19584             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
19585             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpintercont
19586             {
19587 1647     1647   2539 my $thisparser = $_[0];
19588 8     8   66 use vars q{$tracelevel};
  8         21  
  8         3418  
19589 1647   50     3805 local $tracelevel = ($tracelevel||0)+1;
19590 1647         2429 $ERRORS = 0;
19591 1647         2974 my $thisrule = $thisparser->{"rules"}{"xpintercont"};
19592              
19593 1647 50       3168 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xpintercont]},
19594             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19595             q{xpintercont},
19596             $tracelevel)
19597             if defined $::RD_TRACE;
19598              
19599            
19600 1647         2230 my $err_at = @{$thisparser->{errors}};
  1647         2610  
19601              
19602 1647         3468 my $score;
19603             my $score_return;
19604 1647         0 my $_tok;
19605 1647         2227 my $return = undef;
19606 1647         2116 my $_matched=0;
19607 1647         1936 my $commit=0;
19608 1647         2224 my @item = ();
19609 1647         2313 my %item = ();
19610 1647         2092 my $repeating = $_[2];
19611 1647         2278 my $_noactions = $_[3];
19612 1647 50       3051 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  1647         2223  
  1647         2505  
19613 1647         2411 my $_itempos = $_[5];
19614 1647 50       3492 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
19615 1647         3720 my $text;
19616             my $lastsep;
19617 1647         0 my $current_match;
19618 1647         3351 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{xpfilters, or xpbrackets});
19619 1647         3739 $expectation->at($_[1]);
19620            
19621 1647         2218 my $thisoffset;
19622 1647         5101 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
19623            
19624 1647         2364 my $thiscolumn;
19625 1647         3937 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
19626            
19627 1647         2461 my $thisline;
19628 1647         3802 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
19629              
19630            
19631              
19632 1647   33     6353 while (!$_matched && !$commit)
19633             {
19634 1647 50       3435 local $skip = defined($skip) ? $skip : $XML::XSH2::Parser::_Runtime::skip;
19635 1647 50       3142 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xpfilters, or xpbrackets xpinter]},
19636             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19637             q{xpintercont},
19638             $tracelevel)
19639             if defined $::RD_TRACE;
19640 1647         3242 my $thisprod = $thisrule->{"prods"}[0];
19641 1647         2519 $text = $_[1];
19642 1647         2171 my $_savetext;
19643 1647         2925 @item = (q{xpintercont});
19644 1647         3028 %item = (__RULE__ => q{xpintercont});
19645 1647         2226 my $repcount = 0;
19646              
19647              
19648 1647 50       3027 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [_alternation_1_of_production_1_of_rule_xpintercont]},
19649             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19650             q{xpintercont},
19651             $tracelevel)
19652             if defined $::RD_TRACE;
19653 8     8   68 if (1) { no strict qw{refs};
  8         18  
  8         6897  
  1647         2148  
19654 1647         3176 $expectation->is(q{})->at($text);
19655 1647 100   988   7853 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::_alternation_1_of_production_1_of_rule_xpintercont($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  1647         2957  
19656             {
19657            
19658 1150 50       2139 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19659             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19660             q{xpintercont},
19661             $tracelevel)
19662             if defined $::RD_TRACE;
19663 1150         2678 $expectation->failed();
19664 1150         2074 last;
19665             }
19666 497 50       1573 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_xpintercont]<< (return value: [}
19667             . $_tok . q{]},
19668              
19669             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19670             q{xpintercont},
19671             $tracelevel)
19672             if defined $::RD_TRACE;
19673 497         1004 $item{q{_alternation_1_of_production_1_of_rule_xpintercont}} = $_tok;
19674 497         817 push @item, $_tok;
19675            
19676             }
19677              
19678            
19679              
19680 497 50       1071 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
19681             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19682             q{xpintercont},
19683             $tracelevel)
19684             if defined $::RD_TRACE;
19685 497         635 $_tok = do { my $oldskip = $skip; $skip=""; $oldskip };
  497         873  
  497         781  
  497         829  
19686 497 50       950 if (defined($_tok))
19687             {
19688 497 50       1009 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
19689             . $_tok . q{])},
19690             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19691             if defined $::RD_TRACE;
19692             }
19693             else
19694             {
19695 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19696             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19697             if defined $::RD_TRACE;
19698             }
19699            
19700 497 50       895 last unless defined $_tok;
19701 497         1057 push @item, $item{__DIRECTIVE1__}=$_tok;
19702            
19703              
19704 497 50       918 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [xpinter]},
19705             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19706             q{xpintercont},
19707             $tracelevel)
19708             if defined $::RD_TRACE;
19709 497         1082 $expectation->is(q{xpinter})->at($text);
19710            
19711 497 50   246   2457 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpinter, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  497         871  
19712             {
19713 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19714             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19715             q{xpintercont},
19716             $tracelevel)
19717             if defined $::RD_TRACE;
19718 0         0 last;
19719             }
19720 497 50       1626 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [xpinter]<< (}
19721             . @$_tok . q{ times)},
19722              
19723             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19724             q{xpintercont},
19725             $tracelevel)
19726             if defined $::RD_TRACE;
19727 497         1064 $item{q{xpinter(?)}} = $_tok;
19728 497         844 push @item, $_tok;
19729            
19730              
19731              
19732 497 50       1001 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
19733             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19734             q{xpintercont},
19735             $tracelevel)
19736             if defined $::RD_TRACE;
19737            
19738              
19739 497 50       808 $_tok = ($_noactions) ? 0 : do { join("",$item[1],@{$item[3]}) };
  497         688  
  497         1293  
19740 497 50       1018 unless (defined $_tok)
19741             {
19742 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
19743             if defined $::RD_TRACE;
19744 0         0 last;
19745             }
19746 497 50       968 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
19747             . $_tok . q{])},
19748             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19749             if defined $::RD_TRACE;
19750 497         732 push @item, $_tok;
19751 497         813 $item{__ACTION1__}=$_tok;
19752            
19753              
19754 497 50       964 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xpfilters, or xpbrackets xpinter]<<},
19755             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19756             q{xpintercont},
19757             $tracelevel)
19758             if defined $::RD_TRACE;
19759              
19760              
19761              
19762 497         666 $_matched = 1;
19763 497         827 last;
19764             }
19765              
19766              
19767 1647 100 66     5915 unless ( $_matched || defined($score) )
19768             {
19769            
19770              
19771 1150         2256 $_[1] = $text; # NOT SURE THIS IS NEEDED
19772 1150 50       2176 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19773             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19774             q{xpintercont},
19775             $tracelevel)
19776             if defined $::RD_TRACE;
19777 1150         5885 return undef;
19778             }
19779 497 50 33     1817 if (!defined($return) && defined($score))
19780             {
19781 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
19782             q{xpintercont},
19783             $tracelevel)
19784             if defined $::RD_TRACE;
19785 0         0 $return = $score_return;
19786             }
19787 497         667 splice @{$thisparser->{errors}}, $err_at;
  497         951  
19788 497 50       1218 $return = $item[$#item] unless defined $return;
19789 497 50       971 if (defined $::RD_TRACE)
19790             {
19791 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
19792             $return . q{])}, "",
19793             q{xpintercont},
19794             $tracelevel);
19795 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
19796             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
19797             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19798             , q{xpintercont},
19799             $tracelevel)
19800             }
19801 497         925 $_[1] = $text;
19802 497         2972 return $return;
19803             }
19804              
19805             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
19806             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xplocationstep
19807             {
19808 0     0   0 my $thisparser = $_[0];
19809 8     8   100 use vars q{$tracelevel};
  8         24  
  8         4320  
19810 0   0     0 local $tracelevel = ($tracelevel||0)+1;
19811 0         0 $ERRORS = 0;
19812 0         0 my $thisrule = $thisparser->{"rules"}{"xplocationstep"};
19813              
19814 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xplocationstep]},
19815             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19816             q{xplocationstep},
19817             $tracelevel)
19818             if defined $::RD_TRACE;
19819              
19820            
19821 0         0 my $err_at = @{$thisparser->{errors}};
  0         0  
19822              
19823 0         0 my $score;
19824             my $score_return;
19825 0         0 my $_tok;
19826 0         0 my $return = undef;
19827 0         0 my $_matched=0;
19828 0         0 my $commit=0;
19829 0         0 my @item = ();
19830 0         0 my %item = ();
19831 0         0 my $repeating = $_[2];
19832 0         0 my $_noactions = $_[3];
19833 0 0       0 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  0         0  
  0         0  
19834 0         0 my $_itempos = $_[5];
19835 0 0       0 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
19836 0         0 my $text;
19837             my $lastsep;
19838 0         0 my $current_match;
19839 0         0 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{xpaxis});
19840 0         0 $expectation->at($_[1]);
19841            
19842 0         0 my $thisoffset;
19843 0         0 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
19844            
19845 0         0 my $thiscolumn;
19846 0         0 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
19847            
19848 0         0 my $thisline;
19849 0         0 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
19850              
19851            
19852              
19853 0   0     0 while (!$_matched && !$commit)
19854             {
19855            
19856 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xpaxis xpnodetest]},
19857             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19858             q{xplocationstep},
19859             $tracelevel)
19860             if defined $::RD_TRACE;
19861 0         0 my $thisprod = $thisrule->{"prods"}[0];
19862 0         0 $text = $_[1];
19863 0         0 my $_savetext;
19864 0         0 @item = (q{xplocationstep});
19865 0         0 %item = (__RULE__ => q{xplocationstep});
19866 0         0 my $repcount = 0;
19867              
19868              
19869 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [xpaxis]},
19870             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19871             q{xplocationstep},
19872             $tracelevel)
19873             if defined $::RD_TRACE;
19874 0         0 $expectation->is(q{})->at($text);
19875            
19876 0 0   0   0 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpaxis, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  0         0  
19877             {
19878 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19879             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19880             q{xplocationstep},
19881             $tracelevel)
19882             if defined $::RD_TRACE;
19883 0         0 last;
19884             }
19885 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [xpaxis]<< (}
19886             . @$_tok . q{ times)},
19887              
19888             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19889             q{xplocationstep},
19890             $tracelevel)
19891             if defined $::RD_TRACE;
19892 0         0 $item{q{xpaxis(?)}} = $_tok;
19893 0         0 push @item, $_tok;
19894            
19895              
19896              
19897 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpnodetest]},
19898             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19899             q{xplocationstep},
19900             $tracelevel)
19901             if defined $::RD_TRACE;
19902 8     8   74 if (1) { no strict qw{refs};
  8         27  
  8         4629  
  0         0  
19903 0         0 $expectation->is(q{xpnodetest})->at($text);
19904 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpnodetest($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
19905             {
19906            
19907 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19908             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19909             q{xplocationstep},
19910             $tracelevel)
19911             if defined $::RD_TRACE;
19912 0         0 $expectation->failed();
19913 0         0 last;
19914             }
19915 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpnodetest]<< (return value: [}
19916             . $_tok . q{]},
19917              
19918             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19919             q{xplocationstep},
19920             $tracelevel)
19921             if defined $::RD_TRACE;
19922 0         0 $item{q{xpnodetest}} = $_tok;
19923 0         0 push @item, $_tok;
19924            
19925             }
19926              
19927 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
19928             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19929             q{xplocationstep},
19930             $tracelevel)
19931             if defined $::RD_TRACE;
19932            
19933              
19934 0 0       0 $_tok = ($_noactions) ? 0 : do { [ (@{$item[1]} ? $item[1][0] : 'child::'),$item[3] ] };
  0 0       0  
  0         0  
19935 0 0       0 unless (defined $_tok)
19936             {
19937 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
19938             if defined $::RD_TRACE;
19939 0         0 last;
19940             }
19941 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
19942             . $_tok . q{])},
19943             XML::XSH2::Parser::_Runtime::_tracefirst($text))
19944             if defined $::RD_TRACE;
19945 0         0 push @item, $_tok;
19946 0         0 $item{__ACTION1__}=$_tok;
19947            
19948              
19949 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xpaxis xpnodetest]<<},
19950             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19951             q{xplocationstep},
19952             $tracelevel)
19953             if defined $::RD_TRACE;
19954              
19955              
19956              
19957 0         0 $_matched = 1;
19958 0         0 last;
19959             }
19960              
19961              
19962 0 0 0     0 unless ( $_matched || defined($score) )
19963             {
19964            
19965              
19966 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
19967 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
19968             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
19969             q{xplocationstep},
19970             $tracelevel)
19971             if defined $::RD_TRACE;
19972 0         0 return undef;
19973             }
19974 0 0 0     0 if (!defined($return) && defined($score))
19975             {
19976 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
19977             q{xplocationstep},
19978             $tracelevel)
19979             if defined $::RD_TRACE;
19980 0         0 $return = $score_return;
19981             }
19982 0         0 splice @{$thisparser->{errors}}, $err_at;
  0         0  
19983 0 0       0 $return = $item[$#item] unless defined $return;
19984 0 0       0 if (defined $::RD_TRACE)
19985             {
19986 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
19987             $return . q{])}, "",
19988             q{xplocationstep},
19989             $tracelevel);
19990 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
19991             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
19992             XML::XSH2::Parser::_Runtime::_tracefirst($text),
19993             , q{xplocationstep},
19994             $tracelevel)
19995             }
19996 0         0 $_[1] = $text;
19997 0         0 return $return;
19998             }
19999              
20000             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
20001             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpnodetest
20002             {
20003 0     0   0 my $thisparser = $_[0];
20004 8     8   68 use vars q{$tracelevel};
  8         17  
  8         7750  
20005 0   0     0 local $tracelevel = ($tracelevel||0)+1;
20006 0         0 $ERRORS = 0;
20007 0         0 my $thisrule = $thisparser->{"rules"}{"xpnodetest"};
20008              
20009 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xpnodetest]},
20010             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20011             q{xpnodetest},
20012             $tracelevel)
20013             if defined $::RD_TRACE;
20014              
20015            
20016 0         0 my $err_at = @{$thisparser->{errors}};
  0         0  
20017              
20018 0         0 my $score;
20019             my $score_return;
20020 0         0 my $_tok;
20021 0         0 my $return = undef;
20022 0         0 my $_matched=0;
20023 0         0 my $commit=0;
20024 0         0 my @item = ();
20025 0         0 my %item = ();
20026 0         0 my $repeating = $_[2];
20027 0         0 my $_noactions = $_[3];
20028 0 0       0 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  0         0  
  0         0  
20029 0         0 my $_itempos = $_[5];
20030 0 0       0 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
20031 0         0 my $text;
20032             my $lastsep;
20033 0         0 my $current_match;
20034 0         0 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/node\\(\\)|text\\(\\)|comment\\(\\)|processing-instruction\\(\\s*(?:"[^"]*"\\s*|'[^'*]'\\s*)?\\)|[^\\(\\[\\/\\"\\'\\&\\;\\s]+/});
20035 0         0 $expectation->at($_[1]);
20036            
20037 0         0 my $thisoffset;
20038 0         0 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
20039            
20040 0         0 my $thiscolumn;
20041 0         0 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
20042            
20043 0         0 my $thisline;
20044 0         0 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
20045              
20046            
20047              
20048 0   0     0 while (!$_matched && !$commit)
20049             {
20050            
20051 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/node\\(\\)|text\\(\\)|comment\\(\\)|processing-instruction\\(\\s*(?:"[^"]*"\\s*|'[^'*]'\\s*)?\\)|[^\\(\\[\\/\\"\\'\\&\\;\\s]+/]},
20052             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20053             q{xpnodetest},
20054             $tracelevel)
20055             if defined $::RD_TRACE;
20056 0         0 my $thisprod = $thisrule->{"prods"}[0];
20057 0         0 $text = $_[1];
20058 0         0 my $_savetext;
20059 0         0 @item = (q{xpnodetest});
20060 0         0 %item = (__RULE__ => q{xpnodetest});
20061 0         0 my $repcount = 0;
20062              
20063              
20064 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/node\\(\\)|text\\(\\)|comment\\(\\)|processing-instruction\\(\\s*(?:"[^"]*"\\s*|'[^'*]'\\s*)?\\)|[^\\(\\[\\/\\"\\'\\&\\;\\s]+/]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
20065             q{xpnodetest},
20066             $tracelevel)
20067             if defined $::RD_TRACE;
20068 0         0 undef $lastsep;
20069 0         0 $expectation->is(q{})->at($text);
20070            
20071              
20072 0 0 0     0 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:node\(\)|text\(\)|comment\(\)|processing-instruction\(\s*(?:"[^"]*"\s*|'[^'*]'\s*)?\)|[^\(\[\/\"\'\&\;\s]+)/)
  0 0       0  
20073             {
20074 0 0       0 $text = $lastsep . $text if defined $lastsep;
20075 0         0 $expectation->failed();
20076 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
20077             XML::XSH2::Parser::_Runtime::_tracefirst($text))
20078             if defined $::RD_TRACE;
20079              
20080 0         0 last;
20081             }
20082 0         0 $current_match = substr($text, $-[0], $+[0] - $-[0]);
20083 0         0 substr($text,0,length($current_match),q{});
20084 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
20085             . $current_match . q{])},
20086             XML::XSH2::Parser::_Runtime::_tracefirst($text))
20087             if defined $::RD_TRACE;
20088 0         0 push @item, $item{__PATTERN1__}=$current_match;
20089            
20090              
20091 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/node\\(\\)|text\\(\\)|comment\\(\\)|processing-instruction\\(\\s*(?:"[^"]*"\\s*|'[^'*]'\\s*)?\\)|[^\\(\\[\\/\\"\\'\\&\\;\\s]+/]<<},
20092             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20093             q{xpnodetest},
20094             $tracelevel)
20095             if defined $::RD_TRACE;
20096              
20097              
20098              
20099 0         0 $_matched = 1;
20100 0         0 last;
20101             }
20102              
20103              
20104 0 0 0     0 unless ( $_matched || defined($score) )
20105             {
20106            
20107              
20108 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
20109 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
20110             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20111             q{xpnodetest},
20112             $tracelevel)
20113             if defined $::RD_TRACE;
20114 0         0 return undef;
20115             }
20116 0 0 0     0 if (!defined($return) && defined($score))
20117             {
20118 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
20119             q{xpnodetest},
20120             $tracelevel)
20121             if defined $::RD_TRACE;
20122 0         0 $return = $score_return;
20123             }
20124 0         0 splice @{$thisparser->{errors}}, $err_at;
  0         0  
20125 0 0       0 $return = $item[$#item] unless defined $return;
20126 0 0       0 if (defined $::RD_TRACE)
20127             {
20128 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
20129             $return . q{])}, "",
20130             q{xpnodetest},
20131             $tracelevel);
20132 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
20133             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
20134             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20135             , q{xpnodetest},
20136             $tracelevel)
20137             }
20138 0         0 $_[1] = $text;
20139 0         0 return $return;
20140             }
20141              
20142             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
20143             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xps
20144             {
20145 1647     1647   2958 my $thisparser = $_[0];
20146 8     8   80 use vars q{$tracelevel};
  8         37  
  8         7971  
20147 1647   50     3682 local $tracelevel = ($tracelevel||0)+1;
20148 1647         2243 $ERRORS = 0;
20149 1647         2855 my $thisrule = $thisparser->{"rules"}{"xps"};
20150              
20151 1647 50       3013 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xps]},
20152             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20153             q{xps},
20154             $tracelevel)
20155             if defined $::RD_TRACE;
20156              
20157            
20158 1647         2060 my $err_at = @{$thisparser->{errors}};
  1647         2929  
20159              
20160 1647         3552 my $score;
20161             my $score_return;
20162 1647         0 my $_tok;
20163 1647         2498 my $return = undef;
20164 1647         2469 my $_matched=0;
20165 1647         2134 my $commit=0;
20166 1647         2434 my @item = ();
20167 1647         2221 my %item = ();
20168 1647         2259 my $repeating = $_[2];
20169 1647         2210 my $_noactions = $_[3];
20170 1647 50       2884 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  1647         2044  
  1647         2587  
20171 1647         2409 my $_itempos = $_[5];
20172 1647 50       3148 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
20173 1647         3403 my $text;
20174             my $lastsep;
20175 1647         0 my $current_match;
20176 1647         3208 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(?: [^\\$\\[\\]()'"\};]+ |
20177             \\$(?!\\\{) |
20178             \\$\\\{ (?:\\$?[a-zA-Z_][a-zA-Z0-9_]* |
20179             \\\{.*?\\\} |
20180             \\(.+?\\)
20181             )
20182             \\\} |
20183             '(?:\\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\)) \\\} |
20184             \\$(?!\\\{) | [^\\$'] | \\\\\\$
20185             )*' |
20186             "(?:\\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\)) \\\} |
20187             \\$(?!\\\{) | [^\\$"] | \\\\\\$
20188             )*"
20189             )*/x});
20190 1647         3848 $expectation->at($_[1]);
20191            
20192 1647         2124 my $thisoffset;
20193 1647         4145 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
20194            
20195 1647         2511 my $thiscolumn;
20196 1647         3378 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
20197            
20198 1647         2339 my $thisline;
20199 1647         3374 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
20200              
20201            
20202              
20203 1647   33     6402 while (!$_matched && !$commit)
20204             {
20205            
20206 1647 50       3250 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?: [^\\$\\[\\]()'"\};]+ |
20207             \\$(?!\\\{) |
20208             \\$\\\{ (?:\\$?[a-zA-Z_][a-zA-Z0-9_]* |
20209             \\\{.*?\\\} |
20210             \\(.+?\\)
20211             )
20212             \\\} |
20213             '(?:\\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\)) \\\} |
20214             \\$(?!\\\{) | [^\\$'] | \\\\\\$
20215             )*' |
20216             "(?:\\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\)) \\\} |
20217             \\$(?!\\\{) | [^\\$"] | \\\\\\$
20218             )*"
20219             )*/x]},
20220             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20221             q{xps},
20222             $tracelevel)
20223             if defined $::RD_TRACE;
20224 1647         2806 my $thisprod = $thisrule->{"prods"}[0];
20225 1647         2739 $text = $_[1];
20226 1647         1948 my $_savetext;
20227 1647         2931 @item = (q{xps});
20228 1647         2948 %item = (__RULE__ => q{xps});
20229 1647         2295 my $repcount = 0;
20230              
20231              
20232 1647 50       3260 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?: [^\\$\\[\\]()'"\};]+ |
20233             \\$(?!\\\{) |
20234             \\$\\\{ (?:\\$?[a-zA-Z_][a-zA-Z0-9_]* |
20235             \\\{.*?\\\} |
20236             \\(.+?\\)
20237             )
20238             \\\} |
20239             '(?:\\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\)) \\\} |
20240             \\$(?!\\\{) | [^\\$'] | \\\\\\$
20241             )*' |
20242             "(?:\\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\)) \\\} |
20243             \\$(?!\\\{) | [^\\$"] | \\\\\\$
20244             )*"
20245             )*/x]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
20246             q{xps},
20247             $tracelevel)
20248             if defined $::RD_TRACE;
20249 1647         2752 undef $lastsep;
20250 1647         3131 $expectation->is(q{})->at($text);
20251            
20252              
20253 1647 100 33     16620 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?: [^\$\[\]()'"};]+ |
  1647 50       22595  
20254             \$(?!\{) |
20255             \$\{ (?:\$?[a-zA-Z_][a-zA-Z0-9_]* |
20256             \{.*?\} |
20257             \(.+?\)
20258             )
20259             \} |
20260             '(?:\$\{ (?: \$?[a-zA-Z_][a-zA-Z0-9_]* | \{.*?\} | \(.+?\)) \} |
20261             \$(?!\{) | [^\$'] | \\\$
20262             )*' |
20263             "(?:\$\{ (?: \$?[a-zA-Z_][a-zA-Z0-9_]* | \{.*?\} | \(.+?\)) \} |
20264             \$(?!\{) | [^\$"] | \\\$
20265             )*"
20266             )*)/x)
20267             {
20268 0 0       0 $text = $lastsep . $text if defined $lastsep;
20269 0         0 $expectation->failed();
20270 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
20271             XML::XSH2::Parser::_Runtime::_tracefirst($text))
20272             if defined $::RD_TRACE;
20273              
20274 0         0 last;
20275             }
20276 1647         10092 $current_match = substr($text, $-[0], $+[0] - $-[0]);
20277 1647         5668 substr($text,0,length($current_match),q{});
20278 1647 50       3550 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
20279             . $current_match . q{])},
20280             XML::XSH2::Parser::_Runtime::_tracefirst($text))
20281             if defined $::RD_TRACE;
20282 1647         4072 push @item, $item{__PATTERN1__}=$current_match;
20283            
20284              
20285 1647 50       2871 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?: [^\\$\\[\\]()'"\};]+ |
20286             \\$(?!\\\{) |
20287             \\$\\\{ (?:\\$?[a-zA-Z_][a-zA-Z0-9_]* |
20288             \\\{.*?\\\} |
20289             \\(.+?\\)
20290             )
20291             \\\} |
20292             '(?:\\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\)) \\\} |
20293             \\$(?!\\\{) | [^\\$'] | \\\\\\$
20294             )*' |
20295             "(?:\\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\)) \\\} |
20296             \\$(?!\\\{) | [^\\$"] | \\\\\\$
20297             )*"
20298             )*/x]<<},
20299             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20300             q{xps},
20301             $tracelevel)
20302             if defined $::RD_TRACE;
20303              
20304              
20305              
20306 1647         2176 $_matched = 1;
20307 1647         2991 last;
20308             }
20309              
20310              
20311 1647 50 33     3697 unless ( $_matched || defined($score) )
20312             {
20313            
20314              
20315 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
20316 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
20317             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20318             q{xps},
20319             $tracelevel)
20320             if defined $::RD_TRACE;
20321 0         0 return undef;
20322             }
20323 1647 50 33     5488 if (!defined($return) && defined($score))
20324             {
20325 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
20326             q{xps},
20327             $tracelevel)
20328             if defined $::RD_TRACE;
20329 0         0 $return = $score_return;
20330             }
20331 1647         2252 splice @{$thisparser->{errors}}, $err_at;
  1647         3545  
20332 1647 50       3940 $return = $item[$#item] unless defined $return;
20333 1647 50       3436 if (defined $::RD_TRACE)
20334             {
20335 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
20336             $return . q{])}, "",
20337             q{xps},
20338             $tracelevel);
20339 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
20340             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
20341             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20342             , q{xps},
20343             $tracelevel)
20344             }
20345 1647         2714 $_[1] = $text;
20346 1647         10851 return $return;
20347             }
20348              
20349             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
20350             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpsimple
20351             {
20352 1763     1763   2726 my $thisparser = $_[0];
20353 8     8   68 use vars q{$tracelevel};
  8         17  
  8         6466  
20354 1763   50     4133 local $tracelevel = ($tracelevel||0)+1;
20355 1763         2571 $ERRORS = 0;
20356 1763         3362 my $thisrule = $thisparser->{"rules"}{"xpsimple"};
20357              
20358 1763 50       3281 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xpsimple]},
20359             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20360             q{xpsimple},
20361             $tracelevel)
20362             if defined $::RD_TRACE;
20363              
20364            
20365 1763         2154 my $err_at = @{$thisparser->{errors}};
  1763         3294  
20366              
20367 1763         4059 my $score;
20368             my $score_return;
20369 1763         0 my $_tok;
20370 1763         2375 my $return = undef;
20371 1763         2166 my $_matched=0;
20372 1763         2349 my $commit=0;
20373 1763         2503 my @item = ();
20374 1763         2471 my %item = ();
20375 1763         2252 my $repeating = $_[2];
20376 1763         2284 my $_noactions = $_[3];
20377 1763 50       3257 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  1763         2165  
  1763         3006  
20378 1763         2582 my $_itempos = $_[5];
20379 1763 50       3595 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
20380 1763         3713 my $text;
20381             my $lastsep;
20382 1763         0 my $current_match;
20383 1763         3630 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/(?:
20384             \\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\) ) \\\} |
20385             \\$(?!\\\{) |
20386             [^-:\\$\\[\\]\{\}|"'\\ \\s();] |
20387             -[^-\\[\\]\{\}|"'\\ \\s();]
20388             )
20389             (?:
20390             \\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\) ) \\\} |
20391             \\$(?!\\\{) |
20392             [^\\[\\]\\$\{\}|"'\\ \\s();]
20393             )*/x, or xpbrackets});
20394 1763         4203 $expectation->at($_[1]);
20395            
20396 1763         2261 my $thisoffset;
20397 1763         5477 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
20398            
20399 1763         2748 my $thiscolumn;
20400 1763         3967 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
20401            
20402 1763         2592 my $thisline;
20403 1763         4126 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
20404              
20405            
20406              
20407 1763   33     6696 while (!$_matched && !$commit)
20408             {
20409            
20410 1763 50       3471 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/(?:
20411             \\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\) ) \\\} |
20412             \\$(?!\\\{) |
20413             [^-:\\$\\[\\]\{\}|"'\\ \\s();] |
20414             -[^-\\[\\]\{\}|"'\\ \\s();]
20415             )
20416             (?:
20417             \\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\) ) \\\} |
20418             \\$(?!\\\{) |
20419             [^\\[\\]\\$\{\}|"'\\ \\s();]
20420             )*/x]},
20421             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20422             q{xpsimple},
20423             $tracelevel)
20424             if defined $::RD_TRACE;
20425 1763         3199 my $thisprod = $thisrule->{"prods"}[0];
20426 1763         2760 $text = $_[1];
20427 1763         2232 my $_savetext;
20428 1763         3181 @item = (q{xpsimple});
20429 1763         3559 %item = (__RULE__ => q{xpsimple});
20430 1763         2349 my $repcount = 0;
20431              
20432              
20433 1763 50       3201 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/(?:
20434             \\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\) ) \\\} |
20435             \\$(?!\\\{) |
20436             [^-:\\$\\[\\]\{\}|"'\\ \\s();] |
20437             -[^-\\[\\]\{\}|"'\\ \\s();]
20438             )
20439             (?:
20440             \\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\) ) \\\} |
20441             \\$(?!\\\{) |
20442             [^\\[\\]\\$\{\}|"'\\ \\s();]
20443             )*/x]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
20444             q{xpsimple},
20445             $tracelevel)
20446             if defined $::RD_TRACE;
20447 1763         3011 undef $lastsep;
20448 1763         3190 $expectation->is(q{})->at($text);
20449            
20450              
20451 1763 100 66     37626 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:(?:
  1763 100       18101  
20452             \$\{ (?: \$?[a-zA-Z_][a-zA-Z0-9_]* | \{.*?\} | \(.+?\) ) \} |
20453             \$(?!\{) |
20454             [^-:\$\[\]{}|"'\ \s();] |
20455             -[^-\[\]{}|"'\ \s();]
20456             )
20457             (?:
20458             \$\{ (?: \$?[a-zA-Z_][a-zA-Z0-9_]* | \{.*?\} | \(.+?\) ) \} |
20459             \$(?!\{) |
20460             [^\[\]\${}|"'\ \s();]
20461             )*)/x)
20462             {
20463 954 50       3008 $text = $lastsep . $text if defined $lastsep;
20464 954         2722 $expectation->failed();
20465 954 50       1947 XML::XSH2::Parser::_Runtime::_trace(q{<>},
20466             XML::XSH2::Parser::_Runtime::_tracefirst($text))
20467             if defined $::RD_TRACE;
20468              
20469 954         1836 last;
20470             }
20471 809         5110 $current_match = substr($text, $-[0], $+[0] - $-[0]);
20472 809         3206 substr($text,0,length($current_match),q{});
20473 809 50       1930 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
20474             . $current_match . q{])},
20475             XML::XSH2::Parser::_Runtime::_tracefirst($text))
20476             if defined $::RD_TRACE;
20477 809         2390 push @item, $item{__PATTERN1__}=$current_match;
20478            
20479              
20480 809 50       1785 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/(?:
20481             \\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\) ) \\\} |
20482             \\$(?!\\\{) |
20483             [^-:\\$\\[\\]\{\}|"'\\ \\s();] |
20484             -[^-\\[\\]\{\}|"'\\ \\s();]
20485             )
20486             (?:
20487             \\$\\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\{.*?\\\} | \\(.+?\\) ) \\\} |
20488             \\$(?!\\\{) |
20489             [^\\[\\]\\$\{\}|"'\\ \\s();]
20490             )*/x]<<},
20491             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20492             q{xpsimple},
20493             $tracelevel)
20494             if defined $::RD_TRACE;
20495              
20496              
20497              
20498 809         1191 $_matched = 1;
20499 809         1609 last;
20500             }
20501              
20502              
20503 1763   66     5666 while (!$_matched && !$commit)
20504             {
20505            
20506 954 50       1994 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xpbrackets]},
20507             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20508             q{xpsimple},
20509             $tracelevel)
20510             if defined $::RD_TRACE;
20511 954         1661 my $thisprod = $thisrule->{"prods"}[1];
20512 954         1661 $text = $_[1];
20513 954         1241 my $_savetext;
20514 954         1976 @item = (q{xpsimple});
20515 954         2371 %item = (__RULE__ => q{xpsimple});
20516 954         1443 my $repcount = 0;
20517              
20518              
20519 954 50       1879 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xpbrackets]},
20520             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20521             q{xpsimple},
20522             $tracelevel)
20523             if defined $::RD_TRACE;
20524 8     8   78 if (1) { no strict qw{refs};
  8         30  
  8         4076  
  954         1230  
20525 954         1768 $expectation->is(q{})->at($text);
20526 954 100   954   4624 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpbrackets($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  954         1885  
20527             {
20528            
20529 832 50       1761 XML::XSH2::Parser::_Runtime::_trace(q{<>},
20530             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20531             q{xpsimple},
20532             $tracelevel)
20533             if defined $::RD_TRACE;
20534 832         2035 $expectation->failed();
20535 832         1406 last;
20536             }
20537 122 50       436 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xpbrackets]<< (return value: [}
20538             . $_tok . q{]},
20539              
20540             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20541             q{xpsimple},
20542             $tracelevel)
20543             if defined $::RD_TRACE;
20544 122         269 $item{q{xpbrackets}} = $_tok;
20545 122         221 push @item, $_tok;
20546            
20547             }
20548              
20549 122 50       259 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xpbrackets]<<},
20550             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20551             q{xpsimple},
20552             $tracelevel)
20553             if defined $::RD_TRACE;
20554              
20555              
20556              
20557 122         193 $_matched = 1;
20558 122         191 last;
20559             }
20560              
20561              
20562 1763 100 66     6150 unless ( $_matched || defined($score) )
20563             {
20564            
20565              
20566 832         1627 $_[1] = $text; # NOT SURE THIS IS NEEDED
20567 832 50       1685 XML::XSH2::Parser::_Runtime::_trace(q{<>},
20568             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20569             q{xpsimple},
20570             $tracelevel)
20571             if defined $::RD_TRACE;
20572 832         4233 return undef;
20573             }
20574 931 50 33     3650 if (!defined($return) && defined($score))
20575             {
20576 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
20577             q{xpsimple},
20578             $tracelevel)
20579             if defined $::RD_TRACE;
20580 0         0 $return = $score_return;
20581             }
20582 931         1376 splice @{$thisparser->{errors}}, $err_at;
  931         2122  
20583 931 50       2479 $return = $item[$#item] unless defined $return;
20584 931 50       1970 if (defined $::RD_TRACE)
20585             {
20586 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
20587             $return . q{])}, "",
20588             q{xpsimple},
20589             $tracelevel);
20590 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
20591             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
20592             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20593             , q{xpsimple},
20594             $tracelevel)
20595             }
20596 931         1968 $_[1] = $text;
20597 931         6469 return $return;
20598             }
20599              
20600             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
20601             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpstep
20602             {
20603 0     0   0 my $thisparser = $_[0];
20604 8     8   81 use vars q{$tracelevel};
  8         23  
  8         3176  
20605 0   0     0 local $tracelevel = ($tracelevel||0)+1;
20606 0         0 $ERRORS = 0;
20607 0         0 my $thisrule = $thisparser->{"rules"}{"xpstep"};
20608              
20609 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xpstep]},
20610             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20611             q{xpstep},
20612             $tracelevel)
20613             if defined $::RD_TRACE;
20614              
20615            
20616 0         0 my $err_at = @{$thisparser->{errors}};
  0         0  
20617              
20618 0         0 my $score;
20619             my $score_return;
20620 0         0 my $_tok;
20621 0         0 my $return = undef;
20622 0         0 my $_matched=0;
20623 0         0 my $commit=0;
20624 0         0 my @item = ();
20625 0         0 my %item = ();
20626 0         0 my $repeating = $_[2];
20627 0         0 my $_noactions = $_[3];
20628 0 0       0 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  0         0  
  0         0  
20629 0         0 my $_itempos = $_[5];
20630 0 0       0 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
20631 0         0 my $text;
20632             my $lastsep;
20633 0         0 my $current_match;
20634 0         0 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{xplocationstep});
20635 0         0 $expectation->at($_[1]);
20636            
20637 0         0 my $thisoffset;
20638 0         0 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
20639            
20640 0         0 my $thiscolumn;
20641 0         0 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
20642            
20643 0         0 my $thisline;
20644 0         0 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
20645              
20646            
20647              
20648 0   0     0 while (!$_matched && !$commit)
20649             {
20650 0 0       0 local $skip = defined($skip) ? $skip : $XML::XSH2::Parser::_Runtime::skip;
20651 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [xplocationstep xpfilter]},
20652             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20653             q{xpstep},
20654             $tracelevel)
20655             if defined $::RD_TRACE;
20656 0         0 my $thisprod = $thisrule->{"prods"}[0];
20657 0         0 $text = $_[1];
20658 0         0 my $_savetext;
20659 0         0 @item = (q{xpstep});
20660 0         0 %item = (__RULE__ => q{xpstep});
20661 0         0 my $repcount = 0;
20662              
20663              
20664 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying subrule: [xplocationstep]},
20665             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20666             q{xpstep},
20667             $tracelevel)
20668             if defined $::RD_TRACE;
20669 8     8   77 if (1) { no strict qw{refs};
  8         19  
  8         6948  
  0         0  
20670 0         0 $expectation->is(q{})->at($text);
20671 0 0   0   0 unless (defined ($_tok = XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xplocationstep($thisparser,$text,$repeating,$_noactions,sub { \@arg },undef)))
  0         0  
20672             {
20673            
20674 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
20675             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20676             q{xpstep},
20677             $tracelevel)
20678             if defined $::RD_TRACE;
20679 0         0 $expectation->failed();
20680 0         0 last;
20681             }
20682 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched subrule: [xplocationstep]<< (return value: [}
20683             . $_tok . q{]},
20684              
20685             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20686             q{xpstep},
20687             $tracelevel)
20688             if defined $::RD_TRACE;
20689 0         0 $item{q{xplocationstep}} = $_tok;
20690 0         0 push @item, $_tok;
20691            
20692             }
20693              
20694            
20695              
20696 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying directive: []},
20697             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20698             q{xpstep},
20699             $tracelevel)
20700             if defined $::RD_TRACE;
20701 0         0 $_tok = do { my $oldskip = $skip; $skip=""; $oldskip };
  0         0  
  0         0  
  0         0  
20702 0 0       0 if (defined($_tok))
20703             {
20704 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched directive<< (return value: [}
20705             . $_tok . q{])},
20706             XML::XSH2::Parser::_Runtime::_tracefirst($text))
20707             if defined $::RD_TRACE;
20708             }
20709             else
20710             {
20711 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
20712             XML::XSH2::Parser::_Runtime::_tracefirst($text))
20713             if defined $::RD_TRACE;
20714             }
20715            
20716 0 0       0 last unless defined $_tok;
20717 0         0 push @item, $item{__DIRECTIVE1__}=$_tok;
20718            
20719              
20720 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying repeated subrule: [xpfilter]},
20721             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20722             q{xpstep},
20723             $tracelevel)
20724             if defined $::RD_TRACE;
20725 0         0 $expectation->is(q{xpfilter})->at($text);
20726            
20727 0 0   0   0 unless (defined ($_tok = $thisparser->_parserepeat($text, \&XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpfilter, 0, 1, $_noactions,$expectation,sub { \@arg },undef)))
  0         0  
20728             {
20729 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
20730             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20731             q{xpstep},
20732             $tracelevel)
20733             if defined $::RD_TRACE;
20734 0         0 last;
20735             }
20736 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched repeated subrule: [xpfilter]<< (}
20737             . @$_tok . q{ times)},
20738              
20739             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20740             q{xpstep},
20741             $tracelevel)
20742             if defined $::RD_TRACE;
20743 0         0 $item{q{xpfilter(?)}} = $_tok;
20744 0         0 push @item, $_tok;
20745            
20746              
20747              
20748 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{Trying action},
20749             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20750             q{xpstep},
20751             $tracelevel)
20752             if defined $::RD_TRACE;
20753            
20754              
20755 0 0       0 $_tok = ($_noactions) ? 0 : do { [ @{$item[1]}, @{$item[3]}] };
  0         0  
  0         0  
  0         0  
20756 0 0       0 unless (defined $_tok)
20757             {
20758 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<> (return value: [undef])})
20759             if defined $::RD_TRACE;
20760 0         0 last;
20761             }
20762 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched action<< (return value: [}
20763             . $_tok . q{])},
20764             XML::XSH2::Parser::_Runtime::_tracefirst($text))
20765             if defined $::RD_TRACE;
20766 0         0 push @item, $_tok;
20767 0         0 $item{__ACTION1__}=$_tok;
20768            
20769              
20770 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [xplocationstep xpfilter]<<},
20771             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20772             q{xpstep},
20773             $tracelevel)
20774             if defined $::RD_TRACE;
20775              
20776              
20777              
20778 0         0 $_matched = 1;
20779 0         0 last;
20780             }
20781              
20782              
20783 0 0 0     0 unless ( $_matched || defined($score) )
20784             {
20785            
20786              
20787 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
20788 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
20789             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20790             q{xpstep},
20791             $tracelevel)
20792             if defined $::RD_TRACE;
20793 0         0 return undef;
20794             }
20795 0 0 0     0 if (!defined($return) && defined($score))
20796             {
20797 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
20798             q{xpstep},
20799             $tracelevel)
20800             if defined $::RD_TRACE;
20801 0         0 $return = $score_return;
20802             }
20803 0         0 splice @{$thisparser->{errors}}, $err_at;
  0         0  
20804 0 0       0 $return = $item[$#item] unless defined $return;
20805 0 0       0 if (defined $::RD_TRACE)
20806             {
20807 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
20808             $return . q{])}, "",
20809             q{xpstep},
20810             $tracelevel);
20811 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
20812             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
20813             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20814             , q{xpstep},
20815             $tracelevel)
20816             }
20817 0         0 $_[1] = $text;
20818 0         0 return $return;
20819             }
20820              
20821             # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args, $_itempos)
20822             sub XML::XSH2::Parser::_Runtime::XML::XSH2::Parser::xpstring
20823             {
20824 503     503   964 my $thisparser = $_[0];
20825 8     8   69 use vars q{$tracelevel};
  8         20  
  8         100444  
20826 503   50     1323 local $tracelevel = ($tracelevel||0)+1;
20827 503         815 $ERRORS = 0;
20828 503         1029 my $thisrule = $thisparser->{"rules"}{"xpstring"};
20829              
20830 503 50       1065 XML::XSH2::Parser::_Runtime::_trace(q{Trying rule: [xpstring]},
20831             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20832             q{xpstring},
20833             $tracelevel)
20834             if defined $::RD_TRACE;
20835              
20836            
20837 503         648 my $err_at = @{$thisparser->{errors}};
  503         957  
20838              
20839 503         1195 my $score;
20840             my $score_return;
20841 503         0 my $_tok;
20842 503         746 my $return = undef;
20843 503         690 my $_matched=0;
20844 503         765 my $commit=0;
20845 503         872 my @item = ();
20846 503         766 my %item = ();
20847 503         735 my $repeating = $_[2];
20848 503         786 my $_noactions = $_[3];
20849 503 50       1036 my @arg = defined $_[4] ? @{ &{$_[4]} } : ();
  503         667  
  503         897  
20850 503         827 my $_itempos = $_[5];
20851 503 50       1224 my %arg = ($#arg & 01) ? @arg : (@arg, undef);
20852 503         1212 my $text;
20853             my $lastsep;
20854 503         0 my $current_match;
20855 503         1436 my $expectation = new XML::XSH2::Parser::_Runtime::Expectation(q{/'(?:\\$\\\{(?:\\$?[a-zA-Z_][a-zA-Z0-9_]*|\\\{.*?\\\}|\\(.+?\\))\\\}|\\$(?!\\\{)|[^\\$']|\\\\\\$)*' |
20856             "(?:\\$\\\{(?:\\$?[a-zA-Z_][a-zA-Z0-9_]*|\\\{.*?\\\}|\\(.+?\\))\\\}|\\$(?!\\\{)|[^\\$"]|\\\\\\$)*"/x});
20857 503         1390 $expectation->at($_[1]);
20858            
20859 503         732 my $thisoffset;
20860 503         1661 tie $thisoffset, q{XML::XSH2::Parser::_Runtime::OffsetCounter}, \$text, $thisparser;
20861            
20862 503         872 my $thiscolumn;
20863 503         1236 tie $thiscolumn, q{XML::XSH2::Parser::_Runtime::ColCounter}, \$text, $thisparser;
20864            
20865 503         843 my $thisline;
20866 503         1257 tie $thisline, q{XML::XSH2::Parser::_Runtime::LineCounter}, \$text, $thisparser;
20867              
20868            
20869              
20870 503   33     2211 while (!$_matched && !$commit)
20871             {
20872            
20873 503 50       1076 XML::XSH2::Parser::_Runtime::_trace(q{Trying production: [/'(?:\\$\\\{(?:\\$?[a-zA-Z_][a-zA-Z0-9_]*|\\\{.*?\\\}|\\(.+?\\))\\\}|\\$(?!\\\{)|[^\\$']|\\\\\\$)*' |
20874             "(?:\\$\\\{(?:\\$?[a-zA-Z_][a-zA-Z0-9_]*|\\\{.*?\\\}|\\(.+?\\))\\\}|\\$(?!\\\{)|[^\\$"]|\\\\\\$)*"/x]},
20875             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20876             q{xpstring},
20877             $tracelevel)
20878             if defined $::RD_TRACE;
20879 503         1009 my $thisprod = $thisrule->{"prods"}[0];
20880 503         878 $text = $_[1];
20881 503         737 my $_savetext;
20882 503         984 @item = (q{xpstring});
20883 503         1006 %item = (__RULE__ => q{xpstring});
20884 503         769 my $repcount = 0;
20885              
20886              
20887 503 50       1059 XML::XSH2::Parser::_Runtime::_trace(q{Trying terminal: [/'(?:\\$\\\{(?:\\$?[a-zA-Z_][a-zA-Z0-9_]*|\\\{.*?\\\}|\\(.+?\\))\\\}|\\$(?!\\\{)|[^\\$']|\\\\\\$)*' |
20888             "(?:\\$\\\{(?:\\$?[a-zA-Z_][a-zA-Z0-9_]*|\\\{.*?\\\}|\\(.+?\\))\\\}|\\$(?!\\\{)|[^\\$"]|\\\\\\$)*"/x]}, XML::XSH2::Parser::_Runtime::_tracefirst($text),
20889             q{xpstring},
20890             $tracelevel)
20891             if defined $::RD_TRACE;
20892 503         935 undef $lastsep;
20893 503         1076 $expectation->is(q{})->at($text);
20894            
20895              
20896 503 50 33     5388 unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ m/\A(?:'(?:\$\{(?:\$?[a-zA-Z_][a-zA-Z0-9_]*|\{.*?\}|\(.+?\))\}|\$(?!\{)|[^\$']|\\\$)*' |
  503 50       9941  
20897             "(?:\$\{(?:\$?[a-zA-Z_][a-zA-Z0-9_]*|\{.*?\}|\(.+?\))\}|\$(?!\{)|[^\$"]|\\\$)*")/x)
20898             {
20899 0 0       0 $text = $lastsep . $text if defined $lastsep;
20900 0         0 $expectation->failed();
20901 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
20902             XML::XSH2::Parser::_Runtime::_tracefirst($text))
20903             if defined $::RD_TRACE;
20904              
20905 0         0 last;
20906             }
20907 503         3346 $current_match = substr($text, $-[0], $+[0] - $-[0]);
20908 503         1828 substr($text,0,length($current_match),q{});
20909 503 50       1121 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched terminal<< (return value: [}
20910             . $current_match . q{])},
20911             XML::XSH2::Parser::_Runtime::_tracefirst($text))
20912             if defined $::RD_TRACE;
20913 503         1361 push @item, $item{__PATTERN1__}=$current_match;
20914            
20915              
20916 503 50       1181 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched production: [/'(?:\\$\\\{(?:\\$?[a-zA-Z_][a-zA-Z0-9_]*|\\\{.*?\\\}|\\(.+?\\))\\\}|\\$(?!\\\{)|[^\\$']|\\\\\\$)*' |
20917             "(?:\\$\\\{(?:\\$?[a-zA-Z_][a-zA-Z0-9_]*|\\\{.*?\\\}|\\(.+?\\))\\\}|\\$(?!\\\{)|[^\\$"]|\\\\\\$)*"/x]<<},
20918             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20919             q{xpstring},
20920             $tracelevel)
20921             if defined $::RD_TRACE;
20922              
20923              
20924              
20925 503         816 $_matched = 1;
20926 503         1000 last;
20927             }
20928              
20929              
20930 503 50 33     1268 unless ( $_matched || defined($score) )
20931             {
20932            
20933              
20934 0         0 $_[1] = $text; # NOT SURE THIS IS NEEDED
20935 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{<>},
20936             XML::XSH2::Parser::_Runtime::_tracefirst($_[1]),
20937             q{xpstring},
20938             $tracelevel)
20939             if defined $::RD_TRACE;
20940 0         0 return undef;
20941             }
20942 503 50 33     1964 if (!defined($return) && defined($score))
20943             {
20944 0 0       0 XML::XSH2::Parser::_Runtime::_trace(q{>>Accepted scored production<<}, "",
20945             q{xpstring},
20946             $tracelevel)
20947             if defined $::RD_TRACE;
20948 0         0 $return = $score_return;
20949             }
20950 503         731 splice @{$thisparser->{errors}}, $err_at;
  503         1210  
20951 503 50       1433 $return = $item[$#item] unless defined $return;
20952 503 50       1089 if (defined $::RD_TRACE)
20953             {
20954 0         0 XML::XSH2::Parser::_Runtime::_trace(q{>>Matched rule<< (return value: [} .
20955             $return . q{])}, "",
20956             q{xpstring},
20957             $tracelevel);
20958 0         0 XML::XSH2::Parser::_Runtime::_trace(q{(consumed: [} .
20959             XML::XSH2::Parser::_Runtime::_tracemax(substr($_[1],0,-length($text))) . q{])},
20960             XML::XSH2::Parser::_Runtime::_tracefirst($text),
20961             , q{xpstring},
20962             $tracelevel)
20963             }
20964 503         1044 $_[1] = $text;
20965 503         3484 return $return;
20966             }
20967             }
20968 8     8 0 11310 package XML::XSH2::Parser; sub new { my $self = bless( {
20969             '_AUTOACTION' => undef,
20970             '_AUTOTREE' => undef,
20971             '_check' => {
20972             'itempos' => '',
20973             'prevcolumn' => '',
20974             'prevline' => '',
20975             'prevoffset' => '',
20976             'thiscolumn' => 1,
20977             'thisoffset' => 1
20978             },
20979             'localvars' => '',
20980             'namespace' => 'XML::XSH2::Parser::_Runtime::XML::XSH2::Parser',
20981             'rules' => {
20982             'ID' => bless( {
20983             'calls' => [],
20984             'changed' => 0,
20985             'impcount' => 0,
20986             'line' => 170,
20987             'name' => 'ID',
20988             'opcount' => 0,
20989             'prods' => [
20990             bless( {
20991             'actcount' => 0,
20992             'dircount' => 0,
20993             'error' => undef,
20994             'items' => [
20995             bless( {
20996             'description' => '/[a-zA-Z_][a-zA-Z0-9_]*/',
20997             'hashname' => '__PATTERN1__',
20998             'ldelim' => '/',
20999             'line' => 171,
21000             'lookahead' => 0,
21001             'mod' => '',
21002             'pattern' => '[a-zA-Z_][a-zA-Z0-9_]*',
21003             'rdelim' => '/'
21004             }, 'XML::XSH2::Parser::_Runtime::Token' )
21005             ],
21006             'line' => undef,
21007             'number' => 0,
21008             'patcount' => 1,
21009             'strcount' => 0,
21010             'uncommit' => undef
21011             }, 'XML::XSH2::Parser::_Runtime::Production' )
21012             ],
21013             'vars' => ''
21014             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
21015             '_alternation_1_of_production_10_of_rule_command' => bless( {
21016             'calls' => [
21017             '_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command'
21018             ],
21019             'changed' => 0,
21020             'impcount' => 1,
21021             'line' => 439,
21022             'name' => '_alternation_1_of_production_10_of_rule_command',
21023             'opcount' => 0,
21024             'prods' => [
21025             bless( {
21026             'actcount' => 1,
21027             'dircount' => 0,
21028             'error' => undef,
21029             'items' => [
21030             bless( {
21031             'argcode' => undef,
21032             'expected' => '/--input-file|:f/, or /--input-pipe|:p/, or /--input-string|:s/, or /--output-file|:F/, or /--output-encoding|:E/, or /--output-pipe|:P/, or /--output-string|:S/, or /--no-output|:N/',
21033             'line' => 447,
21034             'lookahead' => 0,
21035             'matchrule' => 0,
21036             'max' => 100000000,
21037             'min' => 0,
21038             'repspec' => 's?',
21039             'subrule' => '_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command'
21040             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
21041             bless( {
21042             'code' => '{ [ map { @$_ } @{$item[1]} ] }',
21043             'hashname' => '__ACTION1__',
21044             'line' => 447,
21045             'lookahead' => 0
21046             }, 'XML::XSH2::Parser::_Runtime::Action' )
21047             ],
21048             'line' => undef,
21049             'number' => 0,
21050             'patcount' => 0,
21051             'strcount' => 0,
21052             'uncommit' => undef
21053             }, 'XML::XSH2::Parser::_Runtime::Production' )
21054             ],
21055             'vars' => ''
21056             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
21057             '_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command' => bless( {
21058             'calls' => [
21059             'filename',
21060             'exp',
21061             'enc_string'
21062             ],
21063             'changed' => 0,
21064             'impcount' => 0,
21065             'line' => 440,
21066             'name' => '_alternation_1_of_production_1_of_rule__alternation_1_of_production_10_of_rule_command',
21067             'opcount' => 0,
21068             'prods' => [
21069             bless( {
21070             'actcount' => 1,
21071             'dircount' => 0,
21072             'error' => undef,
21073             'items' => [
21074             bless( {
21075             'description' => '/--input-file|:f/',
21076             'hashname' => '__PATTERN1__',
21077             'ldelim' => '/',
21078             'line' => 440,
21079             'lookahead' => 0,
21080             'mod' => '',
21081             'pattern' => '--input-file|:f',
21082             'rdelim' => '/'
21083             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21084             bless( {
21085             'argcode' => undef,
21086             'implicit' => undef,
21087             'line' => 440,
21088             'lookahead' => 0,
21089             'matchrule' => 0,
21090             'subrule' => 'filename'
21091             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21092             bless( {
21093             'code' => '{ [ \'string/input-file\' => $item[2] ] }',
21094             'hashname' => '__ACTION1__',
21095             'line' => 440,
21096             'lookahead' => 0
21097             }, 'XML::XSH2::Parser::_Runtime::Action' )
21098             ],
21099             'line' => undef,
21100             'number' => 0,
21101             'patcount' => 1,
21102             'strcount' => 0,
21103             'uncommit' => undef
21104             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21105             bless( {
21106             'actcount' => 1,
21107             'dircount' => 0,
21108             'error' => undef,
21109             'items' => [
21110             bless( {
21111             'description' => '/--input-pipe|:p/',
21112             'hashname' => '__PATTERN1__',
21113             'ldelim' => '/',
21114             'line' => 441,
21115             'lookahead' => 0,
21116             'mod' => '',
21117             'pattern' => '--input-pipe|:p',
21118             'rdelim' => '/'
21119             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21120             bless( {
21121             'argcode' => undef,
21122             'implicit' => undef,
21123             'line' => 441,
21124             'lookahead' => 0,
21125             'matchrule' => 0,
21126             'subrule' => 'filename'
21127             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21128             bless( {
21129             'code' => '{ [ \'string/input-pipe\' => $item[2] ] }',
21130             'hashname' => '__ACTION1__',
21131             'line' => 441,
21132             'lookahead' => 0
21133             }, 'XML::XSH2::Parser::_Runtime::Action' )
21134             ],
21135             'line' => 441,
21136             'number' => 1,
21137             'patcount' => 1,
21138             'strcount' => 0,
21139             'uncommit' => undef
21140             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21141             bless( {
21142             'actcount' => 1,
21143             'dircount' => 0,
21144             'error' => undef,
21145             'items' => [
21146             bless( {
21147             'description' => '/--input-string|:s/',
21148             'hashname' => '__PATTERN1__',
21149             'ldelim' => '/',
21150             'line' => 442,
21151             'lookahead' => 0,
21152             'mod' => '',
21153             'pattern' => '--input-string|:s',
21154             'rdelim' => '/'
21155             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21156             bless( {
21157             'argcode' => undef,
21158             'implicit' => undef,
21159             'line' => 442,
21160             'lookahead' => 0,
21161             'matchrule' => 0,
21162             'subrule' => 'exp'
21163             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21164             bless( {
21165             'code' => '{ [ \'exp/input-string\' => $item[2] ] }',
21166             'hashname' => '__ACTION1__',
21167             'line' => 442,
21168             'lookahead' => 0
21169             }, 'XML::XSH2::Parser::_Runtime::Action' )
21170             ],
21171             'line' => 442,
21172             'number' => 2,
21173             'patcount' => 1,
21174             'strcount' => 0,
21175             'uncommit' => undef
21176             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21177             bless( {
21178             'actcount' => 1,
21179             'dircount' => 0,
21180             'error' => undef,
21181             'items' => [
21182             bless( {
21183             'description' => '/--output-file|:F/',
21184             'hashname' => '__PATTERN1__',
21185             'ldelim' => '/',
21186             'line' => 443,
21187             'lookahead' => 0,
21188             'mod' => '',
21189             'pattern' => '--output-file|:F',
21190             'rdelim' => '/'
21191             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21192             bless( {
21193             'argcode' => undef,
21194             'implicit' => undef,
21195             'line' => 443,
21196             'lookahead' => 0,
21197             'matchrule' => 0,
21198             'subrule' => 'filename'
21199             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21200             bless( {
21201             'code' => '{ [ \'string/output-file\' => $item[2] ] }',
21202             'hashname' => '__ACTION1__',
21203             'line' => 443,
21204             'lookahead' => 0
21205             }, 'XML::XSH2::Parser::_Runtime::Action' )
21206             ],
21207             'line' => 443,
21208             'number' => 3,
21209             'patcount' => 1,
21210             'strcount' => 0,
21211             'uncommit' => undef
21212             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21213             bless( {
21214             'actcount' => 1,
21215             'dircount' => 0,
21216             'error' => undef,
21217             'items' => [
21218             bless( {
21219             'description' => '/--output-encoding|:E/',
21220             'hashname' => '__PATTERN1__',
21221             'ldelim' => '/',
21222             'line' => 444,
21223             'lookahead' => 0,
21224             'mod' => '',
21225             'pattern' => '--output-encoding|:E',
21226             'rdelim' => '/'
21227             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21228             bless( {
21229             'argcode' => undef,
21230             'implicit' => undef,
21231             'line' => 444,
21232             'lookahead' => 0,
21233             'matchrule' => 0,
21234             'subrule' => 'enc_string'
21235             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21236             bless( {
21237             'code' => '{ [ \'string/output-encoding\' => $item[2] ] }',
21238             'hashname' => '__ACTION1__',
21239             'line' => 444,
21240             'lookahead' => 0
21241             }, 'XML::XSH2::Parser::_Runtime::Action' )
21242             ],
21243             'line' => 444,
21244             'number' => 4,
21245             'patcount' => 1,
21246             'strcount' => 0,
21247             'uncommit' => undef
21248             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21249             bless( {
21250             'actcount' => 1,
21251             'dircount' => 0,
21252             'error' => undef,
21253             'items' => [
21254             bless( {
21255             'description' => '/--output-pipe|:P/',
21256             'hashname' => '__PATTERN1__',
21257             'ldelim' => '/',
21258             'line' => 445,
21259             'lookahead' => 0,
21260             'mod' => '',
21261             'pattern' => '--output-pipe|:P',
21262             'rdelim' => '/'
21263             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21264             bless( {
21265             'argcode' => undef,
21266             'implicit' => undef,
21267             'line' => 445,
21268             'lookahead' => 0,
21269             'matchrule' => 0,
21270             'subrule' => 'filename'
21271             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21272             bless( {
21273             'code' => '{ [ \'string/output-pipe\' => $item[2] ] }',
21274             'hashname' => '__ACTION1__',
21275             'line' => 445,
21276             'lookahead' => 0
21277             }, 'XML::XSH2::Parser::_Runtime::Action' )
21278             ],
21279             'line' => 445,
21280             'number' => 5,
21281             'patcount' => 1,
21282             'strcount' => 0,
21283             'uncommit' => undef
21284             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21285             bless( {
21286             'actcount' => 1,
21287             'dircount' => 0,
21288             'error' => undef,
21289             'items' => [
21290             bless( {
21291             'description' => '/--output-string|:S/',
21292             'hashname' => '__PATTERN1__',
21293             'ldelim' => '/',
21294             'line' => 446,
21295             'lookahead' => 0,
21296             'mod' => '',
21297             'pattern' => '--output-string|:S',
21298             'rdelim' => '/'
21299             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21300             bless( {
21301             'argcode' => undef,
21302             'implicit' => undef,
21303             'line' => 446,
21304             'lookahead' => 0,
21305             'matchrule' => 0,
21306             'subrule' => 'exp'
21307             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21308             bless( {
21309             'code' => '{ [ \'varname/output-string\' => $item[2] ] }',
21310             'hashname' => '__ACTION1__',
21311             'line' => 446,
21312             'lookahead' => 0
21313             }, 'XML::XSH2::Parser::_Runtime::Action' )
21314             ],
21315             'line' => 446,
21316             'number' => 6,
21317             'patcount' => 1,
21318             'strcount' => 0,
21319             'uncommit' => undef
21320             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21321             bless( {
21322             'actcount' => 1,
21323             'dircount' => 0,
21324             'error' => undef,
21325             'items' => [
21326             bless( {
21327             'description' => '/--no-output|:N/',
21328             'hashname' => '__PATTERN1__',
21329             'ldelim' => '/',
21330             'line' => 447,
21331             'lookahead' => 0,
21332             'mod' => '',
21333             'pattern' => '--no-output|:N',
21334             'rdelim' => '/'
21335             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21336             bless( {
21337             'code' => '{ [ \'/no-output\' => 1 ] }',
21338             'hashname' => '__ACTION1__',
21339             'line' => 447,
21340             'lookahead' => 0
21341             }, 'XML::XSH2::Parser::_Runtime::Action' )
21342             ],
21343             'line' => 447,
21344             'number' => 7,
21345             'patcount' => 1,
21346             'strcount' => 0,
21347             'uncommit' => undef
21348             }, 'XML::XSH2::Parser::_Runtime::Production' )
21349             ],
21350             'vars' => ''
21351             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
21352             '_alternation_1_of_production_1_of_rule_local_var' => bless( {
21353             'calls' => [],
21354             'changed' => 0,
21355             'impcount' => 0,
21356             'line' => 447,
21357             'name' => '_alternation_1_of_production_1_of_rule_local_var',
21358             'opcount' => 0,
21359             'prods' => [
21360             bless( {
21361             'actcount' => 0,
21362             'dircount' => 0,
21363             'error' => undef,
21364             'items' => [
21365             bless( {
21366             'description' => '/(local|my)\\\\s/',
21367             'hashname' => '__PATTERN1__',
21368             'ldelim' => '/',
21369             'line' => 447,
21370             'lookahead' => 0,
21371             'mod' => '',
21372             'pattern' => '(local|my)\\s',
21373             'rdelim' => '/'
21374             }, 'XML::XSH2::Parser::_Runtime::Token' )
21375             ],
21376             'line' => undef,
21377             'number' => 0,
21378             'patcount' => 1,
21379             'strcount' => 0,
21380             'uncommit' => undef
21381             }, 'XML::XSH2::Parser::_Runtime::Production' )
21382             ],
21383             'vars' => ''
21384             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
21385             '_alternation_1_of_production_1_of_rule_xpcont' => bless( {
21386             'calls' => [
21387             'xpfilters',
21388             'xpbrackets'
21389             ],
21390             'changed' => 0,
21391             'impcount' => 0,
21392             'line' => 446,
21393             'name' => '_alternation_1_of_production_1_of_rule_xpcont',
21394             'opcount' => 0,
21395             'prods' => [
21396             bless( {
21397             'actcount' => 0,
21398             'dircount' => 0,
21399             'error' => undef,
21400             'items' => [
21401             bless( {
21402             'argcode' => undef,
21403             'implicit' => undef,
21404             'line' => 446,
21405             'lookahead' => 0,
21406             'matchrule' => 0,
21407             'subrule' => 'xpfilters'
21408             }, 'XML::XSH2::Parser::_Runtime::Subrule' )
21409             ],
21410             'line' => undef,
21411             'number' => 0,
21412             'patcount' => 0,
21413             'strcount' => 0,
21414             'uncommit' => undef
21415             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21416             bless( {
21417             'actcount' => 0,
21418             'dircount' => 0,
21419             'error' => undef,
21420             'items' => [
21421             bless( {
21422             'argcode' => undef,
21423             'implicit' => undef,
21424             'line' => 447,
21425             'lookahead' => 0,
21426             'matchrule' => 0,
21427             'subrule' => 'xpbrackets'
21428             }, 'XML::XSH2::Parser::_Runtime::Subrule' )
21429             ],
21430             'line' => 447,
21431             'number' => 1,
21432             'patcount' => 0,
21433             'strcount' => 0,
21434             'uncommit' => undef
21435             }, 'XML::XSH2::Parser::_Runtime::Production' )
21436             ],
21437             'vars' => ''
21438             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
21439             '_alternation_1_of_production_1_of_rule_xpintercont' => bless( {
21440             'calls' => [
21441             'xpfilters',
21442             'xpbrackets'
21443             ],
21444             'changed' => 0,
21445             'impcount' => 0,
21446             'line' => 446,
21447             'name' => '_alternation_1_of_production_1_of_rule_xpintercont',
21448             'opcount' => 0,
21449             'prods' => [
21450             bless( {
21451             'actcount' => 0,
21452             'dircount' => 0,
21453             'error' => undef,
21454             'items' => [
21455             bless( {
21456             'argcode' => undef,
21457             'implicit' => undef,
21458             'line' => 446,
21459             'lookahead' => 0,
21460             'matchrule' => 0,
21461             'subrule' => 'xpfilters'
21462             }, 'XML::XSH2::Parser::_Runtime::Subrule' )
21463             ],
21464             'line' => undef,
21465             'number' => 0,
21466             'patcount' => 0,
21467             'strcount' => 0,
21468             'uncommit' => undef
21469             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21470             bless( {
21471             'actcount' => 0,
21472             'dircount' => 0,
21473             'error' => undef,
21474             'items' => [
21475             bless( {
21476             'argcode' => undef,
21477             'implicit' => undef,
21478             'line' => 447,
21479             'lookahead' => 0,
21480             'matchrule' => 0,
21481             'subrule' => 'xpbrackets'
21482             }, 'XML::XSH2::Parser::_Runtime::Subrule' )
21483             ],
21484             'line' => 447,
21485             'number' => 1,
21486             'patcount' => 0,
21487             'strcount' => 0,
21488             'uncommit' => undef
21489             }, 'XML::XSH2::Parser::_Runtime::Production' )
21490             ],
21491             'vars' => ''
21492             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
21493             '_alternation_1_of_production_2_of_rule_command' => bless( {
21494             'calls' => [
21495             'loose_exp',
21496             'command'
21497             ],
21498             'changed' => 0,
21499             'impcount' => 0,
21500             'line' => 442,
21501             'name' => '_alternation_1_of_production_2_of_rule_command',
21502             'opcount' => 0,
21503             'prods' => [
21504             bless( {
21505             'actcount' => 1,
21506             'dircount' => 1,
21507             'error' => undef,
21508             'items' => [
21509             bless( {
21510             'description' => '/(?:[\\\\-\\\\+\\\\*\\\\/%x.]|\\\\|\\\\||\\\\&\\\\&)?=/',
21511             'hashname' => '__PATTERN1__',
21512             'ldelim' => '/',
21513             'line' => 442,
21514             'lookahead' => 0,
21515             'mod' => '',
21516             'pattern' => '(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?=',
21517             'rdelim' => '/'
21518             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21519             bless( {
21520             'code' => '$commit = 1',
21521             'hashname' => '__DIRECTIVE1__',
21522             'line' => 442,
21523             'lookahead' => 0,
21524             'name' => ''
21525             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
21526             bless( {
21527             'argcode' => undef,
21528             'implicit' => undef,
21529             'line' => 442,
21530             'lookahead' => 0,
21531             'matchrule' => 0,
21532             'subrule' => 'loose_exp'
21533             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21534             bless( {
21535             'code' => '{ [\'xpath_assign\',$item[3],$item[1]] }',
21536             'hashname' => '__ACTION1__',
21537             'line' => 443,
21538             'lookahead' => 0
21539             }, 'XML::XSH2::Parser::_Runtime::Action' )
21540             ],
21541             'line' => undef,
21542             'number' => 0,
21543             'patcount' => 1,
21544             'strcount' => 0,
21545             'uncommit' => undef
21546             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21547             bless( {
21548             'actcount' => 1,
21549             'dircount' => 0,
21550             'error' => undef,
21551             'items' => [
21552             bless( {
21553             'description' => '/\\\\s*(?:[\\\\-\\\\+\\\\*\\\\/%x.]|\\\\|\\\\||\\\\&\\\\&)?:=/',
21554             'hashname' => '__PATTERN1__',
21555             'ldelim' => '/',
21556             'line' => 445,
21557             'lookahead' => 0,
21558             'mod' => '',
21559             'pattern' => '\\s*(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?:=',
21560             'rdelim' => '/'
21561             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21562             bless( {
21563             'argcode' => undef,
21564             'implicit' => undef,
21565             'line' => 445,
21566             'lookahead' => 0,
21567             'matchrule' => 0,
21568             'subrule' => 'command'
21569             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21570             bless( {
21571             'code' => '{ [\'command_assign\',$item[2],$item[1]] }',
21572             'hashname' => '__ACTION1__',
21573             'line' => 446,
21574             'lookahead' => 0
21575             }, 'XML::XSH2::Parser::_Runtime::Action' )
21576             ],
21577             'line' => 445,
21578             'number' => 1,
21579             'patcount' => 1,
21580             'strcount' => 0,
21581             'uncommit' => undef
21582             }, 'XML::XSH2::Parser::_Runtime::Production' )
21583             ],
21584             'vars' => ''
21585             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
21586             'block' => bless( {
21587             'calls' => [
21588             'complex_command'
21589             ],
21590             'changed' => 0,
21591             'impcount' => 0,
21592             'line' => 131,
21593             'name' => 'block',
21594             'opcount' => 0,
21595             'prods' => [
21596             bless( {
21597             'actcount' => 1,
21598             'dircount' => 1,
21599             'error' => undef,
21600             'items' => [
21601             bless( {
21602             'description' => '\'\\{\'',
21603             'hashname' => '__STRING1__',
21604             'line' => 132,
21605             'lookahead' => 0,
21606             'pattern' => '{'
21607             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
21608             bless( {
21609             'code' => '$commit = 1',
21610             'hashname' => '__DIRECTIVE1__',
21611             'line' => 132,
21612             'lookahead' => 0,
21613             'name' => ''
21614             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
21615             bless( {
21616             'argcode' => undef,
21617             'expected' => undef,
21618             'line' => 132,
21619             'lookahead' => 0,
21620             'matchrule' => 0,
21621             'max' => 100000000,
21622             'min' => 1,
21623             'repspec' => 's',
21624             'subrule' => 'complex_command'
21625             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
21626             bless( {
21627             'description' => '\'\\}\'',
21628             'hashname' => '__STRING2__',
21629             'line' => 132,
21630             'lookahead' => 0,
21631             'pattern' => '}'
21632             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
21633             bless( {
21634             'code' => '{ [grep ref,@{$item[3]}] }',
21635             'hashname' => '__ACTION1__',
21636             'line' => 133,
21637             'lookahead' => 0
21638             }, 'XML::XSH2::Parser::_Runtime::Action' )
21639             ],
21640             'line' => undef,
21641             'number' => 0,
21642             'patcount' => 0,
21643             'strcount' => 2,
21644             'uncommit' => undef
21645             }, 'XML::XSH2::Parser::_Runtime::Production' )
21646             ],
21647             'vars' => ''
21648             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
21649             'command' => bless( {
21650             'calls' => [
21651             'variable',
21652             '_alternation_1_of_production_2_of_rule_command',
21653             'block',
21654             'exp',
21655             'command',
21656             'local_var_in',
21657             '_alternation_1_of_production_10_of_rule_command',
21658             'stream_select',
21659             'exp_or_opt'
21660             ],
21661             'changed' => 0,
21662             'impcount' => 0,
21663             'line' => 1,
21664             'name' => 'command',
21665             'opcount' => 0,
21666             'prods' => [
21667             bless( {
21668             'actcount' => 0,
21669             'dircount' => 2,
21670             'error' => undef,
21671             'items' => [
21672             bless( {
21673             'description' => '/(?=\\\\s*[\\}\\{;]|\\\\s*\\\\Z)/',
21674             'hashname' => '__PATTERN1__',
21675             'ldelim' => '/',
21676             'line' => 4,
21677             'lookahead' => 0,
21678             'mod' => '',
21679             'pattern' => '(?=\\s*[}{;]|\\s*\\Z)',
21680             'rdelim' => '/'
21681             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21682             bless( {
21683             'code' => '$commit = 1',
21684             'hashname' => '__DIRECTIVE1__',
21685             'line' => 4,
21686             'lookahead' => 0,
21687             'name' => ''
21688             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
21689             bless( {
21690             'hashname' => '__DIRECTIVE2__',
21691             'line' => 4,
21692             'lookahead' => 0,
21693             'name' => ''
21694             }, 'XML::XSH2::Parser::_Runtime::UncondReject' )
21695             ],
21696             'line' => undef,
21697             'number' => 0,
21698             'patcount' => 1,
21699             'strcount' => 0,
21700             'uncommit' => undef
21701             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21702             bless( {
21703             'actcount' => 1,
21704             'dircount' => 1,
21705             'error' => undef,
21706             'items' => [
21707             bless( {
21708             'description' => '/assign\\\\b|(?:local\\\\b|my\\\\b)?(?=\\\\s*\\\\$[a-zA-Z_][a-zA-Z0-9_]*\\\\s*\\\\s*(?:[\\\\-\\\\+\\\\*\\\\/%x.]|\\\\|\\\\||\\\\&\\\\&)?:?=)/',
21709             'hashname' => '__PATTERN1__',
21710             'ldelim' => '/',
21711             'line' => 5,
21712             'lookahead' => 0,
21713             'mod' => '',
21714             'pattern' => 'assign\\b|(?:local\\b|my\\b)?(?=\\s*\\$[a-zA-Z_][a-zA-Z0-9_]*\\s*\\s*(?:[\\-\\+\\*\\/%x.]|\\|\\||\\&\\&)?:?=)',
21715             'rdelim' => '/'
21716             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21717             bless( {
21718             'code' => '$commit = 1',
21719             'hashname' => '__DIRECTIVE1__',
21720             'line' => 5,
21721             'lookahead' => 0,
21722             'name' => ''
21723             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
21724             bless( {
21725             'argcode' => undef,
21726             'implicit' => undef,
21727             'line' => 5,
21728             'lookahead' => 0,
21729             'matchrule' => 0,
21730             'subrule' => 'variable'
21731             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21732             bless( {
21733             'argcode' => undef,
21734             'implicit' => '/(?:[\\\\-\\\\+\\\\*\\\\/%x.]|\\\\|\\\\||\\\\&\\\\&)?=/, or /\\\\s*(?:[\\\\-\\\\+\\\\*\\\\/%x.]|\\\\|\\\\||\\\\&\\\\&)?:=/',
21735             'line' => 12,
21736             'lookahead' => 0,
21737             'matchrule' => 0,
21738             'subrule' => '_alternation_1_of_production_2_of_rule_command'
21739             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21740             bless( {
21741             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,@{$item[4]},$item[1],$item[3]] }',
21742             'hashname' => '__ACTION1__',
21743             'line' => 13,
21744             'lookahead' => 0
21745             }, 'XML::XSH2::Parser::_Runtime::Action' )
21746             ],
21747             'line' => 5,
21748             'number' => 1,
21749             'patcount' => 1,
21750             'strcount' => 0,
21751             'uncommit' => undef
21752             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21753             bless( {
21754             'actcount' => 1,
21755             'dircount' => 0,
21756             'error' => undef,
21757             'items' => [
21758             bless( {
21759             'description' => '/(my)\\\\b/',
21760             'hashname' => '__PATTERN1__',
21761             'ldelim' => '/',
21762             'line' => 15,
21763             'lookahead' => 0,
21764             'mod' => '',
21765             'pattern' => '(my)\\b',
21766             'rdelim' => '/'
21767             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21768             bless( {
21769             'argcode' => undef,
21770             'expected' => undef,
21771             'line' => 15,
21772             'lookahead' => 0,
21773             'matchrule' => 0,
21774             'max' => 100000000,
21775             'min' => 1,
21776             'repspec' => 's',
21777             'subrule' => 'variable'
21778             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
21779             bless( {
21780             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'store_lex_variables\',0,@{$item[2]}] }',
21781             'hashname' => '__ACTION1__',
21782             'line' => 16,
21783             'lookahead' => 0
21784             }, 'XML::XSH2::Parser::_Runtime::Action' )
21785             ],
21786             'line' => 15,
21787             'number' => 2,
21788             'patcount' => 1,
21789             'strcount' => 0,
21790             'uncommit' => undef
21791             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21792             bless( {
21793             'actcount' => 1,
21794             'dircount' => 0,
21795             'error' => undef,
21796             'items' => [
21797             bless( {
21798             'description' => '/(local)\\\\b/',
21799             'hashname' => '__PATTERN1__',
21800             'ldelim' => '/',
21801             'line' => 18,
21802             'lookahead' => 0,
21803             'mod' => '',
21804             'pattern' => '(local)\\b',
21805             'rdelim' => '/'
21806             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21807             bless( {
21808             'argcode' => undef,
21809             'expected' => undef,
21810             'line' => 18,
21811             'lookahead' => 0,
21812             'matchrule' => 0,
21813             'max' => 100000000,
21814             'min' => 1,
21815             'repspec' => 's',
21816             'subrule' => 'variable'
21817             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
21818             bless( {
21819             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'make_local\',@{$item[2]}] }',
21820             'hashname' => '__ACTION1__',
21821             'line' => 19,
21822             'lookahead' => 0
21823             }, 'XML::XSH2::Parser::_Runtime::Action' )
21824             ],
21825             'line' => 18,
21826             'number' => 3,
21827             'patcount' => 1,
21828             'strcount' => 0,
21829             'uncommit' => undef
21830             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21831             bless( {
21832             'actcount' => 1,
21833             'dircount' => 1,
21834             'error' => undef,
21835             'items' => [
21836             bless( {
21837             'description' => '/(do)\\\\b/',
21838             'hashname' => '__PATTERN1__',
21839             'ldelim' => '/',
21840             'line' => 21,
21841             'lookahead' => 0,
21842             'mod' => '',
21843             'pattern' => '(do)\\b',
21844             'rdelim' => '/'
21845             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21846             bless( {
21847             'code' => '$commit = 1',
21848             'hashname' => '__DIRECTIVE1__',
21849             'line' => 21,
21850             'lookahead' => 0,
21851             'name' => ''
21852             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
21853             bless( {
21854             'argcode' => undef,
21855             'implicit' => undef,
21856             'line' => 21,
21857             'lookahead' => 0,
21858             'matchrule' => 0,
21859             'subrule' => 'block'
21860             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21861             bless( {
21862             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'run_commands\',$item[3],0] }',
21863             'hashname' => '__ACTION1__',
21864             'line' => 22,
21865             'lookahead' => 0
21866             }, 'XML::XSH2::Parser::_Runtime::Action' )
21867             ],
21868             'line' => 21,
21869             'number' => 4,
21870             'patcount' => 1,
21871             'strcount' => 0,
21872             'uncommit' => undef
21873             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21874             bless( {
21875             'actcount' => 1,
21876             'dircount' => 1,
21877             'error' => undef,
21878             'items' => [
21879             bless( {
21880             'description' => '/(if)\\\\b/',
21881             'hashname' => '__PATTERN1__',
21882             'ldelim' => '/',
21883             'line' => 24,
21884             'lookahead' => 0,
21885             'mod' => '',
21886             'pattern' => '(if)\\b',
21887             'rdelim' => '/'
21888             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21889             bless( {
21890             'code' => '$commit = 1',
21891             'hashname' => '__DIRECTIVE1__',
21892             'line' => 24,
21893             'lookahead' => 0,
21894             'name' => ''
21895             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
21896             bless( {
21897             'argcode' => undef,
21898             'implicit' => undef,
21899             'line' => 24,
21900             'lookahead' => 0,
21901             'matchrule' => 0,
21902             'subrule' => 'exp'
21903             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21904             bless( {
21905             'argcode' => undef,
21906             'implicit' => undef,
21907             'line' => 24,
21908             'lookahead' => 0,
21909             'matchrule' => 0,
21910             'subrule' => 'command'
21911             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21912             bless( {
21913             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'if_statement\',[$item[3],[$item[4]]]] }',
21914             'hashname' => '__ACTION1__',
21915             'line' => 25,
21916             'lookahead' => 0
21917             }, 'XML::XSH2::Parser::_Runtime::Action' )
21918             ],
21919             'line' => 24,
21920             'number' => 5,
21921             'patcount' => 1,
21922             'strcount' => 0,
21923             'uncommit' => undef
21924             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21925             bless( {
21926             'actcount' => 1,
21927             'dircount' => 1,
21928             'error' => undef,
21929             'items' => [
21930             bless( {
21931             'description' => '/(unless)\\\\b/',
21932             'hashname' => '__PATTERN1__',
21933             'ldelim' => '/',
21934             'line' => 27,
21935             'lookahead' => 0,
21936             'mod' => '',
21937             'pattern' => '(unless)\\b',
21938             'rdelim' => '/'
21939             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21940             bless( {
21941             'code' => '$commit = 1',
21942             'hashname' => '__DIRECTIVE1__',
21943             'line' => 27,
21944             'lookahead' => 0,
21945             'name' => ''
21946             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
21947             bless( {
21948             'argcode' => undef,
21949             'implicit' => undef,
21950             'line' => 27,
21951             'lookahead' => 0,
21952             'matchrule' => 0,
21953             'subrule' => 'exp'
21954             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21955             bless( {
21956             'argcode' => undef,
21957             'implicit' => undef,
21958             'line' => 27,
21959             'lookahead' => 0,
21960             'matchrule' => 0,
21961             'subrule' => 'command'
21962             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
21963             bless( {
21964             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'unless_statement\',$item[3],[$item[4]]] }',
21965             'hashname' => '__ACTION1__',
21966             'line' => 28,
21967             'lookahead' => 0
21968             }, 'XML::XSH2::Parser::_Runtime::Action' )
21969             ],
21970             'line' => 27,
21971             'number' => 6,
21972             'patcount' => 1,
21973             'strcount' => 0,
21974             'uncommit' => undef
21975             }, 'XML::XSH2::Parser::_Runtime::Production' ),
21976             bless( {
21977             'actcount' => 1,
21978             'dircount' => 1,
21979             'error' => undef,
21980             'items' => [
21981             bless( {
21982             'description' => '/(while)\\\\b/',
21983             'hashname' => '__PATTERN1__',
21984             'ldelim' => '/',
21985             'line' => 30,
21986             'lookahead' => 0,
21987             'mod' => '',
21988             'pattern' => '(while)\\b',
21989             'rdelim' => '/'
21990             }, 'XML::XSH2::Parser::_Runtime::Token' ),
21991             bless( {
21992             'code' => '$commit = 1',
21993             'hashname' => '__DIRECTIVE1__',
21994             'line' => 30,
21995             'lookahead' => 0,
21996             'name' => ''
21997             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
21998             bless( {
21999             'argcode' => undef,
22000             'implicit' => undef,
22001             'line' => 30,
22002             'lookahead' => 0,
22003             'matchrule' => 0,
22004             'subrule' => 'exp'
22005             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22006             bless( {
22007             'argcode' => undef,
22008             'implicit' => undef,
22009             'line' => 30,
22010             'lookahead' => 0,
22011             'matchrule' => 0,
22012             'subrule' => 'command'
22013             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22014             bless( {
22015             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'while_statement\',$item[3],[$item[4]]] }',
22016             'hashname' => '__ACTION1__',
22017             'line' => 31,
22018             'lookahead' => 0
22019             }, 'XML::XSH2::Parser::_Runtime::Action' )
22020             ],
22021             'line' => 30,
22022             'number' => 7,
22023             'patcount' => 1,
22024             'strcount' => 0,
22025             'uncommit' => undef
22026             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22027             bless( {
22028             'actcount' => 1,
22029             'dircount' => 1,
22030             'error' => undef,
22031             'items' => [
22032             bless( {
22033             'description' => '/(foreach|for)\\\\b/',
22034             'hashname' => '__PATTERN1__',
22035             'ldelim' => '/',
22036             'line' => 33,
22037             'lookahead' => 0,
22038             'mod' => '',
22039             'pattern' => '(foreach|for)\\b',
22040             'rdelim' => '/'
22041             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22042             bless( {
22043             'code' => '$commit = 1',
22044             'hashname' => '__DIRECTIVE1__',
22045             'line' => 33,
22046             'lookahead' => 0,
22047             'name' => ''
22048             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
22049             bless( {
22050             'argcode' => undef,
22051             'expected' => undef,
22052             'line' => 33,
22053             'lookahead' => 0,
22054             'matchrule' => 0,
22055             'max' => 1,
22056             'min' => 0,
22057             'repspec' => '?',
22058             'subrule' => 'local_var_in'
22059             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
22060             bless( {
22061             'argcode' => undef,
22062             'implicit' => undef,
22063             'line' => 33,
22064             'lookahead' => 0,
22065             'matchrule' => 0,
22066             'subrule' => 'exp'
22067             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22068             bless( {
22069             'argcode' => undef,
22070             'implicit' => undef,
22071             'line' => 33,
22072             'lookahead' => 0,
22073             'matchrule' => 0,
22074             'subrule' => 'command'
22075             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22076             bless( {
22077             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'foreach_statement\',$item[4],[$item[5]],@{$item[3]}] }',
22078             'hashname' => '__ACTION1__',
22079             'line' => 34,
22080             'lookahead' => 0
22081             }, 'XML::XSH2::Parser::_Runtime::Action' )
22082             ],
22083             'line' => 33,
22084             'number' => 8,
22085             'patcount' => 1,
22086             'strcount' => 0,
22087             'uncommit' => undef
22088             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22089             bless( {
22090             'actcount' => 1,
22091             'dircount' => 1,
22092             'error' => undef,
22093             'items' => [
22094             bless( {
22095             'description' => '/(stream)\\\\b/',
22096             'hashname' => '__PATTERN1__',
22097             'ldelim' => '/',
22098             'line' => 36,
22099             'lookahead' => 0,
22100             'mod' => '',
22101             'pattern' => '(stream)\\b',
22102             'rdelim' => '/'
22103             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22104             bless( {
22105             'code' => '$commit = 1',
22106             'hashname' => '__DIRECTIVE1__',
22107             'line' => 36,
22108             'lookahead' => 0,
22109             'name' => ''
22110             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
22111             bless( {
22112             'argcode' => undef,
22113             'implicit' => '/--input-file|:f/, or /--input-pipe|:p/, or /--input-string|:s/, or /--output-file|:F/, or /--output-encoding|:E/, or /--output-pipe|:P/, or /--output-string|:S/, or /--no-output|:N/',
22114             'line' => 46,
22115             'lookahead' => 0,
22116             'matchrule' => 0,
22117             'subrule' => '_alternation_1_of_production_10_of_rule_command'
22118             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22119             bless( {
22120             'argcode' => undef,
22121             'expected' => undef,
22122             'line' => 47,
22123             'lookahead' => 0,
22124             'matchrule' => 0,
22125             'max' => 100000000,
22126             'min' => 1,
22127             'repspec' => 's',
22128             'subrule' => 'stream_select'
22129             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
22130             bless( {
22131             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'stream_process\',$item[3],$item[4]] }',
22132             'hashname' => '__ACTION1__',
22133             'line' => 48,
22134             'lookahead' => 0
22135             }, 'XML::XSH2::Parser::_Runtime::Action' )
22136             ],
22137             'line' => 36,
22138             'number' => 9,
22139             'patcount' => 1,
22140             'strcount' => 0,
22141             'uncommit' => undef
22142             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22143             bless( {
22144             'actcount' => 1,
22145             'dircount' => 1,
22146             'error' => undef,
22147             'items' => [
22148             bless( {
22149             'description' => '/(undef|undefine)\\\\b/',
22150             'hashname' => '__PATTERN1__',
22151             'ldelim' => '/',
22152             'line' => 50,
22153             'lookahead' => 0,
22154             'mod' => '',
22155             'pattern' => '(undef|undefine)\\b',
22156             'rdelim' => '/'
22157             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22158             bless( {
22159             'code' => '$commit = 1',
22160             'hashname' => '__DIRECTIVE1__',
22161             'line' => 50,
22162             'lookahead' => 0,
22163             'name' => ''
22164             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
22165             bless( {
22166             'description' => '/\\\\$?[a-zA-Z_][a-zA-Z0-9_]*/',
22167             'hashname' => '__PATTERN2__',
22168             'ldelim' => '/',
22169             'line' => 50,
22170             'lookahead' => 0,
22171             'mod' => '',
22172             'pattern' => '\\$?[a-zA-Z_][a-zA-Z0-9_]*',
22173             'rdelim' => '/'
22174             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22175             bless( {
22176             'code' => '{
22177             [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'undefine\',$item[3]];
22178             }',
22179             'hashname' => '__ACTION1__',
22180             'line' => 51,
22181             'lookahead' => 0
22182             }, 'XML::XSH2::Parser::_Runtime::Action' )
22183             ],
22184             'line' => 50,
22185             'number' => 10,
22186             'patcount' => 2,
22187             'strcount' => 0,
22188             'uncommit' => undef
22189             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22190             bless( {
22191             'actcount' => 1,
22192             'dircount' => 1,
22193             'error' => undef,
22194             'items' => [
22195             bless( {
22196             'description' => '/(use)\\\\b/',
22197             'hashname' => '__PATTERN1__',
22198             'ldelim' => '/',
22199             'line' => 55,
22200             'lookahead' => 0,
22201             'mod' => '',
22202             'pattern' => '(use)\\b',
22203             'rdelim' => '/'
22204             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22205             bless( {
22206             'code' => '$commit = 1',
22207             'hashname' => '__DIRECTIVE1__',
22208             'line' => 55,
22209             'lookahead' => 0,
22210             'name' => ''
22211             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
22212             bless( {
22213             'description' => '/XML::XSH2::(?:Inline|Compile)/',
22214             'hashname' => '__PATTERN2__',
22215             'ldelim' => '/',
22216             'line' => 55,
22217             'lookahead' => 0,
22218             'mod' => '',
22219             'pattern' => 'XML::XSH2::(?:Inline|Compile)',
22220             'rdelim' => '/'
22221             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22222             bless( {
22223             'code' => '{ 1 }',
22224             'hashname' => '__ACTION1__',
22225             'line' => 56,
22226             'lookahead' => 0
22227             }, 'XML::XSH2::Parser::_Runtime::Action' )
22228             ],
22229             'line' => 55,
22230             'number' => 11,
22231             'patcount' => 2,
22232             'strcount' => 0,
22233             'uncommit' => undef
22234             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22235             bless( {
22236             'actcount' => 1,
22237             'dircount' => 0,
22238             'error' => undef,
22239             'items' => [
22240             bless( {
22241             'description' => '/(test-mode|test_mode)/',
22242             'hashname' => '__PATTERN1__',
22243             'ldelim' => '/',
22244             'line' => 58,
22245             'lookahead' => 0,
22246             'mod' => '',
22247             'pattern' => '(test-mode|test_mode)',
22248             'rdelim' => '/'
22249             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22250             bless( {
22251             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,"test-mode"] }',
22252             'hashname' => '__ACTION1__',
22253             'line' => 59,
22254             'lookahead' => 0
22255             }, 'XML::XSH2::Parser::_Runtime::Action' )
22256             ],
22257             'line' => 58,
22258             'number' => 12,
22259             'patcount' => 1,
22260             'strcount' => 0,
22261             'uncommit' => undef
22262             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22263             bless( {
22264             'actcount' => 1,
22265             'dircount' => 0,
22266             'error' => undef,
22267             'items' => [
22268             bless( {
22269             'description' => '/(run-mode|run_mode)/',
22270             'hashname' => '__PATTERN1__',
22271             'ldelim' => '/',
22272             'line' => 61,
22273             'lookahead' => 0,
22274             'mod' => '',
22275             'pattern' => '(run-mode|run_mode)',
22276             'rdelim' => '/'
22277             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22278             bless( {
22279             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,"run-mode"] }',
22280             'hashname' => '__ACTION1__',
22281             'line' => 62,
22282             'lookahead' => 0
22283             }, 'XML::XSH2::Parser::_Runtime::Action' )
22284             ],
22285             'line' => 61,
22286             'number' => 13,
22287             'patcount' => 1,
22288             'strcount' => 0,
22289             'uncommit' => undef
22290             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22291             bless( {
22292             'actcount' => 1,
22293             'dircount' => 0,
22294             'error' => undef,
22295             'items' => [
22296             bless( {
22297             'description' => '/(?!(?:iterate|try|def|define)\\\\b)/',
22298             'hashname' => '__PATTERN1__',
22299             'ldelim' => '/',
22300             'line' => 64,
22301             'lookahead' => 0,
22302             'mod' => '',
22303             'pattern' => '(?!(?:iterate|try|def|define)\\b)',
22304             'rdelim' => '/'
22305             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22306             bless( {
22307             'description' => '/\\\\.|[a-zA-Z_][-a-zA-Z0-9_]*/',
22308             'hashname' => '__PATTERN2__',
22309             'ldelim' => '/',
22310             'line' => 64,
22311             'lookahead' => 0,
22312             'mod' => '',
22313             'pattern' => '\\.|[a-zA-Z_][-a-zA-Z0-9_]*',
22314             'rdelim' => '/'
22315             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22316             bless( {
22317             'argcode' => undef,
22318             'expected' => undef,
22319             'line' => 64,
22320             'lookahead' => 0,
22321             'matchrule' => 0,
22322             'max' => 100000000,
22323             'min' => 0,
22324             'repspec' => 's?',
22325             'subrule' => 'exp_or_opt'
22326             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
22327             bless( {
22328             'code' => '{
22329             bless
22330             [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,$item[2],@{$item[3]}],
22331             \'XML::XSH2::Command\'
22332             }',
22333             'hashname' => '__ACTION1__',
22334             'line' => 65,
22335             'lookahead' => 0
22336             }, 'XML::XSH2::Parser::_Runtime::Action' )
22337             ],
22338             'line' => 64,
22339             'number' => 14,
22340             'patcount' => 2,
22341             'strcount' => 0,
22342             'uncommit' => undef
22343             }, 'XML::XSH2::Parser::_Runtime::Production' )
22344             ],
22345             'vars' => ''
22346             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
22347             'complex_command' => bless( {
22348             'calls' => [
22349             'statement',
22350             'trail',
22351             'command'
22352             ],
22353             'changed' => 0,
22354             'impcount' => 0,
22355             'line' => 100,
22356             'name' => 'complex_command',
22357             'opcount' => 0,
22358             'prods' => [
22359             bless( {
22360             'actcount' => 0,
22361             'dircount' => 2,
22362             'error' => undef,
22363             'items' => [
22364             bless( {
22365             'description' => '/(?=\\\\s*[\\{\\}]|\\\\s*\\\\Z)/',
22366             'hashname' => '__PATTERN1__',
22367             'ldelim' => '/',
22368             'line' => 101,
22369             'lookahead' => 0,
22370             'mod' => '',
22371             'pattern' => '(?=\\s*[{}]|\\s*\\Z)',
22372             'rdelim' => '/'
22373             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22374             bless( {
22375             'code' => '$commit = 1',
22376             'hashname' => '__DIRECTIVE1__',
22377             'line' => 101,
22378             'lookahead' => 0,
22379             'name' => ''
22380             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
22381             bless( {
22382             'hashname' => '__DIRECTIVE2__',
22383             'line' => 101,
22384             'lookahead' => 0,
22385             'name' => ''
22386             }, 'XML::XSH2::Parser::_Runtime::UncondReject' )
22387             ],
22388             'line' => undef,
22389             'number' => 0,
22390             'patcount' => 1,
22391             'strcount' => 0,
22392             'uncommit' => undef
22393             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22394             bless( {
22395             'actcount' => 0,
22396             'dircount' => 1,
22397             'error' => undef,
22398             'items' => [
22399             bless( {
22400             'description' => '/\\\\s*;/',
22401             'hashname' => '__PATTERN1__',
22402             'ldelim' => '/',
22403             'line' => 102,
22404             'lookahead' => 0,
22405             'mod' => '',
22406             'pattern' => '\\s*;',
22407             'rdelim' => '/'
22408             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22409             bless( {
22410             'code' => '$commit = 1',
22411             'hashname' => '__DIRECTIVE1__',
22412             'line' => 102,
22413             'lookahead' => 0,
22414             'name' => ''
22415             }, 'XML::XSH2::Parser::_Runtime::Directive' )
22416             ],
22417             'line' => 102,
22418             'number' => 1,
22419             'patcount' => 1,
22420             'strcount' => 0,
22421             'uncommit' => undef
22422             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22423             bless( {
22424             'actcount' => 1,
22425             'dircount' => 1,
22426             'error' => undef,
22427             'items' => [
22428             bless( {
22429             'description' => '/(?=(?:foreach|for|if|unless|iterate|while|try|def|define)\\\\b)/',
22430             'hashname' => '__PATTERN1__',
22431             'ldelim' => '/',
22432             'line' => 103,
22433             'lookahead' => 0,
22434             'mod' => '',
22435             'pattern' => '(?=(?:foreach|for|if|unless|iterate|while|try|def|define)\\b)',
22436             'rdelim' => '/'
22437             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22438             bless( {
22439             'argcode' => undef,
22440             'implicit' => undef,
22441             'line' => 103,
22442             'lookahead' => 0,
22443             'matchrule' => 0,
22444             'subrule' => 'statement'
22445             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22446             bless( {
22447             'code' => '$commit = 1',
22448             'hashname' => '__DIRECTIVE1__',
22449             'line' => 103,
22450             'lookahead' => 0,
22451             'name' => ''
22452             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
22453             bless( {
22454             'argcode' => undef,
22455             'expected' => undef,
22456             'line' => 103,
22457             'lookahead' => 0,
22458             'matchrule' => 0,
22459             'max' => 1,
22460             'min' => 0,
22461             'repspec' => '?',
22462             'subrule' => 'trail'
22463             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
22464             bless( {
22465             'code' => '{
22466             if (scalar(@{$item[4]})) {
22467             if ($item[4][0][0] eq \'pipe\') {
22468             $return=[$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'pipe_command\',[$item[2]],$item[4][0][1]]
22469             } else {
22470             $return=[$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'string_pipe_command\',[$item[2]],$item[4][0][1]]
22471             }
22472             } else {
22473             $return=$item[2]
22474             }
22475             }',
22476             'hashname' => '__ACTION1__',
22477             'line' => 104,
22478             'lookahead' => 0
22479             }, 'XML::XSH2::Parser::_Runtime::Action' )
22480             ],
22481             'line' => 103,
22482             'number' => 2,
22483             'patcount' => 1,
22484             'strcount' => 0,
22485             'uncommit' => undef
22486             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22487             bless( {
22488             'actcount' => 1,
22489             'dircount' => 1,
22490             'error' => undef,
22491             'items' => [
22492             bless( {
22493             'argcode' => undef,
22494             'implicit' => undef,
22495             'line' => 116,
22496             'lookahead' => 0,
22497             'matchrule' => 0,
22498             'subrule' => 'command'
22499             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22500             bless( {
22501             'code' => '$commit = 1',
22502             'hashname' => '__DIRECTIVE1__',
22503             'line' => 116,
22504             'lookahead' => 0,
22505             'name' => ''
22506             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
22507             bless( {
22508             'argcode' => undef,
22509             'expected' => undef,
22510             'line' => 116,
22511             'lookahead' => 0,
22512             'matchrule' => 0,
22513             'max' => 1,
22514             'min' => 0,
22515             'repspec' => '?',
22516             'subrule' => 'trail'
22517             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
22518             bless( {
22519             'description' => '/\\\\s*;|(?=\\\\s*\\}|\\\\s*\\\\Z)/',
22520             'hashname' => '__PATTERN1__',
22521             'ldelim' => '/',
22522             'line' => 116,
22523             'lookahead' => 0,
22524             'mod' => '',
22525             'pattern' => '\\s*;|(?=\\s*}|\\s*\\Z)',
22526             'rdelim' => '/'
22527             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22528             bless( {
22529             'code' => '{
22530             if (scalar(@{$item[3]})) {
22531             if ($item[3][0][0] eq \'pipe\') {
22532             $return=[$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'pipe_command\',[$item[1]],$item[3][0][1]]
22533             } else {
22534             $return=[$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'string_pipe_command\',[$item[1]],$item[3][0][1]]
22535             }
22536             } else {
22537             $return=$item[1]
22538             }
22539             }',
22540             'hashname' => '__ACTION1__',
22541             'line' => 117,
22542             'lookahead' => 0
22543             }, 'XML::XSH2::Parser::_Runtime::Action' )
22544             ],
22545             'line' => 116,
22546             'number' => 3,
22547             'patcount' => 1,
22548             'strcount' => 0,
22549             'uncommit' => undef
22550             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22551             bless( {
22552             'actcount' => 0,
22553             'dircount' => 1,
22554             'error' => 1,
22555             'items' => [
22556             bless( {
22557             'commitonly' => '',
22558             'hashname' => '__DIRECTIVE1__',
22559             'line' => 129,
22560             'lookahead' => 0,
22561             'msg' => 'Parse error near: "}.substr($text,0,40).qq{ ..."'
22562             }, 'XML::XSH2::Parser::_Runtime::Error' )
22563             ],
22564             'line' => 129,
22565             'number' => 4,
22566             'patcount' => 0,
22567             'strcount' => 0,
22568             'uncommit' => 0
22569             }, 'XML::XSH2::Parser::_Runtime::Production' )
22570             ],
22571             'vars' => ''
22572             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
22573             'else_block' => bless( {
22574             'calls' => [
22575             'block'
22576             ],
22577             'changed' => 0,
22578             'impcount' => 0,
22579             'line' => 370,
22580             'name' => 'else_block',
22581             'opcount' => 0,
22582             'prods' => [
22583             bless( {
22584             'actcount' => 1,
22585             'dircount' => 1,
22586             'error' => undef,
22587             'items' => [
22588             bless( {
22589             'description' => '/(else)\\\\b/',
22590             'hashname' => '__PATTERN1__',
22591             'ldelim' => '/',
22592             'line' => 371,
22593             'lookahead' => 0,
22594             'mod' => '',
22595             'pattern' => '(else)\\b',
22596             'rdelim' => '/'
22597             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22598             bless( {
22599             'code' => '$commit = 1',
22600             'hashname' => '__DIRECTIVE1__',
22601             'line' => 371,
22602             'lookahead' => 0,
22603             'name' => ''
22604             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
22605             bless( {
22606             'argcode' => undef,
22607             'implicit' => undef,
22608             'line' => 371,
22609             'lookahead' => 0,
22610             'matchrule' => 0,
22611             'subrule' => 'block'
22612             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22613             bless( {
22614             'code' => '{ [[undef,$item[3]]] }',
22615             'hashname' => '__ACTION1__',
22616             'line' => 372,
22617             'lookahead' => 0
22618             }, 'XML::XSH2::Parser::_Runtime::Action' )
22619             ],
22620             'line' => undef,
22621             'number' => 0,
22622             'patcount' => 1,
22623             'strcount' => 0,
22624             'uncommit' => undef
22625             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22626             bless( {
22627             'actcount' => 1,
22628             'dircount' => 0,
22629             'error' => undef,
22630             'items' => [
22631             bless( {
22632             'description' => '/(?!else)/',
22633             'hashname' => '__PATTERN1__',
22634             'ldelim' => '/',
22635             'line' => 374,
22636             'lookahead' => 0,
22637             'mod' => '',
22638             'pattern' => '(?!else)',
22639             'rdelim' => '/'
22640             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22641             bless( {
22642             'code' => '{ [] }',
22643             'hashname' => '__ACTION1__',
22644             'line' => 375,
22645             'lookahead' => 0
22646             }, 'XML::XSH2::Parser::_Runtime::Action' )
22647             ],
22648             'line' => 374,
22649             'number' => 1,
22650             'patcount' => 1,
22651             'strcount' => 0,
22652             'uncommit' => undef
22653             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22654             bless( {
22655             'actcount' => 0,
22656             'dircount' => 2,
22657             'error' => undef,
22658             'items' => [
22659             bless( {
22660             'code' => '$commit=0;1',
22661             'hashname' => '__DIRECTIVE1__',
22662             'line' => 377,
22663             'lookahead' => 0,
22664             'name' => ''
22665             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
22666             bless( {
22667             'commitonly' => '',
22668             'hashname' => '__DIRECTIVE2__',
22669             'line' => 377,
22670             'lookahead' => 0,
22671             'msg' => 'Parse error near keyword else: "}.substr($text,0,40).qq{ ..."'
22672             }, 'XML::XSH2::Parser::_Runtime::Error' )
22673             ],
22674             'line' => 377,
22675             'number' => 2,
22676             'patcount' => 0,
22677             'strcount' => 0,
22678             'uncommit' => 1
22679             }, 'XML::XSH2::Parser::_Runtime::Production' )
22680             ],
22681             'vars' => ''
22682             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
22683             'elsif_block' => bless( {
22684             'calls' => [
22685             'exp',
22686             'block',
22687             'elsif_block'
22688             ],
22689             'changed' => 0,
22690             'impcount' => 0,
22691             'line' => 361,
22692             'name' => 'elsif_block',
22693             'opcount' => 0,
22694             'prods' => [
22695             bless( {
22696             'actcount' => 1,
22697             'dircount' => 1,
22698             'error' => undef,
22699             'items' => [
22700             bless( {
22701             'description' => '/(elsif)\\\\b/',
22702             'hashname' => '__PATTERN1__',
22703             'ldelim' => '/',
22704             'line' => 362,
22705             'lookahead' => 0,
22706             'mod' => '',
22707             'pattern' => '(elsif)\\b',
22708             'rdelim' => '/'
22709             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22710             bless( {
22711             'code' => '$commit = 1',
22712             'hashname' => '__DIRECTIVE1__',
22713             'line' => 362,
22714             'lookahead' => 0,
22715             'name' => ''
22716             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
22717             bless( {
22718             'argcode' => undef,
22719             'implicit' => undef,
22720             'line' => 362,
22721             'lookahead' => 0,
22722             'matchrule' => 0,
22723             'subrule' => 'exp'
22724             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22725             bless( {
22726             'argcode' => undef,
22727             'implicit' => undef,
22728             'line' => 362,
22729             'lookahead' => 0,
22730             'matchrule' => 0,
22731             'subrule' => 'block'
22732             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22733             bless( {
22734             'argcode' => undef,
22735             'implicit' => undef,
22736             'line' => 362,
22737             'lookahead' => 0,
22738             'matchrule' => 0,
22739             'subrule' => 'elsif_block'
22740             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22741             bless( {
22742             'code' => '{ [[$item[3],$item[4]],@{$item[5]}] }',
22743             'hashname' => '__ACTION1__',
22744             'line' => 363,
22745             'lookahead' => 0
22746             }, 'XML::XSH2::Parser::_Runtime::Action' )
22747             ],
22748             'line' => undef,
22749             'number' => 0,
22750             'patcount' => 1,
22751             'strcount' => 0,
22752             'uncommit' => undef
22753             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22754             bless( {
22755             'actcount' => 1,
22756             'dircount' => 0,
22757             'error' => undef,
22758             'items' => [
22759             bless( {
22760             'description' => '/(?!elsif)/',
22761             'hashname' => '__PATTERN1__',
22762             'ldelim' => '/',
22763             'line' => 365,
22764             'lookahead' => 0,
22765             'mod' => '',
22766             'pattern' => '(?!elsif)',
22767             'rdelim' => '/'
22768             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22769             bless( {
22770             'code' => '{ [] }',
22771             'hashname' => '__ACTION1__',
22772             'line' => 366,
22773             'lookahead' => 0
22774             }, 'XML::XSH2::Parser::_Runtime::Action' )
22775             ],
22776             'line' => 365,
22777             'number' => 1,
22778             'patcount' => 1,
22779             'strcount' => 0,
22780             'uncommit' => undef
22781             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22782             bless( {
22783             'actcount' => 0,
22784             'dircount' => 2,
22785             'error' => undef,
22786             'items' => [
22787             bless( {
22788             'code' => '$commit=0;1',
22789             'hashname' => '__DIRECTIVE1__',
22790             'line' => 368,
22791             'lookahead' => 0,
22792             'name' => ''
22793             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
22794             bless( {
22795             'commitonly' => '',
22796             'hashname' => '__DIRECTIVE2__',
22797             'line' => 368,
22798             'lookahead' => 0,
22799             'msg' => 'Parse error near keyword elsif: "}.substr($text,0,40).qq{ ..."'
22800             }, 'XML::XSH2::Parser::_Runtime::Error' )
22801             ],
22802             'line' => 368,
22803             'number' => 2,
22804             'patcount' => 0,
22805             'strcount' => 0,
22806             'uncommit' => 1
22807             }, 'XML::XSH2::Parser::_Runtime::Production' )
22808             ],
22809             'vars' => ''
22810             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
22811             'enc_string' => bless( {
22812             'calls' => [
22813             'exp'
22814             ],
22815             'changed' => 0,
22816             'impcount' => 0,
22817             'line' => 167,
22818             'name' => 'enc_string',
22819             'opcount' => 0,
22820             'prods' => [
22821             bless( {
22822             'actcount' => 0,
22823             'dircount' => 0,
22824             'error' => undef,
22825             'items' => [
22826             bless( {
22827             'argcode' => undef,
22828             'implicit' => undef,
22829             'line' => 168,
22830             'lookahead' => 0,
22831             'matchrule' => 0,
22832             'subrule' => 'exp'
22833             }, 'XML::XSH2::Parser::_Runtime::Subrule' )
22834             ],
22835             'line' => undef,
22836             'number' => 0,
22837             'patcount' => 0,
22838             'strcount' => 0,
22839             'uncommit' => undef
22840             }, 'XML::XSH2::Parser::_Runtime::Production' )
22841             ],
22842             'vars' => ''
22843             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
22844             'eof' => bless( {
22845             'calls' => [],
22846             'changed' => 0,
22847             'impcount' => 0,
22848             'line' => 317,
22849             'name' => 'eof',
22850             'opcount' => 0,
22851             'prods' => [
22852             bless( {
22853             'actcount' => 1,
22854             'dircount' => 0,
22855             'error' => undef,
22856             'items' => [
22857             bless( {
22858             'description' => '/\\\\Z/',
22859             'hashname' => '__PATTERN1__',
22860             'ldelim' => '/',
22861             'line' => 318,
22862             'lookahead' => 0,
22863             'mod' => '',
22864             'pattern' => '\\Z',
22865             'rdelim' => '/'
22866             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22867             bless( {
22868             'code' => '{ 1; }',
22869             'hashname' => '__ACTION1__',
22870             'line' => 319,
22871             'lookahead' => 0
22872             }, 'XML::XSH2::Parser::_Runtime::Action' )
22873             ],
22874             'line' => undef,
22875             'number' => 0,
22876             'patcount' => 1,
22877             'strcount' => 0,
22878             'uncommit' => undef
22879             }, 'XML::XSH2::Parser::_Runtime::Production' )
22880             ],
22881             'vars' => ''
22882             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
22883             'exp' => bless( {
22884             'calls' => [
22885             'perl_block',
22886             'block',
22887             'inline_doc',
22888             'xpath'
22889             ],
22890             'changed' => 0,
22891             'impcount' => 0,
22892             'line' => 302,
22893             'name' => 'exp',
22894             'opcount' => 0,
22895             'prods' => [
22896             bless( {
22897             'actcount' => 1,
22898             'dircount' => 0,
22899             'error' => undef,
22900             'items' => [
22901             bless( {
22902             'description' => '/^(?=\\{)/',
22903             'hashname' => '__PATTERN1__',
22904             'ldelim' => '/',
22905             'line' => 303,
22906             'lookahead' => 0,
22907             'mod' => '',
22908             'pattern' => '^(?={)',
22909             'rdelim' => '/'
22910             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22911             bless( {
22912             'argcode' => undef,
22913             'implicit' => undef,
22914             'line' => 303,
22915             'lookahead' => 0,
22916             'matchrule' => 0,
22917             'subrule' => 'perl_block'
22918             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22919             bless( {
22920             'code' => '{ $item[2] }',
22921             'hashname' => '__ACTION1__',
22922             'line' => 304,
22923             'lookahead' => 0
22924             }, 'XML::XSH2::Parser::_Runtime::Action' )
22925             ],
22926             'line' => undef,
22927             'number' => 0,
22928             'patcount' => 1,
22929             'strcount' => 0,
22930             'uncommit' => undef
22931             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22932             bless( {
22933             'actcount' => 1,
22934             'dircount' => 0,
22935             'error' => undef,
22936             'items' => [
22937             bless( {
22938             'description' => '\'&\'',
22939             'hashname' => '__STRING1__',
22940             'line' => 306,
22941             'lookahead' => 0,
22942             'pattern' => '&'
22943             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
22944             bless( {
22945             'argcode' => undef,
22946             'implicit' => undef,
22947             'line' => 306,
22948             'lookahead' => 0,
22949             'matchrule' => 0,
22950             'subrule' => 'block'
22951             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22952             bless( {
22953             'code' => '{ $item[2] }',
22954             'hashname' => '__ACTION1__',
22955             'line' => 307,
22956             'lookahead' => 0
22957             }, 'XML::XSH2::Parser::_Runtime::Action' )
22958             ],
22959             'line' => 306,
22960             'number' => 1,
22961             'patcount' => 0,
22962             'strcount' => 1,
22963             'uncommit' => undef
22964             }, 'XML::XSH2::Parser::_Runtime::Production' ),
22965             bless( {
22966             'actcount' => 1,
22967             'dircount' => 0,
22968             'error' => undef,
22969             'items' => [
22970             bless( {
22971             'description' => '/^(?=<<)/',
22972             'hashname' => '__PATTERN1__',
22973             'ldelim' => '/',
22974             'line' => 309,
22975             'lookahead' => 0,
22976             'mod' => '',
22977             'pattern' => '^(?=<<)',
22978             'rdelim' => '/'
22979             }, 'XML::XSH2::Parser::_Runtime::Token' ),
22980             bless( {
22981             'argcode' => undef,
22982             'implicit' => undef,
22983             'line' => 309,
22984             'lookahead' => 0,
22985             'matchrule' => 0,
22986             'subrule' => 'inline_doc'
22987             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
22988             bless( {
22989             'code' => '{ $item[2] }',
22990             'hashname' => '__ACTION1__',
22991             'line' => 310,
22992             'lookahead' => 0
22993             }, 'XML::XSH2::Parser::_Runtime::Action' )
22994             ],
22995             'line' => 309,
22996             'number' => 2,
22997             'patcount' => 1,
22998             'strcount' => 0,
22999             'uncommit' => undef
23000             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23001             bless( {
23002             'actcount' => 0,
23003             'dircount' => 0,
23004             'error' => undef,
23005             'items' => [
23006             bless( {
23007             'argcode' => undef,
23008             'implicit' => undef,
23009             'line' => 312,
23010             'lookahead' => 0,
23011             'matchrule' => 0,
23012             'subrule' => 'xpath'
23013             }, 'XML::XSH2::Parser::_Runtime::Subrule' )
23014             ],
23015             'line' => 312,
23016             'number' => 3,
23017             'patcount' => 0,
23018             'strcount' => 0,
23019             'uncommit' => undef
23020             }, 'XML::XSH2::Parser::_Runtime::Production' )
23021             ],
23022             'vars' => ''
23023             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23024             'exp_or_opt' => bless( {
23025             'calls' => [
23026             'option',
23027             'exp'
23028             ],
23029             'changed' => 0,
23030             'impcount' => 0,
23031             'line' => 136,
23032             'name' => 'exp_or_opt',
23033             'opcount' => 0,
23034             'prods' => [
23035             bless( {
23036             'actcount' => 0,
23037             'dircount' => 2,
23038             'error' => undef,
23039             'items' => [
23040             bless( {
23041             'description' => '/(?=\\\\s*[\\};]|\\\\s*\\\\Z)/',
23042             'hashname' => '__PATTERN1__',
23043             'ldelim' => '/',
23044             'line' => 137,
23045             'lookahead' => 0,
23046             'mod' => '',
23047             'pattern' => '(?=\\s*[};]|\\s*\\Z)',
23048             'rdelim' => '/'
23049             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23050             bless( {
23051             'code' => '$commit = 1',
23052             'hashname' => '__DIRECTIVE1__',
23053             'line' => 137,
23054             'lookahead' => 0,
23055             'name' => ''
23056             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
23057             bless( {
23058             'hashname' => '__DIRECTIVE2__',
23059             'line' => 137,
23060             'lookahead' => 0,
23061             'name' => ''
23062             }, 'XML::XSH2::Parser::_Runtime::UncondReject' )
23063             ],
23064             'line' => undef,
23065             'number' => 0,
23066             'patcount' => 1,
23067             'strcount' => 0,
23068             'uncommit' => undef
23069             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23070             bless( {
23071             'actcount' => 0,
23072             'dircount' => 0,
23073             'error' => undef,
23074             'items' => [
23075             bless( {
23076             'argcode' => undef,
23077             'implicit' => undef,
23078             'line' => 138,
23079             'lookahead' => 0,
23080             'matchrule' => 0,
23081             'subrule' => 'option'
23082             }, 'XML::XSH2::Parser::_Runtime::Subrule' )
23083             ],
23084             'line' => 138,
23085             'number' => 1,
23086             'patcount' => 0,
23087             'strcount' => 0,
23088             'uncommit' => undef
23089             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23090             bless( {
23091             'actcount' => 0,
23092             'dircount' => 0,
23093             'error' => undef,
23094             'items' => [
23095             bless( {
23096             'argcode' => undef,
23097             'implicit' => undef,
23098             'line' => 139,
23099             'lookahead' => 0,
23100             'matchrule' => 0,
23101             'subrule' => 'exp'
23102             }, 'XML::XSH2::Parser::_Runtime::Subrule' )
23103             ],
23104             'line' => 139,
23105             'number' => 2,
23106             'patcount' => 0,
23107             'strcount' => 0,
23108             'uncommit' => undef
23109             }, 'XML::XSH2::Parser::_Runtime::Production' )
23110             ],
23111             'vars' => ''
23112             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23113             'filename' => bless( {
23114             'calls' => [
23115             'exp'
23116             ],
23117             'changed' => 0,
23118             'impcount' => 0,
23119             'line' => 173,
23120             'name' => 'filename',
23121             'opcount' => 0,
23122             'prods' => [
23123             bless( {
23124             'actcount' => 0,
23125             'dircount' => 0,
23126             'error' => undef,
23127             'items' => [
23128             bless( {
23129             'argcode' => undef,
23130             'implicit' => undef,
23131             'line' => 174,
23132             'lookahead' => 0,
23133             'matchrule' => 0,
23134             'subrule' => 'exp'
23135             }, 'XML::XSH2::Parser::_Runtime::Subrule' )
23136             ],
23137             'line' => undef,
23138             'number' => 0,
23139             'patcount' => 0,
23140             'strcount' => 0,
23141             'uncommit' => undef
23142             }, 'XML::XSH2::Parser::_Runtime::Production' )
23143             ],
23144             'vars' => ''
23145             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23146             'inline_doc' => bless( {
23147             'calls' => [
23148             'inline_doc_string'
23149             ],
23150             'changed' => 0,
23151             'impcount' => 0,
23152             'line' => 149,
23153             'name' => 'inline_doc',
23154             'opcount' => 0,
23155             'prods' => [
23156             bless( {
23157             'actcount' => 1,
23158             'dircount' => 1,
23159             'error' => undef,
23160             'items' => [
23161             bless( {
23162             'description' => '/<
23163             'hashname' => '__PATTERN1__',
23164             'ldelim' => '/',
23165             'line' => 150,
23166             'lookahead' => 0,
23167             'mod' => '',
23168             'pattern' => '<<',
23169             'rdelim' => '/'
23170             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23171             bless( {
23172             'argcode' => undef,
23173             'implicit' => undef,
23174             'line' => 150,
23175             'lookahead' => 0,
23176             'matchrule' => 0,
23177             'subrule' => 'inline_doc_string'
23178             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
23179             bless( {
23180             'code' => 'my $oldskip = $skip; $skip=""; $oldskip',
23181             'hashname' => '__DIRECTIVE1__',
23182             'line' => 150,
23183             'lookahead' => 0,
23184             'name' => ''
23185             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
23186             bless( {
23187             'description' => '/.*\\\\n/',
23188             'hashname' => '__PATTERN2__',
23189             'ldelim' => '/',
23190             'line' => 150,
23191             'lookahead' => 0,
23192             'mod' => '',
23193             'pattern' => '.*\\n',
23194             'rdelim' => '/'
23195             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23196             bless( {
23197             'description' => '/(.|\\\\n)*?\\\\n$item[2][1]\\\\s*(\\\\n|$)/',
23198             'hashname' => '__PATTERN3__',
23199             'ldelim' => '/',
23200             'line' => 150,
23201             'lookahead' => 0,
23202             'mod' => '',
23203             'pattern' => '(.|\\n)*?\\n$item[2][1]\\s*(\\n|$)',
23204             'rdelim' => '/'
23205             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23206             bless( {
23207             'code' => '{
23208             $text=$item[4].$text;
23209             local $_=$item[5]; s/\\n$item[2][1]\\s*$//;
23210             my $paren = $item[2][0];
23211             $paren = \'"\' if $paren eq "";
23212             if ($paren eq "\'") {
23213             $paren = \'"\';
23214             s{(\\\\)(.|\\n)|(\\$)}{ (defined($3) and $3 eq \'$\') ? "\\\\\\$"
23215             : ((defined($2) and $2 eq "\\\\")
23216             ? "\\\\\\\\" : ((defined($2) and $2 eq "\'") ? "\'" : (
23217             (defined($2) and $2 eq \'$\') ? "\\\\\\\\\\\\$2" :
23218             "\\\\\\\\$2"))) }eg;
23219             } "<<".$paren.$_;
23220             }',
23221             'hashname' => '__ACTION1__',
23222             'line' => 151,
23223             'lookahead' => 0
23224             }, 'XML::XSH2::Parser::_Runtime::Action' )
23225             ],
23226             'line' => undef,
23227             'number' => 0,
23228             'patcount' => 3,
23229             'strcount' => 0,
23230             'uncommit' => undef
23231             }, 'XML::XSH2::Parser::_Runtime::Production' )
23232             ],
23233             'vars' => ''
23234             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23235             'inline_doc_string' => bless( {
23236             'calls' => [],
23237             'changed' => 0,
23238             'impcount' => 0,
23239             'line' => 144,
23240             'name' => 'inline_doc_string',
23241             'opcount' => 0,
23242             'prods' => [
23243             bless( {
23244             'actcount' => 1,
23245             'dircount' => 0,
23246             'error' => undef,
23247             'items' => [
23248             bless( {
23249             'description' => '/\'[a-zA-Z_][a-zA-Z0-9_]*\'|"[a-zA-Z_][a-zA-Z0-9_]*"|\\\\([a-zA-Z_][a-zA-Z0-9_]*\\\\)|\\\\\\{[a-zA-Z_][a-zA-Z0-9_]*\\\\\\}|[a-zA-Z_][a-zA-Z0-9_]*/',
23250             'hashname' => '__PATTERN1__',
23251             'ldelim' => '/',
23252             'line' => 145,
23253             'lookahead' => 0,
23254             'mod' => '',
23255             'pattern' => '\'[a-zA-Z_][a-zA-Z0-9_]*\'|"[a-zA-Z_][a-zA-Z0-9_]*"|\\([a-zA-Z_][a-zA-Z0-9_]*\\)|\\{[a-zA-Z_][a-zA-Z0-9_]*\\}|[a-zA-Z_][a-zA-Z0-9_]*',
23256             'rdelim' => '/'
23257             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23258             bless( {
23259             'code' => '{ [($item[1]=~/^([\'"({])?(.*?)([\'")}])?$/)] }',
23260             'hashname' => '__ACTION1__',
23261             'line' => 146,
23262             'lookahead' => 0
23263             }, 'XML::XSH2::Parser::_Runtime::Action' )
23264             ],
23265             'line' => undef,
23266             'number' => 0,
23267             'patcount' => 1,
23268             'strcount' => 0,
23269             'uncommit' => undef
23270             }, 'XML::XSH2::Parser::_Runtime::Production' )
23271             ],
23272             'vars' => ''
23273             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23274             'loc' => bless( {
23275             'calls' => [],
23276             'changed' => 0,
23277             'impcount' => 0,
23278             'line' => 405,
23279             'name' => 'loc',
23280             'opcount' => 0,
23281             'prods' => [
23282             bless( {
23283             'actcount' => 1,
23284             'dircount' => 0,
23285             'error' => undef,
23286             'items' => [
23287             bless( {
23288             'description' => '/after\\\\s/',
23289             'hashname' => '__PATTERN1__',
23290             'ldelim' => '/',
23291             'line' => 406,
23292             'lookahead' => 0,
23293             'mod' => '',
23294             'pattern' => 'after\\s',
23295             'rdelim' => '/'
23296             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23297             bless( {
23298             'code' => '{ "after" }',
23299             'hashname' => '__ACTION1__',
23300             'line' => 407,
23301             'lookahead' => 0
23302             }, 'XML::XSH2::Parser::_Runtime::Action' )
23303             ],
23304             'line' => undef,
23305             'number' => 0,
23306             'patcount' => 1,
23307             'strcount' => 0,
23308             'uncommit' => undef
23309             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23310             bless( {
23311             'actcount' => 1,
23312             'dircount' => 0,
23313             'error' => undef,
23314             'items' => [
23315             bless( {
23316             'description' => '/before\\\\s/',
23317             'hashname' => '__PATTERN1__',
23318             'ldelim' => '/',
23319             'line' => 409,
23320             'lookahead' => 0,
23321             'mod' => '',
23322             'pattern' => 'before\\s',
23323             'rdelim' => '/'
23324             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23325             bless( {
23326             'code' => '{ "before" }',
23327             'hashname' => '__ACTION1__',
23328             'line' => 410,
23329             'lookahead' => 0
23330             }, 'XML::XSH2::Parser::_Runtime::Action' )
23331             ],
23332             'line' => 409,
23333             'number' => 1,
23334             'patcount' => 1,
23335             'strcount' => 0,
23336             'uncommit' => undef
23337             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23338             bless( {
23339             'actcount' => 1,
23340             'dircount' => 0,
23341             'error' => undef,
23342             'items' => [
23343             bless( {
23344             'description' => '/(in)?to\\\\s/',
23345             'hashname' => '__PATTERN1__',
23346             'ldelim' => '/',
23347             'line' => 412,
23348             'lookahead' => 0,
23349             'mod' => '',
23350             'pattern' => '(in)?to\\s',
23351             'rdelim' => '/'
23352             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23353             bless( {
23354             'code' => '{ "into" }',
23355             'hashname' => '__ACTION1__',
23356             'line' => 413,
23357             'lookahead' => 0
23358             }, 'XML::XSH2::Parser::_Runtime::Action' )
23359             ],
23360             'line' => 412,
23361             'number' => 2,
23362             'patcount' => 1,
23363             'strcount' => 0,
23364             'uncommit' => undef
23365             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23366             bless( {
23367             'actcount' => 1,
23368             'dircount' => 0,
23369             'error' => undef,
23370             'items' => [
23371             bless( {
23372             'description' => '/(append(ing)?|as\\\\s+(a\\\\s+)child(\\\\s+of)?)\\\\s/',
23373             'hashname' => '__PATTERN1__',
23374             'ldelim' => '/',
23375             'line' => 415,
23376             'lookahead' => 0,
23377             'mod' => '',
23378             'pattern' => '(append(ing)?|as\\s+(a\\s+)child(\\s+of)?)\\s',
23379             'rdelim' => '/'
23380             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23381             bless( {
23382             'code' => '{ "append" }',
23383             'hashname' => '__ACTION1__',
23384             'line' => 416,
23385             'lookahead' => 0
23386             }, 'XML::XSH2::Parser::_Runtime::Action' )
23387             ],
23388             'line' => 415,
23389             'number' => 3,
23390             'patcount' => 1,
23391             'strcount' => 0,
23392             'uncommit' => undef
23393             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23394             bless( {
23395             'actcount' => 1,
23396             'dircount' => 0,
23397             'error' => undef,
23398             'items' => [
23399             bless( {
23400             'description' => '/(prepend(ing)?|(as\\\\s+)(the\\\\s+)first(\\\\s+child(\\\\s+of)?)?)\\\\s/',
23401             'hashname' => '__PATTERN1__',
23402             'ldelim' => '/',
23403             'line' => 418,
23404             'lookahead' => 0,
23405             'mod' => '',
23406             'pattern' => '(prepend(ing)?|(as\\s+)(the\\s+)first(\\s+child(\\s+of)?)?)\\s',
23407             'rdelim' => '/'
23408             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23409             bless( {
23410             'code' => '{ "prepend" }',
23411             'hashname' => '__ACTION1__',
23412             'line' => 419,
23413             'lookahead' => 0
23414             }, 'XML::XSH2::Parser::_Runtime::Action' )
23415             ],
23416             'line' => 418,
23417             'number' => 4,
23418             'patcount' => 1,
23419             'strcount' => 0,
23420             'uncommit' => undef
23421             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23422             bless( {
23423             'actcount' => 1,
23424             'dircount' => 0,
23425             'error' => undef,
23426             'items' => [
23427             bless( {
23428             'description' => '/(replace|instead( of)?)\\\\s/',
23429             'hashname' => '__PATTERN1__',
23430             'ldelim' => '/',
23431             'line' => 421,
23432             'lookahead' => 0,
23433             'mod' => '',
23434             'pattern' => '(replace|instead( of)?)\\s',
23435             'rdelim' => '/'
23436             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23437             bless( {
23438             'code' => '{ "replace" }',
23439             'hashname' => '__ACTION1__',
23440             'line' => 422,
23441             'lookahead' => 0
23442             }, 'XML::XSH2::Parser::_Runtime::Action' )
23443             ],
23444             'line' => 421,
23445             'number' => 5,
23446             'patcount' => 1,
23447             'strcount' => 0,
23448             'uncommit' => undef
23449             }, 'XML::XSH2::Parser::_Runtime::Production' )
23450             ],
23451             'vars' => ''
23452             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23453             'local_var' => bless( {
23454             'calls' => [
23455             '_alternation_1_of_production_1_of_rule_local_var',
23456             'variable'
23457             ],
23458             'changed' => 0,
23459             'impcount' => 1,
23460             'line' => 379,
23461             'name' => 'local_var',
23462             'opcount' => 0,
23463             'prods' => [
23464             bless( {
23465             'actcount' => 1,
23466             'dircount' => 0,
23467             'error' => undef,
23468             'items' => [
23469             bless( {
23470             'argcode' => undef,
23471             'expected' => '/(local|my)\\\\s/',
23472             'line' => 381,
23473             'lookahead' => 0,
23474             'matchrule' => 0,
23475             'max' => 1,
23476             'min' => 0,
23477             'repspec' => '?',
23478             'subrule' => '_alternation_1_of_production_1_of_rule_local_var'
23479             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
23480             bless( {
23481             'argcode' => undef,
23482             'implicit' => undef,
23483             'line' => 381,
23484             'lookahead' => 0,
23485             'matchrule' => 0,
23486             'subrule' => 'variable'
23487             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
23488             bless( {
23489             'code' => '{ [$item[2],@{$item[1]}] }',
23490             'hashname' => '__ACTION1__',
23491             'line' => 382,
23492             'lookahead' => 0
23493             }, 'XML::XSH2::Parser::_Runtime::Action' )
23494             ],
23495             'line' => undef,
23496             'number' => 0,
23497             'patcount' => 0,
23498             'strcount' => 0,
23499             'uncommit' => undef
23500             }, 'XML::XSH2::Parser::_Runtime::Production' )
23501             ],
23502             'vars' => ''
23503             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23504             'local_var_in' => bless( {
23505             'calls' => [
23506             'local_var'
23507             ],
23508             'changed' => 0,
23509             'impcount' => 0,
23510             'line' => 385,
23511             'name' => 'local_var_in',
23512             'opcount' => 0,
23513             'prods' => [
23514             bless( {
23515             'actcount' => 1,
23516             'dircount' => 0,
23517             'error' => undef,
23518             'items' => [
23519             bless( {
23520             'argcode' => undef,
23521             'implicit' => undef,
23522             'line' => 386,
23523             'lookahead' => 0,
23524             'matchrule' => 0,
23525             'subrule' => 'local_var'
23526             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
23527             bless( {
23528             'description' => '\'in\'',
23529             'hashname' => '__STRING1__',
23530             'line' => 386,
23531             'lookahead' => 0,
23532             'pattern' => 'in'
23533             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
23534             bless( {
23535             'code' => '{ $item[1] }',
23536             'hashname' => '__ACTION1__',
23537             'line' => 387,
23538             'lookahead' => 0
23539             }, 'XML::XSH2::Parser::_Runtime::Action' )
23540             ],
23541             'line' => undef,
23542             'number' => 0,
23543             'patcount' => 0,
23544             'strcount' => 1,
23545             'uncommit' => undef
23546             }, 'XML::XSH2::Parser::_Runtime::Production' )
23547             ],
23548             'vars' => ''
23549             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23550             'loose_exp' => bless( {
23551             'calls' => [
23552             'perl_block',
23553             'block',
23554             'inline_doc',
23555             'xpinter'
23556             ],
23557             'changed' => 0,
23558             'impcount' => 0,
23559             'line' => 290,
23560             'name' => 'loose_exp',
23561             'opcount' => 0,
23562             'prods' => [
23563             bless( {
23564             'actcount' => 1,
23565             'dircount' => 0,
23566             'error' => undef,
23567             'items' => [
23568             bless( {
23569             'description' => '/^(?=\\{)/',
23570             'hashname' => '__PATTERN1__',
23571             'ldelim' => '/',
23572             'line' => 291,
23573             'lookahead' => 0,
23574             'mod' => '',
23575             'pattern' => '^(?={)',
23576             'rdelim' => '/'
23577             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23578             bless( {
23579             'argcode' => undef,
23580             'implicit' => undef,
23581             'line' => 291,
23582             'lookahead' => 0,
23583             'matchrule' => 0,
23584             'subrule' => 'perl_block'
23585             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
23586             bless( {
23587             'code' => '{ $item[2] }',
23588             'hashname' => '__ACTION1__',
23589             'line' => 292,
23590             'lookahead' => 0
23591             }, 'XML::XSH2::Parser::_Runtime::Action' )
23592             ],
23593             'line' => undef,
23594             'number' => 0,
23595             'patcount' => 1,
23596             'strcount' => 0,
23597             'uncommit' => undef
23598             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23599             bless( {
23600             'actcount' => 1,
23601             'dircount' => 0,
23602             'error' => undef,
23603             'items' => [
23604             bless( {
23605             'description' => '\'&\'',
23606             'hashname' => '__STRING1__',
23607             'line' => 294,
23608             'lookahead' => 0,
23609             'pattern' => '&'
23610             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
23611             bless( {
23612             'argcode' => undef,
23613             'implicit' => undef,
23614             'line' => 294,
23615             'lookahead' => 0,
23616             'matchrule' => 0,
23617             'subrule' => 'block'
23618             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
23619             bless( {
23620             'code' => '{ $item[2] }',
23621             'hashname' => '__ACTION1__',
23622             'line' => 295,
23623             'lookahead' => 0
23624             }, 'XML::XSH2::Parser::_Runtime::Action' )
23625             ],
23626             'line' => 294,
23627             'number' => 1,
23628             'patcount' => 0,
23629             'strcount' => 1,
23630             'uncommit' => undef
23631             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23632             bless( {
23633             'actcount' => 1,
23634             'dircount' => 0,
23635             'error' => undef,
23636             'items' => [
23637             bless( {
23638             'description' => '/^(?=<<)/',
23639             'hashname' => '__PATTERN1__',
23640             'ldelim' => '/',
23641             'line' => 297,
23642             'lookahead' => 0,
23643             'mod' => '',
23644             'pattern' => '^(?=<<)',
23645             'rdelim' => '/'
23646             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23647             bless( {
23648             'argcode' => undef,
23649             'implicit' => undef,
23650             'line' => 297,
23651             'lookahead' => 0,
23652             'matchrule' => 0,
23653             'subrule' => 'inline_doc'
23654             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
23655             bless( {
23656             'code' => '{ $item[2] }',
23657             'hashname' => '__ACTION1__',
23658             'line' => 298,
23659             'lookahead' => 0
23660             }, 'XML::XSH2::Parser::_Runtime::Action' )
23661             ],
23662             'line' => 297,
23663             'number' => 2,
23664             'patcount' => 1,
23665             'strcount' => 0,
23666             'uncommit' => undef
23667             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23668             bless( {
23669             'actcount' => 0,
23670             'dircount' => 0,
23671             'error' => undef,
23672             'items' => [
23673             bless( {
23674             'argcode' => undef,
23675             'implicit' => undef,
23676             'line' => 300,
23677             'lookahead' => 0,
23678             'matchrule' => 0,
23679             'subrule' => 'xpinter'
23680             }, 'XML::XSH2::Parser::_Runtime::Subrule' )
23681             ],
23682             'line' => 300,
23683             'number' => 3,
23684             'patcount' => 0,
23685             'strcount' => 0,
23686             'uncommit' => undef
23687             }, 'XML::XSH2::Parser::_Runtime::Production' )
23688             ],
23689             'vars' => ''
23690             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23691             'nodename' => bless( {
23692             'calls' => [
23693             'exp'
23694             ],
23695             'changed' => 0,
23696             'impcount' => 0,
23697             'line' => 176,
23698             'name' => 'nodename',
23699             'opcount' => 0,
23700             'prods' => [
23701             bless( {
23702             'actcount' => 0,
23703             'dircount' => 0,
23704             'error' => undef,
23705             'items' => [
23706             bless( {
23707             'argcode' => undef,
23708             'implicit' => undef,
23709             'line' => 177,
23710             'lookahead' => 0,
23711             'matchrule' => 0,
23712             'subrule' => 'exp'
23713             }, 'XML::XSH2::Parser::_Runtime::Subrule' )
23714             ],
23715             'line' => undef,
23716             'number' => 0,
23717             'patcount' => 0,
23718             'strcount' => 0,
23719             'uncommit' => undef
23720             }, 'XML::XSH2::Parser::_Runtime::Production' )
23721             ],
23722             'vars' => ''
23723             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23724             'nodetype' => bless( {
23725             'calls' => [],
23726             'changed' => 0,
23727             'impcount' => 0,
23728             'line' => 402,
23729             'name' => 'nodetype',
23730             'opcount' => 0,
23731             'prods' => [
23732             bless( {
23733             'actcount' => 0,
23734             'dircount' => 0,
23735             'error' => undef,
23736             'items' => [
23737             bless( {
23738             'description' => '/element|attribute|attributes|text|cdata|pi|comment|chunk|entity_reference/',
23739             'hashname' => '__PATTERN1__',
23740             'ldelim' => '/',
23741             'line' => 403,
23742             'lookahead' => 0,
23743             'mod' => '',
23744             'pattern' => 'element|attribute|attributes|text|cdata|pi|comment|chunk|entity_reference',
23745             'rdelim' => '/'
23746             }, 'XML::XSH2::Parser::_Runtime::Token' )
23747             ],
23748             'line' => undef,
23749             'number' => 0,
23750             'patcount' => 1,
23751             'strcount' => 0,
23752             'uncommit' => undef
23753             }, 'XML::XSH2::Parser::_Runtime::Production' )
23754             ],
23755             'vars' => ''
23756             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23757             'option' => bless( {
23758             'calls' => [],
23759             'changed' => 0,
23760             'impcount' => 0,
23761             'line' => 141,
23762             'name' => 'option',
23763             'opcount' => 0,
23764             'prods' => [
23765             bless( {
23766             'actcount' => 0,
23767             'dircount' => 0,
23768             'error' => undef,
23769             'items' => [
23770             bless( {
23771             'description' => '/:[[:alnum:]]|--[-_[:alnum:]]+/',
23772             'hashname' => '__PATTERN1__',
23773             'ldelim' => '/',
23774             'line' => 142,
23775             'lookahead' => 0,
23776             'mod' => '',
23777             'pattern' => ':[[:alnum:]]|--[-_[:alnum:]]+',
23778             'rdelim' => '/'
23779             }, 'XML::XSH2::Parser::_Runtime::Token' )
23780             ],
23781             'line' => undef,
23782             'number' => 0,
23783             'patcount' => 1,
23784             'strcount' => 0,
23785             'uncommit' => undef
23786             }, 'XML::XSH2::Parser::_Runtime::Production' )
23787             ],
23788             'vars' => ''
23789             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23790             'param' => bless( {
23791             'calls' => [
23792             'exp'
23793             ],
23794             'changed' => 0,
23795             'impcount' => 0,
23796             'line' => 397,
23797             'name' => 'param',
23798             'opcount' => 0,
23799             'prods' => [
23800             bless( {
23801             'actcount' => 1,
23802             'dircount' => 0,
23803             'error' => undef,
23804             'items' => [
23805             bless( {
23806             'description' => '/[^=\\\\s]+/',
23807             'hashname' => '__PATTERN1__',
23808             'ldelim' => '/',
23809             'line' => 398,
23810             'lookahead' => 0,
23811             'mod' => '',
23812             'pattern' => '[^=\\s]+',
23813             'rdelim' => '/'
23814             }, 'XML::XSH2::Parser::_Runtime::Token' ),
23815             bless( {
23816             'description' => '\'=\'',
23817             'hashname' => '__STRING1__',
23818             'line' => 398,
23819             'lookahead' => 0,
23820             'pattern' => '='
23821             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
23822             bless( {
23823             'argcode' => undef,
23824             'implicit' => undef,
23825             'line' => 398,
23826             'lookahead' => 0,
23827             'matchrule' => 0,
23828             'subrule' => 'exp'
23829             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
23830             bless( {
23831             'code' => '{ [$item[1],$item[3]] }',
23832             'hashname' => '__ACTION1__',
23833             'line' => 399,
23834             'lookahead' => 0
23835             }, 'XML::XSH2::Parser::_Runtime::Action' )
23836             ],
23837             'line' => undef,
23838             'number' => 0,
23839             'patcount' => 1,
23840             'strcount' => 1,
23841             'uncommit' => undef
23842             }, 'XML::XSH2::Parser::_Runtime::Production' )
23843             ],
23844             'vars' => ''
23845             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23846             'perl_block' => bless( {
23847             'calls' => [],
23848             'changed' => 0,
23849             'impcount' => 0,
23850             'line' => 272,
23851             'name' => 'perl_block',
23852             'opcount' => 0,
23853             'prods' => [
23854             bless( {
23855             'actcount' => 1,
23856             'dircount' => 1,
23857             'error' => undef,
23858             'items' => [
23859             bless( {
23860             'code' => '{ $main::myline = $thisline; }',
23861             'hashname' => '__ACTION1__',
23862             'line' => 274,
23863             'lookahead' => 0
23864             }, 'XML::XSH2::Parser::_Runtime::Action' ),
23865             bless( {
23866             'hashname' => '__DIRECTIVE1__',
23867             'line' => 275,
23868             'lookahead' => 0,
23869             'name' => ''
23870             }, 'XML::XSH2::Parser::_Runtime::UncondReject' )
23871             ],
23872             'line' => undef,
23873             'number' => 0,
23874             'patcount' => 0,
23875             'strcount' => 0,
23876             'uncommit' => undef
23877             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23878             bless( {
23879             'actcount' => 1,
23880             'dircount' => 1,
23881             'error' => undef,
23882             'items' => [
23883             bless( {
23884             'code' => '{ $main::myline = $thisline; }',
23885             'hashname' => '__ACTION1__',
23886             'line' => 277,
23887             'lookahead' => 0
23888             }, 'XML::XSH2::Parser::_Runtime::Action' ),
23889             bless( {
23890             'hashname' => '__DIRECTIVE1__',
23891             'line' => 278,
23892             'lookahead' => 0,
23893             'name' => ''
23894             }, 'XML::XSH2::Parser::_Runtime::UncondReject' )
23895             ],
23896             'line' => 276,
23897             'number' => 1,
23898             'patcount' => 0,
23899             'strcount' => 0,
23900             'uncommit' => undef
23901             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23902             bless( {
23903             'actcount' => 1,
23904             'dircount' => 1,
23905             'error' => undef,
23906             'items' => [
23907             bless( {
23908             'code' => 'Text::Balanced::extract_codeblock($text,undef,$skip,\'{}\');
23909             ',
23910             'hashname' => '__DIRECTIVE1__',
23911             'line' => 279,
23912             'lookahead' => 0,
23913             'name' => ''
23914             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
23915             bless( {
23916             'code' => '{ {
23917             $return=$item[1];
23918             {
23919             local $^W = 0; # don\'t warn about undefined contants
23920             my $pos="# line $main::myline \\"$XML::XSH2::Functions::SCRIPT\\"\\n";
23921             $return=~s/^\\{/\\{\\n$pos/;
23922             }
23923             } }',
23924             'hashname' => '__ACTION1__',
23925             'line' => 280,
23926             'lookahead' => 0
23927             }, 'XML::XSH2::Parser::_Runtime::Action' )
23928             ],
23929             'line' => 279,
23930             'number' => 2,
23931             'patcount' => 0,
23932             'strcount' => 0,
23933             'uncommit' => undef
23934             }, 'XML::XSH2::Parser::_Runtime::Production' )
23935             ],
23936             'vars' => ''
23937             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
23938             'perl_expression' => bless( {
23939             'calls' => [
23940             'exp'
23941             ],
23942             'changed' => 0,
23943             'impcount' => 0,
23944             'line' => 264,
23945             'name' => 'perl_expression',
23946             'opcount' => 0,
23947             'prods' => [
23948             bless( {
23949             'actcount' => 1,
23950             'dircount' => 1,
23951             'error' => undef,
23952             'items' => [
23953             bless( {
23954             'code' => '{ $main::myline = $thisline; }',
23955             'hashname' => '__ACTION1__',
23956             'line' => 266,
23957             'lookahead' => 0
23958             }, 'XML::XSH2::Parser::_Runtime::Action' ),
23959             bless( {
23960             'hashname' => '__DIRECTIVE1__',
23961             'line' => 267,
23962             'lookahead' => 0,
23963             'name' => ''
23964             }, 'XML::XSH2::Parser::_Runtime::UncondReject' )
23965             ],
23966             'line' => undef,
23967             'number' => 0,
23968             'patcount' => 0,
23969             'strcount' => 0,
23970             'uncommit' => undef
23971             }, 'XML::XSH2::Parser::_Runtime::Production' ),
23972             bless( {
23973             'actcount' => 1,
23974             'dircount' => 0,
23975             'error' => undef,
23976             'items' => [
23977             bless( {
23978             'argcode' => undef,
23979             'implicit' => undef,
23980             'line' => 268,
23981             'lookahead' => 0,
23982             'matchrule' => 0,
23983             'subrule' => 'exp'
23984             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
23985             bless( {
23986             'code' => '{ {local $^W=0; "\\n# line $main::myline \\"$XML::XSH2::Functions::SCRIPT\\"\\n".$item[1]} }',
23987             'hashname' => '__ACTION1__',
23988             'line' => 269,
23989             'lookahead' => 0
23990             }, 'XML::XSH2::Parser::_Runtime::Action' )
23991             ],
23992             'line' => 268,
23993             'number' => 1,
23994             'patcount' => 0,
23995             'strcount' => 0,
23996             'uncommit' => undef
23997             }, 'XML::XSH2::Parser::_Runtime::Production' )
23998             ],
23999             'vars' => ''
24000             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
24001             'shell' => bless( {
24002             'calls' => [],
24003             'changed' => 0,
24004             'impcount' => 0,
24005             'line' => 355,
24006             'name' => 'shell',
24007             'opcount' => 0,
24008             'prods' => [
24009             bless( {
24010             'actcount' => 1,
24011             'dircount' => 1,
24012             'error' => undef,
24013             'items' => [
24014             bless( {
24015             'description' => '/!\\\\s*/',
24016             'hashname' => '__PATTERN1__',
24017             'ldelim' => '/',
24018             'line' => 356,
24019             'lookahead' => 0,
24020             'mod' => '',
24021             'pattern' => '!\\s*',
24022             'rdelim' => '/'
24023             }, 'XML::XSH2::Parser::_Runtime::Token' ),
24024             bless( {
24025             'code' => '$commit = 1',
24026             'hashname' => '__DIRECTIVE1__',
24027             'line' => 356,
24028             'lookahead' => 0,
24029             'name' => ''
24030             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
24031             bless( {
24032             'description' => '/.*/',
24033             'hashname' => '__PATTERN2__',
24034             'ldelim' => '/',
24035             'line' => 356,
24036             'lookahead' => 0,
24037             'mod' => '',
24038             'pattern' => '.*',
24039             'rdelim' => '/'
24040             }, 'XML::XSH2::Parser::_Runtime::Token' ),
24041             bless( {
24042             'code' => '{ [[$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'sh_noev\',$item[3]]] }',
24043             'hashname' => '__ACTION1__',
24044             'line' => 357,
24045             'lookahead' => 0
24046             }, 'XML::XSH2::Parser::_Runtime::Action' )
24047             ],
24048             'line' => undef,
24049             'number' => 0,
24050             'patcount' => 2,
24051             'strcount' => 0,
24052             'uncommit' => undef
24053             }, 'XML::XSH2::Parser::_Runtime::Production' ),
24054             bless( {
24055             'actcount' => 0,
24056             'dircount' => 2,
24057             'error' => 1,
24058             'items' => [
24059             bless( {
24060             'commitonly' => '?',
24061             'hashname' => '__DIRECTIVE1__',
24062             'line' => 359,
24063             'lookahead' => 0,
24064             'msg' => 'Parse error near: "! }.substr($text,0,40).qq{ ..."'
24065             }, 'XML::XSH2::Parser::_Runtime::Error' ),
24066             bless( {
24067             'hashname' => '__DIRECTIVE2__',
24068             'line' => 359,
24069             'lookahead' => 0,
24070             'name' => ''
24071             }, 'XML::XSH2::Parser::_Runtime::UncondReject' )
24072             ],
24073             'line' => 359,
24074             'number' => 1,
24075             'patcount' => 0,
24076             'strcount' => 0,
24077             'uncommit' => 0
24078             }, 'XML::XSH2::Parser::_Runtime::Production' )
24079             ],
24080             'vars' => ''
24081             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
24082             'shline' => bless( {
24083             'calls' => [
24084             'shline_nosc',
24085             'shline_bracket'
24086             ],
24087             'changed' => 0,
24088             'impcount' => 0,
24089             'line' => 350,
24090             'name' => 'shline',
24091             'opcount' => 0,
24092             'prods' => [
24093             bless( {
24094             'actcount' => 1,
24095             'dircount' => 0,
24096             'error' => undef,
24097             'items' => [
24098             bless( {
24099             'argcode' => undef,
24100             'implicit' => undef,
24101             'line' => 351,
24102             'lookahead' => 0,
24103             'matchrule' => 0,
24104             'subrule' => 'shline_nosc'
24105             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24106             bless( {
24107             'argcode' => undef,
24108             'expected' => undef,
24109             'line' => 351,
24110             'lookahead' => 0,
24111             'matchrule' => 0,
24112             'max' => 1,
24113             'min' => 0,
24114             'repspec' => '?',
24115             'subrule' => 'shline_bracket'
24116             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
24117             bless( {
24118             'argcode' => undef,
24119             'implicit' => undef,
24120             'line' => 351,
24121             'lookahead' => 0,
24122             'matchrule' => 0,
24123             'subrule' => 'shline_nosc'
24124             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24125             bless( {
24126             'code' => '{ join("",$item[1],@{$item[2]},$item[3]) }',
24127             'hashname' => '__ACTION1__',
24128             'line' => 352,
24129             'lookahead' => 0
24130             }, 'XML::XSH2::Parser::_Runtime::Action' )
24131             ],
24132             'line' => undef,
24133             'number' => 0,
24134             'patcount' => 0,
24135             'strcount' => 0,
24136             'uncommit' => undef
24137             }, 'XML::XSH2::Parser::_Runtime::Production' )
24138             ],
24139             'vars' => ''
24140             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
24141             'shline_bracket' => bless( {
24142             'calls' => [
24143             'shline_inter',
24144             'shline_bracket'
24145             ],
24146             'changed' => 0,
24147             'impcount' => 0,
24148             'line' => 345,
24149             'name' => 'shline_bracket',
24150             'opcount' => 0,
24151             'prods' => [
24152             bless( {
24153             'actcount' => 1,
24154             'dircount' => 0,
24155             'error' => undef,
24156             'items' => [
24157             bless( {
24158             'description' => '\'(\'',
24159             'hashname' => '__STRING1__',
24160             'line' => 346,
24161             'lookahead' => 0,
24162             'pattern' => '('
24163             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
24164             bless( {
24165             'argcode' => undef,
24166             'implicit' => undef,
24167             'line' => 346,
24168             'lookahead' => 0,
24169             'matchrule' => 0,
24170             'subrule' => 'shline_inter'
24171             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24172             bless( {
24173             'argcode' => undef,
24174             'expected' => undef,
24175             'line' => 346,
24176             'lookahead' => 0,
24177             'matchrule' => 0,
24178             'max' => 1,
24179             'min' => 0,
24180             'repspec' => '?',
24181             'subrule' => 'shline_bracket'
24182             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
24183             bless( {
24184             'argcode' => undef,
24185             'implicit' => undef,
24186             'line' => 346,
24187             'lookahead' => 0,
24188             'matchrule' => 0,
24189             'subrule' => 'shline_inter'
24190             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24191             bless( {
24192             'description' => '\')\'',
24193             'hashname' => '__STRING2__',
24194             'line' => 346,
24195             'lookahead' => 0,
24196             'pattern' => ')'
24197             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
24198             bless( {
24199             'code' => '{ join("",\'(\',$item[2],@{$item[3]},$item[4],\')\') }',
24200             'hashname' => '__ACTION1__',
24201             'line' => 347,
24202             'lookahead' => 0
24203             }, 'XML::XSH2::Parser::_Runtime::Action' )
24204             ],
24205             'line' => undef,
24206             'number' => 0,
24207             'patcount' => 0,
24208             'strcount' => 2,
24209             'uncommit' => undef
24210             }, 'XML::XSH2::Parser::_Runtime::Production' )
24211             ],
24212             'vars' => ''
24213             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
24214             'shline_inter' => bless( {
24215             'calls' => [],
24216             'changed' => 0,
24217             'impcount' => 0,
24218             'line' => 342,
24219             'name' => 'shline_inter',
24220             'opcount' => 0,
24221             'prods' => [
24222             bless( {
24223             'actcount' => 0,
24224             'dircount' => 0,
24225             'error' => undef,
24226             'items' => [
24227             bless( {
24228             'description' => '/([^()\\\\\\\\"\']|\\\\\\\\.|\\\\"([^\\\\"\\\\\\\\]|\\\\\\\\.)*\\\\"|\\\\\'([^\\\\\'\\\\\\\\]|\\\\\\\\\\\\\'|\\\\\\\\\\\\\\\\|\\\\\\\\[^\\\\\'\\\\\\\\])*\\\\\')*/',
24229             'hashname' => '__PATTERN1__',
24230             'ldelim' => '/',
24231             'line' => 343,
24232             'lookahead' => 0,
24233             'mod' => '',
24234             'pattern' => '([^()\\\\"\']|\\\\.|\\"([^\\"\\\\]|\\\\.)*\\"|\\\'([^\\\'\\\\]|\\\\\\\'|\\\\\\\\|\\\\[^\\\'\\\\])*\\\')*',
24235             'rdelim' => '/'
24236             }, 'XML::XSH2::Parser::_Runtime::Token' )
24237             ],
24238             'line' => undef,
24239             'number' => 0,
24240             'patcount' => 1,
24241             'strcount' => 0,
24242             'uncommit' => undef
24243             }, 'XML::XSH2::Parser::_Runtime::Production' )
24244             ],
24245             'vars' => ''
24246             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
24247             'shline_nosc' => bless( {
24248             'calls' => [],
24249             'changed' => 0,
24250             'impcount' => 0,
24251             'line' => 339,
24252             'name' => 'shline_nosc',
24253             'opcount' => 0,
24254             'prods' => [
24255             bless( {
24256             'actcount' => 0,
24257             'dircount' => 0,
24258             'error' => undef,
24259             'items' => [
24260             bless( {
24261             'description' => '/([^;()\\\\\\\\"\'\\\\|]|\\\\|[^>]|\\\\\\\\.|\\\\"([^\\\\"\\\\\\\\]|\\\\\\\\.)*\\\\"|\\\\\'([^\\\\\'\\\\\\\\]|\\\\\\\\\\\\\'|\\\\\\\\\\\\\\\\|\\\\\\\\[^\\\\\'\\\\\\\\])*\\\\\')*/',
24262             'hashname' => '__PATTERN1__',
24263             'ldelim' => '/',
24264             'line' => 340,
24265             'lookahead' => 0,
24266             'mod' => '',
24267             'pattern' => '([^;()\\\\"\'\\|]|\\|[^>]|\\\\.|\\"([^\\"\\\\]|\\\\.)*\\"|\\\'([^\\\'\\\\]|\\\\\\\'|\\\\\\\\|\\\\[^\\\'\\\\])*\\\')*',
24268             'rdelim' => '/'
24269             }, 'XML::XSH2::Parser::_Runtime::Token' )
24270             ],
24271             'line' => undef,
24272             'number' => 0,
24273             'patcount' => 1,
24274             'strcount' => 0,
24275             'uncommit' => undef
24276             }, 'XML::XSH2::Parser::_Runtime::Production' )
24277             ],
24278             'vars' => ''
24279             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
24280             'startrule' => bless( {
24281             'calls' => [
24282             'shell',
24283             'eof',
24284             'complex_command'
24285             ],
24286             'changed' => 0,
24287             'impcount' => 0,
24288             'line' => 322,
24289             'name' => 'startrule',
24290             'opcount' => 0,
24291             'prods' => [
24292             bless( {
24293             'actcount' => 1,
24294             'dircount' => 1,
24295             'error' => undef,
24296             'items' => [
24297             bless( {
24298             'argcode' => undef,
24299             'implicit' => undef,
24300             'line' => 323,
24301             'lookahead' => 0,
24302             'matchrule' => 0,
24303             'subrule' => 'shell'
24304             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24305             bless( {
24306             'code' => '$commit = 1',
24307             'hashname' => '__DIRECTIVE1__',
24308             'line' => 323,
24309             'lookahead' => 0,
24310             'name' => ''
24311             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
24312             bless( {
24313             'argcode' => undef,
24314             'implicit' => undef,
24315             'line' => 323,
24316             'lookahead' => 0,
24317             'matchrule' => 0,
24318             'subrule' => 'eof'
24319             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24320             bless( {
24321             'code' => '{ $item[1] }',
24322             'hashname' => '__ACTION1__',
24323             'line' => 324,
24324             'lookahead' => 0
24325             }, 'XML::XSH2::Parser::_Runtime::Action' )
24326             ],
24327             'line' => undef,
24328             'number' => 0,
24329             'patcount' => 0,
24330             'strcount' => 0,
24331             'uncommit' => undef
24332             }, 'XML::XSH2::Parser::_Runtime::Production' ),
24333             bless( {
24334             'actcount' => 1,
24335             'dircount' => 1,
24336             'error' => undef,
24337             'items' => [
24338             bless( {
24339             'argcode' => undef,
24340             'expected' => undef,
24341             'line' => 326,
24342             'lookahead' => 0,
24343             'matchrule' => 0,
24344             'max' => 100000000,
24345             'min' => 1,
24346             'repspec' => 's',
24347             'subrule' => 'complex_command'
24348             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
24349             bless( {
24350             'code' => '$commit = 1',
24351             'hashname' => '__DIRECTIVE1__',
24352             'line' => 326,
24353             'lookahead' => 0,
24354             'name' => ''
24355             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
24356             bless( {
24357             'argcode' => undef,
24358             'implicit' => undef,
24359             'line' => 326,
24360             'lookahead' => 0,
24361             'matchrule' => 0,
24362             'subrule' => 'eof'
24363             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24364             bless( {
24365             'code' => '{ $item[1] }',
24366             'hashname' => '__ACTION1__',
24367             'line' => 327,
24368             'lookahead' => 0
24369             }, 'XML::XSH2::Parser::_Runtime::Action' )
24370             ],
24371             'line' => 326,
24372             'number' => 1,
24373             'patcount' => 0,
24374             'strcount' => 0,
24375             'uncommit' => undef
24376             }, 'XML::XSH2::Parser::_Runtime::Production' )
24377             ],
24378             'vars' => ''
24379             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
24380             'statement' => bless( {
24381             'calls' => [
24382             'exp',
24383             'block',
24384             'elsif_block',
24385             'else_block',
24386             'local_var_in',
24387             'local_var',
24388             'xpstep',
24389             'ID',
24390             'variable'
24391             ],
24392             'changed' => 0,
24393             'impcount' => 0,
24394             'line' => 72,
24395             'name' => 'statement',
24396             'opcount' => 0,
24397             'prods' => [
24398             bless( {
24399             'actcount' => 0,
24400             'dircount' => 2,
24401             'error' => undef,
24402             'items' => [
24403             bless( {
24404             'description' => '/(?=\\\\s*[\\}\\{;])/',
24405             'hashname' => '__PATTERN1__',
24406             'ldelim' => '/',
24407             'line' => 73,
24408             'lookahead' => 0,
24409             'mod' => '',
24410             'pattern' => '(?=\\s*[}{;])',
24411             'rdelim' => '/'
24412             }, 'XML::XSH2::Parser::_Runtime::Token' ),
24413             bless( {
24414             'code' => '$commit = 1',
24415             'hashname' => '__DIRECTIVE1__',
24416             'line' => 73,
24417             'lookahead' => 0,
24418             'name' => ''
24419             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
24420             bless( {
24421             'hashname' => '__DIRECTIVE2__',
24422             'line' => 73,
24423             'lookahead' => 0,
24424             'name' => ''
24425             }, 'XML::XSH2::Parser::_Runtime::UncondReject' )
24426             ],
24427             'line' => undef,
24428             'number' => 0,
24429             'patcount' => 1,
24430             'strcount' => 0,
24431             'uncommit' => undef
24432             }, 'XML::XSH2::Parser::_Runtime::Production' ),
24433             bless( {
24434             'actcount' => 1,
24435             'dircount' => 1,
24436             'error' => undef,
24437             'items' => [
24438             bless( {
24439             'description' => '/(if)\\\\b/',
24440             'hashname' => '__PATTERN1__',
24441             'ldelim' => '/',
24442             'line' => 74,
24443             'lookahead' => 0,
24444             'mod' => '',
24445             'pattern' => '(if)\\b',
24446             'rdelim' => '/'
24447             }, 'XML::XSH2::Parser::_Runtime::Token' ),
24448             bless( {
24449             'code' => '$commit = 1',
24450             'hashname' => '__DIRECTIVE1__',
24451             'line' => 74,
24452             'lookahead' => 0,
24453             'name' => ''
24454             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
24455             bless( {
24456             'argcode' => undef,
24457             'implicit' => undef,
24458             'line' => 74,
24459             'lookahead' => 0,
24460             'matchrule' => 0,
24461             'subrule' => 'exp'
24462             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24463             bless( {
24464             'argcode' => undef,
24465             'implicit' => undef,
24466             'line' => 74,
24467             'lookahead' => 0,
24468             'matchrule' => 0,
24469             'subrule' => 'block'
24470             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24471             bless( {
24472             'argcode' => undef,
24473             'implicit' => undef,
24474             'line' => 74,
24475             'lookahead' => 0,
24476             'matchrule' => 0,
24477             'subrule' => 'elsif_block'
24478             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24479             bless( {
24480             'argcode' => undef,
24481             'implicit' => undef,
24482             'line' => 74,
24483             'lookahead' => 0,
24484             'matchrule' => 0,
24485             'subrule' => 'else_block'
24486             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24487             bless( {
24488             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'if_statement\',[$item[3],$item[4]],@{$item[5]},@{$item[6]}] }',
24489             'hashname' => '__ACTION1__',
24490             'line' => 75,
24491             'lookahead' => 0
24492             }, 'XML::XSH2::Parser::_Runtime::Action' )
24493             ],
24494             'line' => 74,
24495             'number' => 1,
24496             'patcount' => 1,
24497             'strcount' => 0,
24498             'uncommit' => undef
24499             }, 'XML::XSH2::Parser::_Runtime::Production' ),
24500             bless( {
24501             'actcount' => 1,
24502             'dircount' => 1,
24503             'error' => undef,
24504             'items' => [
24505             bless( {
24506             'description' => '/(unless)\\\\b/',
24507             'hashname' => '__PATTERN1__',
24508             'ldelim' => '/',
24509             'line' => 77,
24510             'lookahead' => 0,
24511             'mod' => '',
24512             'pattern' => '(unless)\\b',
24513             'rdelim' => '/'
24514             }, 'XML::XSH2::Parser::_Runtime::Token' ),
24515             bless( {
24516             'code' => '$commit = 1',
24517             'hashname' => '__DIRECTIVE1__',
24518             'line' => 77,
24519             'lookahead' => 0,
24520             'name' => ''
24521             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
24522             bless( {
24523             'argcode' => undef,
24524             'implicit' => undef,
24525             'line' => 77,
24526             'lookahead' => 0,
24527             'matchrule' => 0,
24528             'subrule' => 'exp'
24529             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24530             bless( {
24531             'argcode' => undef,
24532             'implicit' => undef,
24533             'line' => 77,
24534             'lookahead' => 0,
24535             'matchrule' => 0,
24536             'subrule' => 'block'
24537             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24538             bless( {
24539             'argcode' => undef,
24540             'expected' => undef,
24541             'line' => 77,
24542             'lookahead' => 0,
24543             'matchrule' => 0,
24544             'max' => 1,
24545             'min' => 0,
24546             'repspec' => '?',
24547             'subrule' => 'else_block'
24548             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
24549             bless( {
24550             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'unless_statement\',$item[3],$item[4],@{$item[5]}] }',
24551             'hashname' => '__ACTION1__',
24552             'line' => 78,
24553             'lookahead' => 0
24554             }, 'XML::XSH2::Parser::_Runtime::Action' )
24555             ],
24556             'line' => 77,
24557             'number' => 2,
24558             'patcount' => 1,
24559             'strcount' => 0,
24560             'uncommit' => undef
24561             }, 'XML::XSH2::Parser::_Runtime::Production' ),
24562             bless( {
24563             'actcount' => 1,
24564             'dircount' => 1,
24565             'error' => undef,
24566             'items' => [
24567             bless( {
24568             'description' => '/(while)\\\\b/',
24569             'hashname' => '__PATTERN1__',
24570             'ldelim' => '/',
24571             'line' => 80,
24572             'lookahead' => 0,
24573             'mod' => '',
24574             'pattern' => '(while)\\b',
24575             'rdelim' => '/'
24576             }, 'XML::XSH2::Parser::_Runtime::Token' ),
24577             bless( {
24578             'code' => '$commit = 1',
24579             'hashname' => '__DIRECTIVE1__',
24580             'line' => 80,
24581             'lookahead' => 0,
24582             'name' => ''
24583             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
24584             bless( {
24585             'argcode' => undef,
24586             'implicit' => undef,
24587             'line' => 80,
24588             'lookahead' => 0,
24589             'matchrule' => 0,
24590             'subrule' => 'exp'
24591             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24592             bless( {
24593             'argcode' => undef,
24594             'implicit' => undef,
24595             'line' => 80,
24596             'lookahead' => 0,
24597             'matchrule' => 0,
24598             'subrule' => 'block'
24599             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24600             bless( {
24601             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'while_statement\',$item[3],$item[4]] }',
24602             'hashname' => '__ACTION1__',
24603             'line' => 81,
24604             'lookahead' => 0
24605             }, 'XML::XSH2::Parser::_Runtime::Action' )
24606             ],
24607             'line' => 80,
24608             'number' => 3,
24609             'patcount' => 1,
24610             'strcount' => 0,
24611             'uncommit' => undef
24612             }, 'XML::XSH2::Parser::_Runtime::Production' ),
24613             bless( {
24614             'actcount' => 1,
24615             'dircount' => 1,
24616             'error' => undef,
24617             'items' => [
24618             bless( {
24619             'description' => '/(foreach|for)\\\\b/',
24620             'hashname' => '__PATTERN1__',
24621             'ldelim' => '/',
24622             'line' => 83,
24623             'lookahead' => 0,
24624             'mod' => '',
24625             'pattern' => '(foreach|for)\\b',
24626             'rdelim' => '/'
24627             }, 'XML::XSH2::Parser::_Runtime::Token' ),
24628             bless( {
24629             'code' => '$commit = 1',
24630             'hashname' => '__DIRECTIVE1__',
24631             'line' => 83,
24632             'lookahead' => 0,
24633             'name' => ''
24634             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
24635             bless( {
24636             'argcode' => undef,
24637             'expected' => undef,
24638             'line' => 83,
24639             'lookahead' => 0,
24640             'matchrule' => 0,
24641             'max' => 1,
24642             'min' => 0,
24643             'repspec' => '?',
24644             'subrule' => 'local_var_in'
24645             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
24646             bless( {
24647             'argcode' => undef,
24648             'implicit' => undef,
24649             'line' => 83,
24650             'lookahead' => 0,
24651             'matchrule' => 0,
24652             'subrule' => 'exp'
24653             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24654             bless( {
24655             'argcode' => undef,
24656             'implicit' => undef,
24657             'line' => 83,
24658             'lookahead' => 0,
24659             'matchrule' => 0,
24660             'subrule' => 'block'
24661             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24662             bless( {
24663             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'foreach_statement\',@item[4,5],@{$item[3]}] }',
24664             'hashname' => '__ACTION1__',
24665             'line' => 84,
24666             'lookahead' => 0
24667             }, 'XML::XSH2::Parser::_Runtime::Action' )
24668             ],
24669             'line' => 83,
24670             'number' => 4,
24671             'patcount' => 1,
24672             'strcount' => 0,
24673             'uncommit' => undef
24674             }, 'XML::XSH2::Parser::_Runtime::Production' ),
24675             bless( {
24676             'actcount' => 1,
24677             'dircount' => 1,
24678             'error' => undef,
24679             'items' => [
24680             bless( {
24681             'description' => '/(try)\\\\b/',
24682             'hashname' => '__PATTERN1__',
24683             'ldelim' => '/',
24684             'line' => 86,
24685             'lookahead' => 0,
24686             'mod' => '',
24687             'pattern' => '(try)\\b',
24688             'rdelim' => '/'
24689             }, 'XML::XSH2::Parser::_Runtime::Token' ),
24690             bless( {
24691             'code' => '$commit = 1',
24692             'hashname' => '__DIRECTIVE1__',
24693             'line' => 86,
24694             'lookahead' => 0,
24695             'name' => ''
24696             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
24697             bless( {
24698             'argcode' => undef,
24699             'implicit' => undef,
24700             'line' => 86,
24701             'lookahead' => 0,
24702             'matchrule' => 0,
24703             'subrule' => 'block'
24704             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24705             bless( {
24706             'description' => '\'catch\'',
24707             'hashname' => '__STRING1__',
24708             'line' => 86,
24709             'lookahead' => 0,
24710             'pattern' => 'catch'
24711             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
24712             bless( {
24713             'argcode' => undef,
24714             'expected' => undef,
24715             'line' => 86,
24716             'lookahead' => 0,
24717             'matchrule' => 0,
24718             'max' => 1,
24719             'min' => 0,
24720             'repspec' => '?',
24721             'subrule' => 'local_var'
24722             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
24723             bless( {
24724             'argcode' => undef,
24725             'implicit' => undef,
24726             'line' => 86,
24727             'lookahead' => 0,
24728             'matchrule' => 0,
24729             'subrule' => 'block'
24730             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24731             bless( {
24732             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'try_catch\',$item[3],$item[6],@{$item[5]}] }',
24733             'hashname' => '__ACTION1__',
24734             'line' => 87,
24735             'lookahead' => 0
24736             }, 'XML::XSH2::Parser::_Runtime::Action' )
24737             ],
24738             'line' => 86,
24739             'number' => 5,
24740             'patcount' => 1,
24741             'strcount' => 1,
24742             'uncommit' => undef
24743             }, 'XML::XSH2::Parser::_Runtime::Production' ),
24744             bless( {
24745             'actcount' => 1,
24746             'dircount' => 1,
24747             'error' => undef,
24748             'items' => [
24749             bless( {
24750             'description' => '/(iterate)\\\\b/',
24751             'hashname' => '__PATTERN1__',
24752             'ldelim' => '/',
24753             'line' => 89,
24754             'lookahead' => 0,
24755             'mod' => '',
24756             'pattern' => '(iterate)\\b',
24757             'rdelim' => '/'
24758             }, 'XML::XSH2::Parser::_Runtime::Token' ),
24759             bless( {
24760             'code' => '$commit = 1',
24761             'hashname' => '__DIRECTIVE1__',
24762             'line' => 89,
24763             'lookahead' => 0,
24764             'name' => ''
24765             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
24766             bless( {
24767             'argcode' => undef,
24768             'implicit' => undef,
24769             'line' => 89,
24770             'lookahead' => 0,
24771             'matchrule' => 0,
24772             'subrule' => 'xpstep'
24773             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24774             bless( {
24775             'argcode' => undef,
24776             'implicit' => undef,
24777             'line' => 89,
24778             'lookahead' => 0,
24779             'matchrule' => 0,
24780             'subrule' => 'block'
24781             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24782             bless( {
24783             'code' => '{ [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'iterate\',$item[4],@{$item[3]}] }',
24784             'hashname' => '__ACTION1__',
24785             'line' => 90,
24786             'lookahead' => 0
24787             }, 'XML::XSH2::Parser::_Runtime::Action' )
24788             ],
24789             'line' => 89,
24790             'number' => 6,
24791             'patcount' => 1,
24792             'strcount' => 0,
24793             'uncommit' => undef
24794             }, 'XML::XSH2::Parser::_Runtime::Production' ),
24795             bless( {
24796             'actcount' => 2,
24797             'dircount' => 1,
24798             'error' => undef,
24799             'items' => [
24800             bless( {
24801             'description' => '/(def|define)\\\\b/',
24802             'hashname' => '__PATTERN1__',
24803             'ldelim' => '/',
24804             'line' => 92,
24805             'lookahead' => 0,
24806             'mod' => '',
24807             'pattern' => '(def|define)\\b',
24808             'rdelim' => '/'
24809             }, 'XML::XSH2::Parser::_Runtime::Token' ),
24810             bless( {
24811             'code' => '$commit = 1',
24812             'hashname' => '__DIRECTIVE1__',
24813             'line' => 92,
24814             'lookahead' => 0,
24815             'name' => ''
24816             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
24817             bless( {
24818             'argcode' => undef,
24819             'implicit' => undef,
24820             'line' => 92,
24821             'lookahead' => 0,
24822             'matchrule' => 0,
24823             'subrule' => 'ID'
24824             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24825             bless( {
24826             'code' => '{ XML::XSH2::Functions::is_command($item[3])?undef:1 }',
24827             'hashname' => '__ACTION1__',
24828             'line' => 93,
24829             'lookahead' => 0
24830             }, 'XML::XSH2::Parser::_Runtime::Action' ),
24831             bless( {
24832             'argcode' => undef,
24833             'expected' => undef,
24834             'line' => 94,
24835             'lookahead' => 0,
24836             'matchrule' => 0,
24837             'max' => 100000000,
24838             'min' => 0,
24839             'repspec' => 's?',
24840             'subrule' => 'variable'
24841             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
24842             bless( {
24843             'argcode' => undef,
24844             'implicit' => undef,
24845             'line' => 94,
24846             'lookahead' => 0,
24847             'matchrule' => 0,
24848             'subrule' => 'block'
24849             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24850             bless( {
24851             'code' => '{
24852             [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'def\',$item[3],$item[6],$item[5]]
24853             }',
24854             'hashname' => '__ACTION2__',
24855             'line' => 95,
24856             'lookahead' => 0
24857             }, 'XML::XSH2::Parser::_Runtime::Action' )
24858             ],
24859             'line' => 92,
24860             'number' => 7,
24861             'patcount' => 1,
24862             'strcount' => 0,
24863             'uncommit' => undef
24864             }, 'XML::XSH2::Parser::_Runtime::Production' )
24865             ],
24866             'vars' => ''
24867             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
24868             'stream_select' => bless( {
24869             'calls' => [
24870             'xpath',
24871             'block'
24872             ],
24873             'changed' => 0,
24874             'impcount' => 0,
24875             'line' => 441,
24876             'name' => 'stream_select',
24877             'opcount' => 0,
24878             'prods' => [
24879             bless( {
24880             'actcount' => 1,
24881             'dircount' => 0,
24882             'error' => undef,
24883             'items' => [
24884             bless( {
24885             'description' => '/select\\\\s/',
24886             'hashname' => '__PATTERN1__',
24887             'ldelim' => '/',
24888             'line' => 442,
24889             'lookahead' => 0,
24890             'mod' => '',
24891             'pattern' => 'select\\s',
24892             'rdelim' => '/'
24893             }, 'XML::XSH2::Parser::_Runtime::Token' ),
24894             bless( {
24895             'argcode' => undef,
24896             'implicit' => undef,
24897             'line' => 442,
24898             'lookahead' => 0,
24899             'matchrule' => 0,
24900             'subrule' => 'xpath'
24901             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24902             bless( {
24903             'argcode' => undef,
24904             'implicit' => undef,
24905             'line' => 442,
24906             'lookahead' => 0,
24907             'matchrule' => 0,
24908             'subrule' => 'block'
24909             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24910             bless( {
24911             'code' => '{ [$item[2],$item[3]] }',
24912             'hashname' => '__ACTION1__',
24913             'line' => 443,
24914             'lookahead' => 0
24915             }, 'XML::XSH2::Parser::_Runtime::Action' )
24916             ],
24917             'line' => undef,
24918             'number' => 0,
24919             'patcount' => 1,
24920             'strcount' => 0,
24921             'uncommit' => undef
24922             }, 'XML::XSH2::Parser::_Runtime::Production' )
24923             ],
24924             'vars' => ''
24925             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
24926             'trail' => bless( {
24927             'calls' => [
24928             'variable',
24929             'shline'
24930             ],
24931             'changed' => 0,
24932             'impcount' => 0,
24933             'line' => 330,
24934             'name' => 'trail',
24935             'opcount' => 0,
24936             'prods' => [
24937             bless( {
24938             'actcount' => 0,
24939             'dircount' => 2,
24940             'error' => undef,
24941             'items' => [
24942             bless( {
24943             'description' => '/(?=\\\\s*[\\};]|\\\\s*\\\\Z)/',
24944             'hashname' => '__PATTERN1__',
24945             'ldelim' => '/',
24946             'line' => 331,
24947             'lookahead' => 0,
24948             'mod' => '',
24949             'pattern' => '(?=\\s*[};]|\\s*\\Z)',
24950             'rdelim' => '/'
24951             }, 'XML::XSH2::Parser::_Runtime::Token' ),
24952             bless( {
24953             'code' => '$commit = 1',
24954             'hashname' => '__DIRECTIVE1__',
24955             'line' => 331,
24956             'lookahead' => 0,
24957             'name' => ''
24958             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
24959             bless( {
24960             'hashname' => '__DIRECTIVE2__',
24961             'line' => 331,
24962             'lookahead' => 0,
24963             'name' => ''
24964             }, 'XML::XSH2::Parser::_Runtime::UncondReject' )
24965             ],
24966             'line' => undef,
24967             'number' => 0,
24968             'patcount' => 1,
24969             'strcount' => 0,
24970             'uncommit' => undef
24971             }, 'XML::XSH2::Parser::_Runtime::Production' ),
24972             bless( {
24973             'actcount' => 1,
24974             'dircount' => 1,
24975             'error' => undef,
24976             'items' => [
24977             bless( {
24978             'description' => '\'|>\'',
24979             'hashname' => '__STRING1__',
24980             'line' => 332,
24981             'lookahead' => 0,
24982             'pattern' => '|>'
24983             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
24984             bless( {
24985             'code' => '$commit = 1',
24986             'hashname' => '__DIRECTIVE1__',
24987             'line' => 332,
24988             'lookahead' => 0,
24989             'name' => ''
24990             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
24991             bless( {
24992             'argcode' => undef,
24993             'implicit' => undef,
24994             'line' => 332,
24995             'lookahead' => 0,
24996             'matchrule' => 0,
24997             'subrule' => 'variable'
24998             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
24999             bless( {
25000             'code' => '{ [\'var\',$item[3]] }',
25001             'hashname' => '__ACTION1__',
25002             'line' => 333,
25003             'lookahead' => 0
25004             }, 'XML::XSH2::Parser::_Runtime::Action' )
25005             ],
25006             'line' => 332,
25007             'number' => 1,
25008             'patcount' => 0,
25009             'strcount' => 1,
25010             'uncommit' => undef
25011             }, 'XML::XSH2::Parser::_Runtime::Production' ),
25012             bless( {
25013             'actcount' => 1,
25014             'dircount' => 1,
25015             'error' => undef,
25016             'items' => [
25017             bless( {
25018             'description' => '\'|\'',
25019             'hashname' => '__STRING1__',
25020             'line' => 335,
25021             'lookahead' => 0,
25022             'pattern' => '|'
25023             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
25024             bless( {
25025             'code' => '$commit = 1',
25026             'hashname' => '__DIRECTIVE1__',
25027             'line' => 335,
25028             'lookahead' => 0,
25029             'name' => ''
25030             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
25031             bless( {
25032             'argcode' => undef,
25033             'implicit' => undef,
25034             'line' => 335,
25035             'lookahead' => 0,
25036             'matchrule' => 0,
25037             'subrule' => 'shline'
25038             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
25039             bless( {
25040             'code' => '{ [\'pipe\',$item[3]] }',
25041             'hashname' => '__ACTION1__',
25042             'line' => 336,
25043             'lookahead' => 0
25044             }, 'XML::XSH2::Parser::_Runtime::Action' )
25045             ],
25046             'line' => 335,
25047             'number' => 2,
25048             'patcount' => 0,
25049             'strcount' => 1,
25050             'uncommit' => undef
25051             }, 'XML::XSH2::Parser::_Runtime::Production' )
25052             ],
25053             'vars' => ''
25054             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25055             'undef' => bless( {
25056             'calls' => [],
25057             'changed' => 0,
25058             'impcount' => 0,
25059             'line' => 390,
25060             'name' => 'undef',
25061             'opcount' => 0,
25062             'prods' => [
25063             bless( {
25064             'actcount' => 1,
25065             'dircount' => 1,
25066             'error' => undef,
25067             'items' => [
25068             bless( {
25069             'description' => '/(undef|undefine)\\\\b/',
25070             'hashname' => '__PATTERN1__',
25071             'ldelim' => '/',
25072             'line' => 391,
25073             'lookahead' => 0,
25074             'mod' => '',
25075             'pattern' => '(undef|undefine)\\b',
25076             'rdelim' => '/'
25077             }, 'XML::XSH2::Parser::_Runtime::Token' ),
25078             bless( {
25079             'code' => '$commit = 1',
25080             'hashname' => '__DIRECTIVE1__',
25081             'line' => 391,
25082             'lookahead' => 0,
25083             'name' => ''
25084             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
25085             bless( {
25086             'description' => '/\\\\$?[a-zA-Z_][a-zA-Z0-9_]*/',
25087             'hashname' => '__PATTERN2__',
25088             'ldelim' => '/',
25089             'line' => 391,
25090             'lookahead' => 0,
25091             'mod' => '',
25092             'pattern' => '\\$?[a-zA-Z_][a-zA-Z0-9_]*',
25093             'rdelim' => '/'
25094             }, 'XML::XSH2::Parser::_Runtime::Token' ),
25095             bless( {
25096             'code' => '{
25097             [$thisline,$thiscolumn,$thisoffset,$XML::XSH2::Functions::SCRIPT,\'undefine\',$item[3]];
25098             }',
25099             'hashname' => '__ACTION1__',
25100             'line' => 392,
25101             'lookahead' => 0
25102             }, 'XML::XSH2::Parser::_Runtime::Action' )
25103             ],
25104             'line' => undef,
25105             'number' => 0,
25106             'patcount' => 2,
25107             'strcount' => 0,
25108             'uncommit' => undef
25109             }, 'XML::XSH2::Parser::_Runtime::Production' )
25110             ],
25111             'vars' => ''
25112             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25113             'variable' => bless( {
25114             'calls' => [],
25115             'changed' => 0,
25116             'impcount' => 0,
25117             'line' => 314,
25118             'name' => 'variable',
25119             'opcount' => 0,
25120             'prods' => [
25121             bless( {
25122             'actcount' => 0,
25123             'dircount' => 0,
25124             'error' => undef,
25125             'items' => [
25126             bless( {
25127             'description' => '/\\\\$[a-zA-Z_][a-zA-Z0-9_]*/',
25128             'hashname' => '__PATTERN1__',
25129             'ldelim' => '/',
25130             'line' => 315,
25131             'lookahead' => 0,
25132             'mod' => '',
25133             'pattern' => '\\$[a-zA-Z_][a-zA-Z0-9_]*',
25134             'rdelim' => '/'
25135             }, 'XML::XSH2::Parser::_Runtime::Token' )
25136             ],
25137             'line' => undef,
25138             'number' => 0,
25139             'patcount' => 1,
25140             'strcount' => 0,
25141             'uncommit' => undef
25142             }, 'XML::XSH2::Parser::_Runtime::Production' )
25143             ],
25144             'vars' => ''
25145             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25146             'xpath' => bless( {
25147             'calls' => [
25148             'xpstring',
25149             'xpsimple',
25150             'xpcont'
25151             ],
25152             'changed' => 0,
25153             'impcount' => 0,
25154             'line' => 179,
25155             'name' => 'xpath',
25156             'opcount' => 0,
25157             'prods' => [
25158             bless( {
25159             'actcount' => 1,
25160             'dircount' => 1,
25161             'error' => undef,
25162             'items' => [
25163             bless( {
25164             'description' => '/(?=[\'"])/',
25165             'hashname' => '__PATTERN1__',
25166             'ldelim' => '/',
25167             'line' => 180,
25168             'lookahead' => 0,
25169             'mod' => '',
25170             'pattern' => '(?=[\'"])',
25171             'rdelim' => '/'
25172             }, 'XML::XSH2::Parser::_Runtime::Token' ),
25173             bless( {
25174             'code' => '$commit = 1',
25175             'hashname' => '__DIRECTIVE1__',
25176             'line' => 180,
25177             'lookahead' => 0,
25178             'name' => ''
25179             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
25180             bless( {
25181             'argcode' => undef,
25182             'implicit' => undef,
25183             'line' => 180,
25184             'lookahead' => 0,
25185             'matchrule' => 0,
25186             'subrule' => 'xpstring'
25187             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
25188             bless( {
25189             'code' => '{ $item[3] }',
25190             'hashname' => '__ACTION1__',
25191             'line' => 181,
25192             'lookahead' => 0
25193             }, 'XML::XSH2::Parser::_Runtime::Action' )
25194             ],
25195             'line' => undef,
25196             'number' => 0,
25197             'patcount' => 1,
25198             'strcount' => 0,
25199             'uncommit' => undef
25200             }, 'XML::XSH2::Parser::_Runtime::Production' ),
25201             bless( {
25202             'actcount' => 1,
25203             'dircount' => 1,
25204             'error' => undef,
25205             'items' => [
25206             bless( {
25207             'argcode' => undef,
25208             'implicit' => undef,
25209             'line' => 183,
25210             'lookahead' => 0,
25211             'matchrule' => 0,
25212             'subrule' => 'xpsimple'
25213             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
25214             bless( {
25215             'code' => 'my $oldskip = $skip; $skip=""; $oldskip',
25216             'hashname' => '__DIRECTIVE1__',
25217             'line' => 183,
25218             'lookahead' => 0,
25219             'name' => ''
25220             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
25221             bless( {
25222             'argcode' => undef,
25223             'expected' => undef,
25224             'line' => 183,
25225             'lookahead' => 0,
25226             'matchrule' => 0,
25227             'max' => 1,
25228             'min' => 0,
25229             'repspec' => '?',
25230             'subrule' => 'xpcont'
25231             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
25232             bless( {
25233             'code' => '{ $item[1].join("",@{$item[3]}) }',
25234             'hashname' => '__ACTION1__',
25235             'line' => 184,
25236             'lookahead' => 0
25237             }, 'XML::XSH2::Parser::_Runtime::Action' )
25238             ],
25239             'line' => 183,
25240             'number' => 1,
25241             'patcount' => 0,
25242             'strcount' => 0,
25243             'uncommit' => undef
25244             }, 'XML::XSH2::Parser::_Runtime::Production' ),
25245             bless( {
25246             'actcount' => 0,
25247             'dircount' => 1,
25248             'error' => 1,
25249             'items' => [
25250             bless( {
25251             'commitonly' => '',
25252             'hashname' => '__DIRECTIVE1__',
25253             'line' => 186,
25254             'lookahead' => 0,
25255             'msg' => 'expected XPath, but got "}.substr($text,0,40).qq{ ..."'
25256             }, 'XML::XSH2::Parser::_Runtime::Error' )
25257             ],
25258             'line' => 186,
25259             'number' => 2,
25260             'patcount' => 0,
25261             'strcount' => 0,
25262             'uncommit' => 0
25263             }, 'XML::XSH2::Parser::_Runtime::Production' )
25264             ],
25265             'vars' => ''
25266             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25267             'xpaxis' => bless( {
25268             'calls' => [],
25269             'changed' => 0,
25270             'impcount' => 0,
25271             'line' => 425,
25272             'name' => 'xpaxis',
25273             'opcount' => 0,
25274             'prods' => [
25275             bless( {
25276             'actcount' => 0,
25277             'dircount' => 0,
25278             'error' => undef,
25279             'items' => [
25280             bless( {
25281             'description' => '/[-a-z]+::/',
25282             'hashname' => '__PATTERN1__',
25283             'ldelim' => '/',
25284             'line' => 426,
25285             'lookahead' => 0,
25286             'mod' => '',
25287             'pattern' => '[-a-z]+::',
25288             'rdelim' => '/'
25289             }, 'XML::XSH2::Parser::_Runtime::Token' )
25290             ],
25291             'line' => undef,
25292             'number' => 0,
25293             'patcount' => 1,
25294             'strcount' => 0,
25295             'uncommit' => undef
25296             }, 'XML::XSH2::Parser::_Runtime::Production' )
25297             ],
25298             'vars' => ''
25299             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25300             'xpbracket' => bless( {
25301             'calls' => [
25302             'xpinter'
25303             ],
25304             'changed' => 0,
25305             'impcount' => 0,
25306             'line' => 222,
25307             'name' => 'xpbracket',
25308             'opcount' => 0,
25309             'prods' => [
25310             bless( {
25311             'actcount' => 1,
25312             'dircount' => 1,
25313             'error' => undef,
25314             'items' => [
25315             bless( {
25316             'description' => '\'(\'',
25317             'hashname' => '__STRING1__',
25318             'line' => 223,
25319             'lookahead' => 0,
25320             'pattern' => '('
25321             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
25322             bless( {
25323             'code' => 'my $oldskip = $skip; $skip=""; $oldskip',
25324             'hashname' => '__DIRECTIVE1__',
25325             'line' => 223,
25326             'lookahead' => 0,
25327             'name' => ''
25328             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
25329             bless( {
25330             'argcode' => undef,
25331             'implicit' => undef,
25332             'line' => 223,
25333             'lookahead' => 0,
25334             'matchrule' => 0,
25335             'subrule' => 'xpinter'
25336             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
25337             bless( {
25338             'description' => '\')\'',
25339             'hashname' => '__STRING2__',
25340             'line' => 223,
25341             'lookahead' => 0,
25342             'pattern' => ')'
25343             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
25344             bless( {
25345             'code' => '{ "($item[3])" }',
25346             'hashname' => '__ACTION1__',
25347             'line' => 224,
25348             'lookahead' => 0
25349             }, 'XML::XSH2::Parser::_Runtime::Action' )
25350             ],
25351             'line' => undef,
25352             'number' => 0,
25353             'patcount' => 0,
25354             'strcount' => 2,
25355             'uncommit' => undef
25356             }, 'XML::XSH2::Parser::_Runtime::Production' )
25357             ],
25358             'vars' => ''
25359             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25360             'xpbrackets' => bless( {
25361             'calls' => [
25362             'xpbracket',
25363             'xpfilters'
25364             ],
25365             'changed' => 0,
25366             'impcount' => 0,
25367             'line' => 227,
25368             'name' => 'xpbrackets',
25369             'opcount' => 0,
25370             'prods' => [
25371             bless( {
25372             'actcount' => 1,
25373             'dircount' => 1,
25374             'error' => undef,
25375             'items' => [
25376             bless( {
25377             'description' => '/(?=\\\\()/',
25378             'hashname' => '__PATTERN1__',
25379             'ldelim' => '/',
25380             'line' => 228,
25381             'lookahead' => 0,
25382             'mod' => '',
25383             'pattern' => '(?=\\()',
25384             'rdelim' => '/'
25385             }, 'XML::XSH2::Parser::_Runtime::Token' ),
25386             bless( {
25387             'argcode' => undef,
25388             'implicit' => undef,
25389             'line' => 228,
25390             'lookahead' => 0,
25391             'matchrule' => 0,
25392             'subrule' => 'xpbracket'
25393             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
25394             bless( {
25395             'code' => 'my $oldskip = $skip; $skip=""; $oldskip',
25396             'hashname' => '__DIRECTIVE1__',
25397             'line' => 228,
25398             'lookahead' => 0,
25399             'name' => ''
25400             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
25401             bless( {
25402             'argcode' => undef,
25403             'expected' => undef,
25404             'line' => 228,
25405             'lookahead' => 0,
25406             'matchrule' => 0,
25407             'max' => 1,
25408             'min' => 0,
25409             'repspec' => '?',
25410             'subrule' => 'xpfilters'
25411             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
25412             bless( {
25413             'code' => '{ join "",$item[2],@{$item[4]} }',
25414             'hashname' => '__ACTION1__',
25415             'line' => 229,
25416             'lookahead' => 0
25417             }, 'XML::XSH2::Parser::_Runtime::Action' )
25418             ],
25419             'line' => undef,
25420             'number' => 0,
25421             'patcount' => 1,
25422             'strcount' => 0,
25423             'uncommit' => undef
25424             }, 'XML::XSH2::Parser::_Runtime::Production' )
25425             ],
25426             'vars' => ''
25427             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25428             'xpcont' => bless( {
25429             'calls' => [
25430             '_alternation_1_of_production_1_of_rule_xpcont',
25431             'xpath'
25432             ],
25433             'changed' => 0,
25434             'impcount' => 0,
25435             'line' => 202,
25436             'name' => 'xpcont',
25437             'opcount' => 0,
25438             'prods' => [
25439             bless( {
25440             'actcount' => 1,
25441             'dircount' => 1,
25442             'error' => undef,
25443             'items' => [
25444             bless( {
25445             'argcode' => undef,
25446             'implicit' => 'xpfilters, or xpbrackets',
25447             'line' => 205,
25448             'lookahead' => 0,
25449             'matchrule' => 0,
25450             'subrule' => '_alternation_1_of_production_1_of_rule_xpcont'
25451             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
25452             bless( {
25453             'code' => 'my $oldskip = $skip; $skip=""; $oldskip',
25454             'hashname' => '__DIRECTIVE1__',
25455             'line' => 205,
25456             'lookahead' => 0,
25457             'name' => ''
25458             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
25459             bless( {
25460             'argcode' => undef,
25461             'expected' => undef,
25462             'line' => 205,
25463             'lookahead' => 0,
25464             'matchrule' => 0,
25465             'max' => 1,
25466             'min' => 0,
25467             'repspec' => '?',
25468             'subrule' => 'xpath'
25469             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
25470             bless( {
25471             'code' => '{ $item[1].join("",@{$item[3]}) }',
25472             'hashname' => '__ACTION1__',
25473             'line' => 206,
25474             'lookahead' => 0
25475             }, 'XML::XSH2::Parser::_Runtime::Action' )
25476             ],
25477             'line' => undef,
25478             'number' => 0,
25479             'patcount' => 0,
25480             'strcount' => 0,
25481             'uncommit' => undef
25482             }, 'XML::XSH2::Parser::_Runtime::Production' ),
25483             bless( {
25484             'actcount' => 1,
25485             'dircount' => 0,
25486             'error' => undef,
25487             'items' => [
25488             bless( {
25489             'argcode' => undef,
25490             'implicit' => undef,
25491             'line' => 208,
25492             'lookahead' => 0,
25493             'matchrule' => 0,
25494             'subrule' => 'xpath'
25495             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
25496             bless( {
25497             'code' => '{ $item[1] }',
25498             'hashname' => '__ACTION1__',
25499             'line' => 209,
25500             'lookahead' => 0
25501             }, 'XML::XSH2::Parser::_Runtime::Action' )
25502             ],
25503             'line' => 208,
25504             'number' => 1,
25505             'patcount' => 0,
25506             'strcount' => 0,
25507             'uncommit' => undef
25508             }, 'XML::XSH2::Parser::_Runtime::Production' )
25509             ],
25510             'vars' => ''
25511             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25512             'xpfilter' => bless( {
25513             'calls' => [
25514             'xpinter'
25515             ],
25516             'changed' => 0,
25517             'impcount' => 0,
25518             'line' => 217,
25519             'name' => 'xpfilter',
25520             'opcount' => 0,
25521             'prods' => [
25522             bless( {
25523             'actcount' => 1,
25524             'dircount' => 0,
25525             'error' => undef,
25526             'items' => [
25527             bless( {
25528             'description' => '\'[\'',
25529             'hashname' => '__STRING1__',
25530             'line' => 218,
25531             'lookahead' => 0,
25532             'pattern' => '['
25533             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
25534             bless( {
25535             'argcode' => undef,
25536             'implicit' => undef,
25537             'line' => 218,
25538             'lookahead' => 0,
25539             'matchrule' => 0,
25540             'subrule' => 'xpinter'
25541             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
25542             bless( {
25543             'description' => '\']\'',
25544             'hashname' => '__STRING2__',
25545             'line' => 218,
25546             'lookahead' => 0,
25547             'pattern' => ']'
25548             }, 'XML::XSH2::Parser::_Runtime::Literal' ),
25549             bless( {
25550             'code' => '{ "[$item[2]]" }',
25551             'hashname' => '__ACTION1__',
25552             'line' => 219,
25553             'lookahead' => 0
25554             }, 'XML::XSH2::Parser::_Runtime::Action' )
25555             ],
25556             'line' => undef,
25557             'number' => 0,
25558             'patcount' => 0,
25559             'strcount' => 2,
25560             'uncommit' => undef
25561             }, 'XML::XSH2::Parser::_Runtime::Production' )
25562             ],
25563             'vars' => ''
25564             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25565             'xpfilters' => bless( {
25566             'calls' => [
25567             'xpfilter'
25568             ],
25569             'changed' => 0,
25570             'impcount' => 0,
25571             'line' => 212,
25572             'name' => 'xpfilters',
25573             'opcount' => 0,
25574             'prods' => [
25575             bless( {
25576             'actcount' => 1,
25577             'dircount' => 0,
25578             'error' => undef,
25579             'items' => [
25580             bless( {
25581             'description' => '/(?=\\\\[)/',
25582             'hashname' => '__PATTERN1__',
25583             'ldelim' => '/',
25584             'line' => 213,
25585             'lookahead' => 0,
25586             'mod' => '',
25587             'pattern' => '(?=\\[)',
25588             'rdelim' => '/'
25589             }, 'XML::XSH2::Parser::_Runtime::Token' ),
25590             bless( {
25591             'argcode' => undef,
25592             'expected' => undef,
25593             'line' => 213,
25594             'lookahead' => 0,
25595             'matchrule' => 0,
25596             'max' => 100000000,
25597             'min' => 1,
25598             'repspec' => 's',
25599             'subrule' => 'xpfilter'
25600             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
25601             bless( {
25602             'code' => '{ join("",@{$item[2]}) }',
25603             'hashname' => '__ACTION1__',
25604             'line' => 214,
25605             'lookahead' => 0
25606             }, 'XML::XSH2::Parser::_Runtime::Action' )
25607             ],
25608             'line' => undef,
25609             'number' => 0,
25610             'patcount' => 1,
25611             'strcount' => 0,
25612             'uncommit' => undef
25613             }, 'XML::XSH2::Parser::_Runtime::Production' )
25614             ],
25615             'vars' => ''
25616             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25617             'xpinter' => bless( {
25618             'calls' => [
25619             'xps',
25620             'xpintercont'
25621             ],
25622             'changed' => 0,
25623             'impcount' => 0,
25624             'line' => 232,
25625             'name' => 'xpinter',
25626             'opcount' => 0,
25627             'prods' => [
25628             bless( {
25629             'actcount' => 1,
25630             'dircount' => 1,
25631             'error' => undef,
25632             'items' => [
25633             bless( {
25634             'argcode' => undef,
25635             'implicit' => undef,
25636             'line' => 233,
25637             'lookahead' => 0,
25638             'matchrule' => 0,
25639             'subrule' => 'xps'
25640             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
25641             bless( {
25642             'code' => 'my $oldskip = $skip; $skip=""; $oldskip',
25643             'hashname' => '__DIRECTIVE1__',
25644             'line' => 233,
25645             'lookahead' => 0,
25646             'name' => ''
25647             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
25648             bless( {
25649             'argcode' => undef,
25650             'expected' => undef,
25651             'line' => 233,
25652             'lookahead' => 0,
25653             'matchrule' => 0,
25654             'max' => 1,
25655             'min' => 0,
25656             'repspec' => '?',
25657             'subrule' => 'xpintercont'
25658             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
25659             bless( {
25660             'code' => '{ join("",$item[1],@{$item[3]}) }',
25661             'hashname' => '__ACTION1__',
25662             'line' => 234,
25663             'lookahead' => 0
25664             }, 'XML::XSH2::Parser::_Runtime::Action' )
25665             ],
25666             'line' => undef,
25667             'number' => 0,
25668             'patcount' => 0,
25669             'strcount' => 0,
25670             'uncommit' => undef
25671             }, 'XML::XSH2::Parser::_Runtime::Production' )
25672             ],
25673             'vars' => ''
25674             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25675             'xpintercont' => bless( {
25676             'calls' => [
25677             '_alternation_1_of_production_1_of_rule_xpintercont',
25678             'xpinter'
25679             ],
25680             'changed' => 0,
25681             'impcount' => 1,
25682             'line' => 237,
25683             'name' => 'xpintercont',
25684             'opcount' => 0,
25685             'prods' => [
25686             bless( {
25687             'actcount' => 1,
25688             'dircount' => 1,
25689             'error' => undef,
25690             'items' => [
25691             bless( {
25692             'argcode' => undef,
25693             'implicit' => 'xpfilters, or xpbrackets',
25694             'line' => 240,
25695             'lookahead' => 0,
25696             'matchrule' => 0,
25697             'subrule' => '_alternation_1_of_production_1_of_rule_xpintercont'
25698             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
25699             bless( {
25700             'code' => 'my $oldskip = $skip; $skip=""; $oldskip',
25701             'hashname' => '__DIRECTIVE1__',
25702             'line' => 240,
25703             'lookahead' => 0,
25704             'name' => ''
25705             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
25706             bless( {
25707             'argcode' => undef,
25708             'expected' => undef,
25709             'line' => 240,
25710             'lookahead' => 0,
25711             'matchrule' => 0,
25712             'max' => 1,
25713             'min' => 0,
25714             'repspec' => '?',
25715             'subrule' => 'xpinter'
25716             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
25717             bless( {
25718             'code' => '{ join("",$item[1],@{$item[3]}) }',
25719             'hashname' => '__ACTION1__',
25720             'line' => 241,
25721             'lookahead' => 0
25722             }, 'XML::XSH2::Parser::_Runtime::Action' )
25723             ],
25724             'line' => undef,
25725             'number' => 0,
25726             'patcount' => 0,
25727             'strcount' => 0,
25728             'uncommit' => undef
25729             }, 'XML::XSH2::Parser::_Runtime::Production' )
25730             ],
25731             'vars' => ''
25732             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25733             'xplocationstep' => bless( {
25734             'calls' => [
25735             'xpaxis',
25736             'xpnodetest'
25737             ],
25738             'changed' => 0,
25739             'impcount' => 0,
25740             'line' => 431,
25741             'name' => 'xplocationstep',
25742             'opcount' => 0,
25743             'prods' => [
25744             bless( {
25745             'actcount' => 1,
25746             'dircount' => 0,
25747             'error' => undef,
25748             'items' => [
25749             bless( {
25750             'argcode' => undef,
25751             'expected' => undef,
25752             'line' => 432,
25753             'lookahead' => 0,
25754             'matchrule' => 0,
25755             'max' => 1,
25756             'min' => 0,
25757             'repspec' => '?',
25758             'subrule' => 'xpaxis'
25759             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
25760             bless( {
25761             'argcode' => undef,
25762             'implicit' => undef,
25763             'line' => 432,
25764             'lookahead' => 0,
25765             'matchrule' => 0,
25766             'subrule' => 'xpnodetest'
25767             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
25768             bless( {
25769             'code' => '{ [ (@{$item[1]} ? $item[1][0] : \'child::\'),$item[3] ] }',
25770             'hashname' => '__ACTION1__',
25771             'line' => 433,
25772             'lookahead' => 0
25773             }, 'XML::XSH2::Parser::_Runtime::Action' )
25774             ],
25775             'line' => undef,
25776             'number' => 0,
25777             'patcount' => 0,
25778             'strcount' => 0,
25779             'uncommit' => undef
25780             }, 'XML::XSH2::Parser::_Runtime::Production' )
25781             ],
25782             'vars' => ''
25783             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25784             'xpnodetest' => bless( {
25785             'calls' => [],
25786             'changed' => 0,
25787             'impcount' => 0,
25788             'line' => 428,
25789             'name' => 'xpnodetest',
25790             'opcount' => 0,
25791             'prods' => [
25792             bless( {
25793             'actcount' => 0,
25794             'dircount' => 0,
25795             'error' => undef,
25796             'items' => [
25797             bless( {
25798             'description' => '/node\\\\(\\\\)|text\\\\(\\\\)|comment\\\\(\\\\)|processing-instruction\\\\(\\\\s*(?:"[^"]*"\\\\s*|\'[^\'*]\'\\\\s*)?\\\\)|[^\\\\(\\\\[\\\\/\\\\"\\\\\'\\\\&\\\\;\\\\s]+/',
25799             'hashname' => '__PATTERN1__',
25800             'ldelim' => '/',
25801             'line' => 429,
25802             'lookahead' => 0,
25803             'mod' => '',
25804             'pattern' => 'node\\(\\)|text\\(\\)|comment\\(\\)|processing-instruction\\(\\s*(?:"[^"]*"\\s*|\'[^\'*]\'\\s*)?\\)|[^\\(\\[\\/\\"\\\'\\&\\;\\s]+',
25805             'rdelim' => '/'
25806             }, 'XML::XSH2::Parser::_Runtime::Token' )
25807             ],
25808             'line' => undef,
25809             'number' => 0,
25810             'patcount' => 1,
25811             'strcount' => 0,
25812             'uncommit' => undef
25813             }, 'XML::XSH2::Parser::_Runtime::Production' )
25814             ],
25815             'vars' => ''
25816             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25817             'xps' => bless( {
25818             'calls' => [],
25819             'changed' => 0,
25820             'impcount' => 0,
25821             'line' => 244,
25822             'name' => 'xps',
25823             'opcount' => 0,
25824             'prods' => [
25825             bless( {
25826             'actcount' => 0,
25827             'dircount' => 0,
25828             'error' => undef,
25829             'items' => [
25830             bless( {
25831             'description' => '/(?: [^\\\\$\\\\[\\\\]()\'"\\};]+ |
25832             \\\\$(?!\\\\\\{) |
25833             \\\\$\\\\\\{ (?:\\\\$?[a-zA-Z_][a-zA-Z0-9_]* |
25834             \\\\\\{.*?\\\\\\} |
25835             \\\\(.+?\\\\)
25836             )
25837             \\\\\\} |
25838             \'(?:\\\\$\\\\\\{ (?: \\\\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\\\\{.*?\\\\\\} | \\\\(.+?\\\\)) \\\\\\} |
25839             \\\\$(?!\\\\\\{) | [^\\\\$\'] | \\\\\\\\\\\\$
25840             )*\' |
25841             "(?:\\\\$\\\\\\{ (?: \\\\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\\\\{.*?\\\\\\} | \\\\(.+?\\\\)) \\\\\\} |
25842             \\\\$(?!\\\\\\{) | [^\\\\$"] | \\\\\\\\\\\\$
25843             )*"
25844             )*/x',
25845             'hashname' => '__PATTERN1__',
25846             'ldelim' => '/',
25847             'line' => 245,
25848             'lookahead' => 0,
25849             'mod' => 'x',
25850             'pattern' => '(?: [^\\$\\[\\]()\'"};]+ |
25851             \\$(?!\\{) |
25852             \\$\\{ (?:\\$?[a-zA-Z_][a-zA-Z0-9_]* |
25853             \\{.*?\\} |
25854             \\(.+?\\)
25855             )
25856             \\} |
25857             \'(?:\\$\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\{.*?\\} | \\(.+?\\)) \\} |
25858             \\$(?!\\{) | [^\\$\'] | \\\\\\$
25859             )*\' |
25860             "(?:\\$\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\{.*?\\} | \\(.+?\\)) \\} |
25861             \\$(?!\\{) | [^\\$"] | \\\\\\$
25862             )*"
25863             )*',
25864             'rdelim' => '/'
25865             }, 'XML::XSH2::Parser::_Runtime::Token' )
25866             ],
25867             'line' => undef,
25868             'number' => 0,
25869             'patcount' => 1,
25870             'strcount' => 0,
25871             'uncommit' => undef
25872             }, 'XML::XSH2::Parser::_Runtime::Production' )
25873             ],
25874             'vars' => ''
25875             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25876             'xpsimple' => bless( {
25877             'calls' => [
25878             'xpbrackets'
25879             ],
25880             'changed' => 0,
25881             'impcount' => 0,
25882             'line' => 188,
25883             'name' => 'xpsimple',
25884             'opcount' => 0,
25885             'prods' => [
25886             bless( {
25887             'actcount' => 0,
25888             'dircount' => 0,
25889             'error' => undef,
25890             'items' => [
25891             bless( {
25892             'description' => '/(?:
25893             \\\\$\\\\\\{ (?: \\\\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\\\\{.*?\\\\\\} | \\\\(.+?\\\\) ) \\\\\\} |
25894             \\\\$(?!\\\\\\{) |
25895             [^-:\\\\$\\\\[\\\\]\\{\\}|"\'\\\\ \\\\s();] |
25896             -[^-\\\\[\\\\]\\{\\}|"\'\\\\ \\\\s();]
25897             )
25898             (?:
25899             \\\\$\\\\\\{ (?: \\\\$?[a-zA-Z_][a-zA-Z0-9_]* | \\\\\\{.*?\\\\\\} | \\\\(.+?\\\\) ) \\\\\\} |
25900             \\\\$(?!\\\\\\{) |
25901             [^\\\\[\\\\]\\\\$\\{\\}|"\'\\\\ \\\\s();]
25902             )*/x',
25903             'hashname' => '__PATTERN1__',
25904             'ldelim' => '/',
25905             'line' => 189,
25906             'lookahead' => 0,
25907             'mod' => 'x',
25908             'pattern' => '(?:
25909             \\$\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\{.*?\\} | \\(.+?\\) ) \\} |
25910             \\$(?!\\{) |
25911             [^-:\\$\\[\\]{}|"\'\\ \\s();] |
25912             -[^-\\[\\]{}|"\'\\ \\s();]
25913             )
25914             (?:
25915             \\$\\{ (?: \\$?[a-zA-Z_][a-zA-Z0-9_]* | \\{.*?\\} | \\(.+?\\) ) \\} |
25916             \\$(?!\\{) |
25917             [^\\[\\]\\${}|"\'\\ \\s();]
25918             )*',
25919             'rdelim' => '/'
25920             }, 'XML::XSH2::Parser::_Runtime::Token' )
25921             ],
25922             'line' => undef,
25923             'number' => 0,
25924             'patcount' => 1,
25925             'strcount' => 0,
25926             'uncommit' => undef
25927             }, 'XML::XSH2::Parser::_Runtime::Production' ),
25928             bless( {
25929             'actcount' => 0,
25930             'dircount' => 0,
25931             'error' => undef,
25932             'items' => [
25933             bless( {
25934             'argcode' => undef,
25935             'implicit' => undef,
25936             'line' => 200,
25937             'lookahead' => 0,
25938             'matchrule' => 0,
25939             'subrule' => 'xpbrackets'
25940             }, 'XML::XSH2::Parser::_Runtime::Subrule' )
25941             ],
25942             'line' => 200,
25943             'number' => 1,
25944             'patcount' => 0,
25945             'strcount' => 0,
25946             'uncommit' => undef
25947             }, 'XML::XSH2::Parser::_Runtime::Production' )
25948             ],
25949             'vars' => ''
25950             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
25951             'xpstep' => bless( {
25952             'calls' => [
25953             'xplocationstep',
25954             'xpfilter'
25955             ],
25956             'changed' => 0,
25957             'impcount' => 0,
25958             'line' => 436,
25959             'name' => 'xpstep',
25960             'opcount' => 0,
25961             'prods' => [
25962             bless( {
25963             'actcount' => 1,
25964             'dircount' => 1,
25965             'error' => undef,
25966             'items' => [
25967             bless( {
25968             'argcode' => undef,
25969             'implicit' => undef,
25970             'line' => 437,
25971             'lookahead' => 0,
25972             'matchrule' => 0,
25973             'subrule' => 'xplocationstep'
25974             }, 'XML::XSH2::Parser::_Runtime::Subrule' ),
25975             bless( {
25976             'code' => 'my $oldskip = $skip; $skip=""; $oldskip',
25977             'hashname' => '__DIRECTIVE1__',
25978             'line' => 437,
25979             'lookahead' => 0,
25980             'name' => ''
25981             }, 'XML::XSH2::Parser::_Runtime::Directive' ),
25982             bless( {
25983             'argcode' => undef,
25984             'expected' => undef,
25985             'line' => 437,
25986             'lookahead' => 0,
25987             'matchrule' => 0,
25988             'max' => 1,
25989             'min' => 0,
25990             'repspec' => '?',
25991             'subrule' => 'xpfilter'
25992             }, 'XML::XSH2::Parser::_Runtime::Repetition' ),
25993             bless( {
25994             'code' => '{ [ @{$item[1]}, @{$item[3]}] }',
25995             'hashname' => '__ACTION1__',
25996             'line' => 438,
25997             'lookahead' => 0
25998             }, 'XML::XSH2::Parser::_Runtime::Action' )
25999             ],
26000             'line' => undef,
26001             'number' => 0,
26002             'patcount' => 0,
26003             'strcount' => 0,
26004             'uncommit' => undef
26005             }, 'XML::XSH2::Parser::_Runtime::Production' )
26006             ],
26007             'vars' => ''
26008             }, 'XML::XSH2::Parser::_Runtime::Rule' ),
26009             'xpstring' => bless( {
26010             'calls' => [],
26011             'changed' => 0,
26012             'impcount' => 0,
26013             'line' => 260,
26014             'name' => 'xpstring',
26015             'opcount' => 0,
26016             'prods' => [
26017             bless( {
26018             'actcount' => 0,
26019             'dircount' => 0,
26020             'error' => undef,
26021             'items' => [
26022             bless( {
26023             'description' => '/\'(?:\\\\$\\\\\\{(?:\\\\$?[a-zA-Z_][a-zA-Z0-9_]*|\\\\\\{.*?\\\\\\}|\\\\(.+?\\\\))\\\\\\}|\\\\$(?!\\\\\\{)|[^\\\\$\']|\\\\\\\\\\\\$)*\' |
26024             "(?:\\\\$\\\\\\{(?:\\\\$?[a-zA-Z_][a-zA-Z0-9_]*|\\\\\\{.*?\\\\\\}|\\\\(.+?\\\\))\\\\\\}|\\\\$(?!\\\\\\{)|[^\\\\$"]|\\\\\\\\\\\\$)*"/x',
26025             'hashname' => '__PATTERN1__',
26026             'ldelim' => '/',
26027             'line' => 261,
26028             'lookahead' => 0,
26029             'mod' => 'x',
26030             'pattern' => '\'(?:\\$\\{(?:\\$?[a-zA-Z_][a-zA-Z0-9_]*|\\{.*?\\}|\\(.+?\\))\\}|\\$(?!\\{)|[^\\$\']|\\\\\\$)*\' |
26031             "(?:\\$\\{(?:\\$?[a-zA-Z_][a-zA-Z0-9_]*|\\{.*?\\}|\\(.+?\\))\\}|\\$(?!\\{)|[^\\$"]|\\\\\\$)*"',
26032             'rdelim' => '/'
26033             }, 'XML::XSH2::Parser::_Runtime::Token' )
26034             ],
26035             'line' => undef,
26036             'number' => 0,
26037             'patcount' => 1,
26038             'strcount' => 0,
26039             'uncommit' => undef
26040             }, 'XML::XSH2::Parser::_Runtime::Production' )
26041             ],
26042             'vars' => ''
26043             }, 'XML::XSH2::Parser::_Runtime::Rule' )
26044             },
26045             'startcode' => ''
26046             }, 'XML::XSH2::Parser::_Runtime' );
26047             }