line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Module Parse::Yapp::Output |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Copyright © 1998, 1999, 2000, 2001, Francois Desarmenien. |
5
|
|
|
|
|
|
|
# Copyright © 2017 William N. Braswell, Jr. |
6
|
|
|
|
|
|
|
# (see the pod text in Parse::Yapp module for use and distribution rights) |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
package Parse::Yapp::Output; |
9
|
|
|
|
|
|
|
@ISA=qw ( Parse::Yapp::Lalr ); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
require 5.004; |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
1081
|
use Parse::Yapp::Lalr; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
81
|
|
14
|
3
|
|
|
3
|
|
14
|
use Parse::Yapp::Driver; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
45
|
|
15
|
|
|
|
|
|
|
|
16
|
3
|
|
|
3
|
|
13
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
47
|
|
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
3
|
|
13
|
use Carp; |
|
3
|
|
|
|
|
18
|
|
|
3
|
|
|
|
|
958
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _CopyDriver { |
21
|
0
|
|
|
0
|
|
0
|
my($text)='#Included Parse/Yapp/Driver.pm file'.('-' x 40)."\n"; |
22
|
0
|
0
|
|
|
|
0
|
open(DRV,$Parse::Yapp::Driver::FILENAME) |
23
|
|
|
|
|
|
|
or die "BUG: could not open $Parse::Yapp::Driver::FILENAME"; |
24
|
0
|
|
|
|
|
0
|
$text.="{\n".join('',)."}\n"; |
25
|
0
|
|
|
|
|
0
|
close(DRV); |
26
|
0
|
|
|
|
|
0
|
$text.='#End of include'.('-' x 50)."\n"; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub Output { |
30
|
9
|
|
|
9
|
0
|
92
|
my($self)=shift; |
31
|
|
|
|
|
|
|
|
32
|
9
|
|
|
|
|
39
|
$self->Options(@_); |
33
|
|
|
|
|
|
|
|
34
|
9
|
|
|
|
|
28
|
my($package)=$self->Option('classname'); |
35
|
9
|
|
|
|
|
18
|
my($head,$states,$rules,$tail,$driver); |
36
|
9
|
|
|
|
|
22
|
my($version)=$Parse::Yapp::Driver::VERSION; |
37
|
9
|
|
|
|
|
14
|
my($datapos); |
38
|
9
|
|
50
|
|
|
22
|
my($text)=$self->Option('template') ||<<'EOT'; |
39
|
|
|
|
|
|
|
#################################################################### |
40
|
|
|
|
|
|
|
# |
41
|
|
|
|
|
|
|
# This file was generated using Parse::Yapp version <<$version>>. |
42
|
|
|
|
|
|
|
# |
43
|
|
|
|
|
|
|
# Don't edit this file, use source file instead. |
44
|
|
|
|
|
|
|
# |
45
|
|
|
|
|
|
|
# ANY CHANGE MADE HERE WILL BE LOST ! |
46
|
|
|
|
|
|
|
# |
47
|
|
|
|
|
|
|
#################################################################### |
48
|
|
|
|
|
|
|
package <<$package>>; |
49
|
|
|
|
|
|
|
use vars qw ( @ISA ); |
50
|
|
|
|
|
|
|
use strict; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
@ISA= qw ( Parse::Yapp::Driver ); |
53
|
|
|
|
|
|
|
<<$driver>> |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
<<$head>> |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub new { |
58
|
|
|
|
|
|
|
my($class)=shift; |
59
|
|
|
|
|
|
|
ref($class) |
60
|
|
|
|
|
|
|
and $class=ref($class); |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
my($self)=$class->SUPER::new( yyversion => '<<$version>>', |
63
|
|
|
|
|
|
|
yystates => |
64
|
|
|
|
|
|
|
<<$states>>, |
65
|
|
|
|
|
|
|
yyrules => |
66
|
|
|
|
|
|
|
<<$rules>>, |
67
|
|
|
|
|
|
|
@_); |
68
|
|
|
|
|
|
|
bless($self,$class); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
<<$tail>> |
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
EOT |
74
|
|
|
|
|
|
|
|
75
|
9
|
|
|
|
|
18
|
$driver='use Parse::Yapp::Driver;'; |
76
|
|
|
|
|
|
|
|
77
|
9
|
50
|
|
|
|
21
|
defined($package) |
78
|
|
|
|
|
|
|
or $package='Parse::Yapp::Default'; |
79
|
|
|
|
|
|
|
|
80
|
9
|
|
|
|
|
47
|
$head= $self->Head(); |
81
|
9
|
|
|
|
|
28
|
$rules=$self->RulesTable(); |
82
|
9
|
|
|
|
|
36
|
$states=$self->DfaTable(); |
83
|
9
|
|
|
|
|
40
|
$tail= $self->Tail(); |
84
|
|
|
|
|
|
|
|
85
|
9
|
50
|
|
|
|
33
|
$self->Option('standalone') |
86
|
|
|
|
|
|
|
and $driver=_CopyDriver(); |
87
|
|
|
|
|
|
|
|
88
|
9
|
|
|
|
|
66
|
$text=~s/<<(\$.+)>>/$1/gee; |
|
72
|
|
|
|
|
2515
|
|
89
|
|
|
|
|
|
|
|
90
|
9
|
|
|
|
|
94
|
$text; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |