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
|
|
391437
|
use 5.010001; |
|
104
|
|
|
|
|
465
|
|
15
|
104
|
|
|
104
|
|
624
|
use strict; |
|
104
|
|
|
|
|
211
|
|
|
104
|
|
|
|
|
2500
|
|
16
|
104
|
|
|
104
|
|
568
|
use warnings; |
|
104
|
|
|
|
|
218
|
|
|
104
|
|
|
|
|
3522
|
|
17
|
|
|
|
|
|
|
|
18
|
104
|
|
|
104
|
|
627
|
use vars qw($VERSION $STRING_VERSION @ISA $DEBUG); |
|
104
|
|
|
|
|
184
|
|
|
104
|
|
|
|
|
10787
|
|
19
|
|
|
|
|
|
|
$VERSION = '4.001_053'; |
20
|
|
|
|
|
|
|
$STRING_VERSION = $VERSION; |
21
|
|
|
|
|
|
|
## no critic (BuiltinFunctions::ProhibitStringyEval) |
22
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
23
|
|
|
|
|
|
|
## use critic |
24
|
|
|
|
|
|
|
$DEBUG = 0; |
25
|
|
|
|
|
|
|
|
26
|
104
|
|
|
104
|
|
694
|
use Carp; |
|
104
|
|
|
|
|
277
|
|
|
104
|
|
|
|
|
6755
|
|
27
|
104
|
|
|
104
|
|
20455
|
use English qw( -no_match_vars ); |
|
104
|
|
|
|
|
149146
|
|
|
104
|
|
|
|
|
710
|
|
28
|
104
|
|
|
104
|
|
36974
|
use XSLoader; |
|
104
|
|
|
|
|
203
|
|
|
104
|
|
|
|
|
2666
|
|
29
|
|
|
|
|
|
|
|
30
|
104
|
|
|
104
|
|
41200
|
use Marpa::R3::Version; |
|
104
|
|
|
|
|
286
|
|
|
104
|
|
|
|
|
17780
|
|
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
|
2995
|
my ($sub_module_version) = @_; |
44
|
1144
|
50
|
|
|
|
3573
|
return 'not defined' if not defined $sub_module_version; |
45
|
1144
|
50
|
|
|
|
3326
|
return "$sub_module_version does not match Marpa::R3::VERSION " . $VERSION |
46
|
|
|
|
|
|
|
if $sub_module_version != $VERSION; |
47
|
1144
|
|
|
|
|
4927
|
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
|
|
780
|
no strict 'refs'; |
|
104
|
|
|
|
|
231
|
|
|
104
|
|
|
|
|
41762
|
|
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: |