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
|
104
|
|
|
104
|
|
328702
|
use 5.010001; |
|
104
|
|
|
|
|
424
|
|
15
|
104
|
|
|
104
|
|
517
|
use strict; |
|
104
|
|
|
|
|
173
|
|
|
104
|
|
|
|
|
2181
|
|
16
|
104
|
|
|
104
|
|
675
|
use warnings; |
|
104
|
|
|
|
|
200
|
|
|
104
|
|
|
|
|
3295
|
|
17
|
|
|
|
|
|
|
|
18
|
104
|
|
|
104
|
|
513
|
use vars qw($VERSION $STRING_VERSION @ISA $DEBUG); |
|
104
|
|
|
|
|
229
|
|
|
104
|
|
|
|
|
8963
|
|
19
|
|
|
|
|
|
|
$VERSION = '4.001_054'; |
20
|
|
|
|
|
|
|
$STRING_VERSION = $VERSION; |
21
|
|
|
|
|
|
|
## no critic (BuiltinFunctions::ProhibitStringyEval) |
22
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
23
|
|
|
|
|
|
|
## use critic |
24
|
|
|
|
|
|
|
$DEBUG = 0; |
25
|
|
|
|
|
|
|
|
26
|
104
|
|
|
104
|
|
638
|
use Carp; |
|
104
|
|
|
|
|
194
|
|
|
104
|
|
|
|
|
6123
|
|
27
|
104
|
|
|
104
|
|
20465
|
use English qw( -no_match_vars ); |
|
104
|
|
|
|
|
131110
|
|
|
104
|
|
|
|
|
628
|
|
28
|
104
|
|
|
104
|
|
36283
|
use XSLoader; |
|
104
|
|
|
|
|
174
|
|
|
104
|
|
|
|
|
2283
|
|
29
|
|
|
|
|
|
|
|
30
|
104
|
|
|
104
|
|
50651
|
use Marpa::R3::Version; |
|
104
|
|
|
|
|
232
|
|
|
104
|
|
|
|
|
15138
|
|
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
|
1144
|
|
|
1144
|
0
|
3869
|
my ($sub_module_version) = @_; |
44
|
1144
|
50
|
|
|
|
3729
|
return 'not defined' if not defined $sub_module_version; |
45
|
1144
|
50
|
|
|
|
3773
|
return "$sub_module_version does not match Marpa::R3::VERSION " . $VERSION |
46
|
|
|
|
|
|
|
if $sub_module_version != $VERSION; |
47
|
1144
|
|
|
|
|
16330
|
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
|
104
|
|
|
104
|
|
644
|
no strict 'refs'; |
|
104
|
|
|
|
|
210
|
|
|
104
|
|
|
|
|
35961
|
|
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: |