line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Marpa::R3 is Copyright (C) 2018, Jeffrey Kegler. |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# This module is free software; you can redistribute it and/or modify it |
4
|
|
|
|
|
|
|
# under the same terms as Perl 5.10.1. For more details, see the full text |
5
|
|
|
|
|
|
|
# of the licenses in the directory LICENSES. |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be |
8
|
|
|
|
|
|
|
# useful, but it is provided "as is" and without any express |
9
|
|
|
|
|
|
|
# or implied warranties. For details, see the full text of |
10
|
|
|
|
|
|
|
# of the licenses in the directory LICENSES. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Marpa::R3; |
13
|
|
|
|
|
|
|
|
14
|
101
|
|
|
101
|
|
403689
|
use 5.010001; |
|
101
|
|
|
|
|
457
|
|
15
|
101
|
|
|
101
|
|
649
|
use strict; |
|
101
|
|
|
|
|
249
|
|
|
101
|
|
|
|
|
2968
|
|
16
|
101
|
|
|
101
|
|
645
|
use warnings; |
|
101
|
|
|
|
|
237
|
|
|
101
|
|
|
|
|
4131
|
|
17
|
|
|
|
|
|
|
|
18
|
101
|
|
|
101
|
|
680
|
use vars qw($VERSION $STRING_VERSION @ISA $DEBUG); |
|
101
|
|
|
|
|
261
|
|
|
101
|
|
|
|
|
10830
|
|
19
|
|
|
|
|
|
|
$VERSION = '4.001_052'; |
20
|
|
|
|
|
|
|
$STRING_VERSION = $VERSION; |
21
|
|
|
|
|
|
|
## no critic (BuiltinFunctions::ProhibitStringyEval) |
22
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
23
|
|
|
|
|
|
|
## use critic |
24
|
|
|
|
|
|
|
$DEBUG = 0; |
25
|
|
|
|
|
|
|
|
26
|
101
|
|
|
101
|
|
769
|
use Carp; |
|
101
|
|
|
|
|
235
|
|
|
101
|
|
|
|
|
9198
|
|
27
|
101
|
|
|
101
|
|
18953
|
use English qw( -no_match_vars ); |
|
101
|
|
|
|
|
141201
|
|
|
101
|
|
|
|
|
896
|
|
28
|
101
|
|
|
101
|
|
42272
|
use XSLoader; |
|
101
|
|
|
|
|
254
|
|
|
101
|
|
|
|
|
2966
|
|
29
|
|
|
|
|
|
|
|
30
|
101
|
|
|
101
|
|
43992
|
use Marpa::R3::Version; |
|
101
|
|
|
|
|
297
|
|
|
101
|
|
|
|
|
19292
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
XSLoader::load( 'Marpa::R3', $Marpa::R3::STRING_VERSION ); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
if ( not $ENV{'MARPA_AUTHOR_TEST'} ) { |
35
|
|
|
|
|
|
|
$Marpa::R3::DEBUG = 0; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
else { |
38
|
|
|
|
|
|
|
Marpa::R3::Thin::debug_level_set(1); |
39
|
|
|
|
|
|
|
$Marpa::R3::DEBUG = 1; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub version_ok { |
43
|
1111
|
|
|
1111
|
0
|
3699
|
my ($sub_module_version) = @_; |
44
|
1111
|
50
|
|
|
|
4445
|
return 'not defined' if not defined $sub_module_version; |
45
|
1111
|
50
|
|
|
|
3994
|
return "$sub_module_version does not match Marpa::R3::VERSION " . $VERSION |
46
|
|
|
|
|
|
|
if $sub_module_version != $VERSION; |
47
|
1111
|
|
|
|
|
5373
|
return; |
48
|
|
|
|
|
|
|
} ## end sub version_ok |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# Set up the error values |
51
|
|
|
|
|
|
|
my @error_names = Marpa::R3::Thin::error_names(); |
52
|
|
|
|
|
|
|
for ( my $error = 0; $error <= $#error_names; ) { |
53
|
|
|
|
|
|
|
my $current_error = $error; |
54
|
|
|
|
|
|
|
(my $name = $error_names[$error] ) =~ s/\A MARPA_ERR_//xms; |
55
|
101
|
|
|
101
|
|
891
|
no strict 'refs'; |
|
101
|
|
|
|
|
287
|
|
|
101
|
|
|
|
|
45352
|
|
56
|
|
|
|
|
|
|
*{ "Marpa::R3::Error::$name" } = \$current_error; |
57
|
|
|
|
|
|
|
# This shuts up the "used only once" warning |
58
|
|
|
|
|
|
|
my $dummy = eval q{$} . 'Marpa::R3::Error::' . $name; |
59
|
|
|
|
|
|
|
$error++; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
my $version_result; |
63
|
|
|
|
|
|
|
require Marpa::R3::Internal; |
64
|
|
|
|
|
|
|
( $version_result = version_ok($Marpa::R3::Internal::VERSION) ) |
65
|
|
|
|
|
|
|
and die 'Marpa::R3::Internal::VERSION ', $version_result; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
require Marpa::R3::Common; |
68
|
|
|
|
|
|
|
( $version_result = version_ok($Marpa::R3::Common::VERSION) ) |
69
|
|
|
|
|
|
|
and die 'Marpa::R3::Common::VERSION ', $version_result; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
require Marpa::R3::MetaG; |
72
|
|
|
|
|
|
|
( $version_result = version_ok($Marpa::R3::MetaG::VERSION) ) |
73
|
|
|
|
|
|
|
and die 'Marpa::R3::MetaG::VERSION ', $version_result; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
require Marpa::R3::SLG; |
76
|
|
|
|
|
|
|
( $version_result = version_ok($Marpa::R3::Grammar::VERSION) ) |
77
|
|
|
|
|
|
|
and die 'Marpa::R3::Grammar::VERSION ', $version_result; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
require Marpa::R3::SLR; |
80
|
|
|
|
|
|
|
( $version_result = version_ok($Marpa::R3::Recognizer::VERSION) ) |
81
|
|
|
|
|
|
|
and die 'Marpa::R3::Recognizer::VERSION ', $version_result; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
require Marpa::R3::SLV; |
84
|
|
|
|
|
|
|
( $version_result = version_ok($Marpa::R3::Valuer::VERSION) ) |
85
|
|
|
|
|
|
|
and die 'Marpa::R3::Valuer::VERSION ', $version_result; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
require Marpa::R3::MetaAST; |
88
|
|
|
|
|
|
|
( $version_result = version_ok($Marpa::R3::MetaAST::VERSION) ) |
89
|
|
|
|
|
|
|
and die 'Marpa::R3::MetaAST::VERSION ', $version_result; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
require Marpa::R3::Glade; |
92
|
|
|
|
|
|
|
( $version_result = version_ok($Marpa::R3::Glade::VERSION) ) |
93
|
|
|
|
|
|
|
and die 'Marpa::R3::Glade::VERSION ', $version_result; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
require Marpa::R3::ASF; |
96
|
|
|
|
|
|
|
( $version_result = version_ok($Marpa::R3::ASF::VERSION) ) |
97
|
|
|
|
|
|
|
and die 'Marpa::R3::ASF::VERSION ', $version_result; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
require Marpa::R3::ASF2; |
100
|
|
|
|
|
|
|
( $version_result = version_ok($Marpa::R3::ASF2::VERSION) ) |
101
|
|
|
|
|
|
|
and die 'Marpa::R3::ASF2::VERSION ', $version_result; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
require Marpa::R3::X; |
104
|
|
|
|
|
|
|
( $version_result = version_ok($Marpa::R3::X::VERSION) ) |
105
|
|
|
|
|
|
|
and die 'Marpa::R3::X::VERSION ', $version_result; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
1; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
# vim: set expandtab shiftwidth=4: |