File Coverage

blib/lib/MarpaX/Database/Terminfo/Grammar.pm
Criterion Covered Total %
statement 20 22 90.9
branch n/a
condition n/a
subroutine 6 7 85.7
pod 4 4 100.0
total 30 33 90.9


line stmt bran cond sub pod time code
1 18     18   60 use strict;
  18         21  
  18         424  
2 18     18   57 use warnings FATAL => 'all';
  18         24  
  18         574  
3              
4             package MarpaX::Database::Terminfo::Grammar;
5 18     18   6888 use MarpaX::Database::Terminfo::Grammar::Actions;
  18         49  
  18         3227  
6              
7             # ABSTRACT: Terminfo grammar in Marpa BNF
8              
9             our $VERSION = '0.012'; # VERSION
10              
11              
12             our $GRAMMAR_CONTENT = do {local $/; };
13              
14             sub new {
15 2     2 1 6 my $class = shift;
16              
17 2         4 my $self = {};
18              
19 2         9 $self->{_content} = $GRAMMAR_CONTENT;
20             $self->{_grammar_option} = {
21             action_object => sprintf('%s::%s', __PACKAGE__, 'Actions'),
22             source => \$self->{_content}
23 2         11 };
24 2         5 $self->{_recce_option} = {};
25              
26 2         4 bless($self, $class);
27              
28 2         8 return $self;
29             }
30              
31              
32             sub content {
33 0     0 1 0 my ($self) = @_;
34 0         0 return $self->{_content};
35             }
36              
37              
38             sub grammar_option {
39 2     2 1 4 my ($self) = @_;
40 2         13 return $self->{_grammar_option};
41             }
42              
43              
44             sub recce_option {
45 2     2 1 4 my ($self) = @_;
46 2         8 return $self->{_recce_option};
47             }
48              
49              
50             1;
51              
52             =pod
53              
54             =encoding UTF-8
55              
56             =head1 NAME
57              
58             MarpaX::Database::Terminfo::Grammar - Terminfo grammar in Marpa BNF
59              
60             =head1 VERSION
61              
62             version 0.012
63              
64             =head1 SYNOPSIS
65              
66             use MarpaX::Database::Terminfo::Grammar;
67              
68             my $grammar = MarpaX::Database::Terminfo::Grammar->new();
69             my $grammar_content = $grammar->content();
70              
71             =head1 DESCRIPTION
72              
73             This modules returns Terminfo grammar written in Marpa BNF.
74              
75             =head1 SUBROUTINES/METHODS
76              
77             =head2 new($class)
78              
79             Instance a new object.
80              
81             =head2 content($self)
82              
83             Returns the content of the grammar.
84              
85             =head2 grammar_option($self)
86              
87             Returns recommended option for Marpa::R2::Scanless::G->new(), returned as a reference to a hash.
88              
89             =head2 recce_option($self)
90              
91             Returns recommended option for Marpa::R2::Scanless::R->new(), returned as a reference to a hash.
92              
93             =head1 SEE ALSO
94              
95             L
96              
97             =head1 AUTHOR
98              
99             jddurand
100              
101             =head1 COPYRIGHT AND LICENSE
102              
103             This software is copyright (c) 2013 by Jean-Damien Durand.
104              
105             This is free software; you can redistribute it and/or modify it under
106             the same terms as the Perl 5 programming language system itself.
107              
108             =cut
109              
110             __DATA__