| 1 | package Locale::Babelfish::Phrase::Parser; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Babelfish syntax parser. | ||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | 6 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 6 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 6 | ▶ | use Locale::Babelfish::Phrase::Literal (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | 6 | ▶ | use Locale::Babelfish::Phrase::Variable (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 6 | ▶ | use Locale::Babelfish::Phrase::PluralForms (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | 6 | ▶ | use Locale::Babelfish::Phrase::PluralFormsParser (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | 6 | ▶ | use parent qw( Locale::Babelfish::Phrase::ParserBase ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | 6 | our $VERSION = '2.10'; # VERSION | |||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 6 | __PACKAGE__->mk_accessors( qw( locale mode pieces escape pf0 ) ); | |||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | use constant { | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 6 | LITERAL_MODE => 'Locale::Babelfish::Phrase::Literal', | |||||||||||||||||||||||||||||||||||||||||
| 22 | VARIABLE_MODE => 'Locale::Babelfish::Phrase::Variable', | ||||||||||||||||||||||||||||||||||||||||||
| 23 | PLURALS_MODE => 'Locale::Babelfish::Phrase::PluralForms', | ||||||||||||||||||||||||||||||||||||||||||
| 24 | VARIABLE_RE => qr/^[a-zA-Z0-9_\.]+$/, | ||||||||||||||||||||||||||||||||||||||||||
| 25 | 6 | ▶ | }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | sub new { | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 6 | ▶ | my ( $class, $phrase, $locale ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 6 | my $self = $class->SUPER::new( $phrase ); | |||||||||||||||||||||||||||||||||||||||||
| 31 | 6 | ▶ | $self->locale( $locale ) if $locale; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 32 | 6 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | sub init { | ||||||||||||||||||||||||||||||||||||||||||
| 37 | 95 | ▶ | my ( $self, $phrase ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | 95 | $self->SUPER::init( $phrase ); | |||||||||||||||||||||||||||||||||||||||||
| 39 | 95 | $self->mode( LITERAL_MODE ); | |||||||||||||||||||||||||||||||||||||||||
| 40 | 95 | $self->pieces( [] ); | |||||||||||||||||||||||||||||||||||||||||
| 41 | 95 | $self->pf0( undef ); # plural forms without name yet | |||||||||||||||||||||||||||||||||||||||||
| 42 | 95 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | sub finalize_mode { | ||||||||||||||||||||||||||||||||||||||||||
| 47 | 93 | ▶ | my ( $self ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
finalize_mode: called CC=7 SCAR=20.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 48 | 93 | ▶ | if ( $self->mode eq LITERAL_MODE ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 49 | 77 | push @{ $self->pieces }, LITERAL_MODE->new( text => $self->piece ) | |||||||||||||||||||||||||||||||||||||||||
| 50 | 88 | ▶ | if length($self->piece) || scalar(@{ $self->pieces }) == 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
length $self->piece or scalar @{$self->pieces;} == 0
MC/DC100%2/2
length $self->piece or scalar @{$self->pieces;} == 0
length $self->piece
scalar @{$self->pieces;} == 0
Truth table100%3/3
A or B
A= length $self->pieceB= scalar @{$self->pieces;} == 0
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||
| 52 | elsif ( $self->mode eq VARIABLE_MODE ) { | ||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | $self->throw( "Variable definition not ended with \"}\": ". $self->piece ); | |||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||
| 55 | elsif ( $self->mode eq PLURALS_MODE ) { | ||||||||||||||||||||||||||||||||||||||||||
| 56 | 5 | ▶ | $self->throw( "Plural forms definition not ended with \"))\": ". $self->piece ) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 57 | unless defined $self->pf0; | ||||||||||||||||||||||||||||||||||||||||||
| 58 | 5 | push @{ $self->pieces }, PLURALS_MODE->new( forms => $self->pf0, name => $self->piece, locale => $self->locale, ); | |||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||
| 60 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | $self->throw( "Logic broken, unknown parser mode: ". $self->mode ); | |||||||||||||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | sub parse { | ||||||||||||||||||||||||||||||||||||||||||
| 67 | 96 | ▶ | my ( $self, $phrase, $locale ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse: called CC=26 SCAR=32.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||
| 69 | 96 | $self->SUPER::parse( $phrase ); | |||||||||||||||||||||||||||||||||||||||||
| 70 | 95 | ▶ | $self->locale( $locale ) if $locale; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||
| 72 | 95 | my $plurals_parser = Locale::Babelfish::Phrase::PluralFormsParser->new(); | |||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||
| 74 | 95 | while ( 1 ) { | |||||||||||||||||||||||||||||||||||||||||
| 75 | 1500 | my $char = $self->to_next_char; | |||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||
| 77 | 1500 | ▶ | unless ( length $char ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 78 | 93 | $self->finalize_mode; | |||||||||||||||||||||||||||||||||||||||||
| 79 | 93 | return $self->pieces; | |||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||
| 82 | 1407 | ▶ | if ( $self->mode eq LITERAL_MODE ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 83 | 820 | ▶ | if ( $self->escape ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 84 | 8 | $self->add_to_piece( $char ); | |||||||||||||||||||||||||||||||||||||||||
| 85 | 8 | $self->escape(0); | |||||||||||||||||||||||||||||||||||||||||
| 86 | 8 | next; | |||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||
| 89 | 812 | ▶ | if ( $char eq "\\" ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 90 | 8 | $self->escape( 1 ); | |||||||||||||||||||||||||||||||||||||||||
| 91 | 8 | next; | |||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||
| 94 | 804 | ▶ | if ( $char eq '#' && $self->next_char eq '{' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$char eq "#" and $self->next_char eq "{"
MC/DC50%1/2
$char eq "#" and $self->next_char eq "{"
$char eq "#"
$self->next_char eq "{"
Truth table66%2/3
A and B
A= $char eq "#"B= $self->next_char eq "{"
| |||||||||||||||||||||||||||||||||||||||||||
| 95 | 28 | ▶ | if ( length $self->piece ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 96 | 24 | push @{ $self->pieces }, LITERAL_MODE->new( text => $self->piece ); | |||||||||||||||||||||||||||||||||||||||||
| 97 | 24 | $self->piece(''); | |||||||||||||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||||||||||||
| 99 | 28 | $self->to_next_char; # skip "{" | |||||||||||||||||||||||||||||||||||||||||
| 100 | 28 | $self->mode( VARIABLE_MODE ); | |||||||||||||||||||||||||||||||||||||||||
| 101 | 28 | next; | |||||||||||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | 776 | ▶ | if ( $char eq '(' && $self->next_char eq '(' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$char eq "(" and $self->next_char eq "("
MC/DC100%2/2
$char eq "(" and $self->next_char eq "("
$char eq "("
$self->next_char eq "("
Truth table100%3/3
A and B
A= $char eq "("B= $self->next_char eq "("
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | 17 | ▶ | if ( length $self->piece ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | 17 | push @{ $self->pieces }, LITERAL_MODE->new( text => $self->piece ); | |||||||||||||||||||||||||||||||||||||||||
| 107 | 17 | $self->piece(''); | |||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||
| 109 | 17 | $self->to_next_char; # skip second "(" | |||||||||||||||||||||||||||||||||||||||||
| 110 | 17 | $self->mode( PLURALS_MODE ); | |||||||||||||||||||||||||||||||||||||||||
| 111 | 17 | next; | |||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | 1346 | ▶ | if ( $self->mode eq VARIABLE_MODE ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 116 | 171 | ▶ | if ( $self->escape ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | $self->add_to_piece( $char ); | |||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | $self->escape(0); | |||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||
| 122 | 171 | ▶ | if ( $char eq "\\" ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | $self->escape( 1 ); | |||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||
| 127 | 171 | ▶ | if ( $char eq '}' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 128 | 28 | my $name = $self->trim( $self->piece ); | |||||||||||||||||||||||||||||||||||||||||
| 129 | 28 | ▶ | unless ( length $name ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 130 | 1 | $self->throw( "No variable name given." ); | |||||||||||||||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||||||||||||||||
| 132 | 27 | ▶ | if ( $name !~ VARIABLE_RE ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 1 | $self->throw( "Variable name doesn't meet conditions: $name." ); | |||||||||||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||||||||||
| 135 | 26 | push @{ $self->pieces }, VARIABLE_MODE->new( name => $name ); | |||||||||||||||||||||||||||||||||||||||||
| 136 | 26 | $self->piece(''); | |||||||||||||||||||||||||||||||||||||||||
| 137 | 26 | $self->mode( LITERAL_MODE ); | |||||||||||||||||||||||||||||||||||||||||
| 138 | 26 | next; | |||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||
| 142 | 1318 | ▶ | if ( $self->mode eq PLURALS_MODE ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 143 | 416 | ▶ | if ( defined $self->pf0 ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | 62 | ▶ | if ( $char =~ VARIABLE_RE && ($char ne '.' || $self->next_char =~ VARIABLE_RE) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$char =~ /^[a-zA-Z0-9_\.]+$/ and $char ne "." || $self->next_char =~ /^[a-zA-Z0-9_\.]+$/
$char ne "." or $self->next_char =~ /^[a-zA-Z0-9_\.]+$/
MC/DC66%2/3
$char =~ /^[a-zA-Z0-9_\.]+$/ and $char ne "." || $self->next_char =~ /^[a-zA-Z0-9_\.]+$/
$char =~ /^[a-zA-Z0-9_\.]+$/
$char ne "."
$self->next_char =~ /^[a-zA-Z0-9_\.]+$/
Truth table75%3/4
A and B or C
A= $char =~ /^[a-zA-Z0-9_\.]+$/B= $char ne "."C= $self->next_char =~ /^[a-zA-Z0-9_\.]+$/
| |||||||||||||||||||||||||||||||||||||||||||
| 145 | 54 | $self->add_to_piece( $char ); | |||||||||||||||||||||||||||||||||||||||||
| 146 | 54 | next; | |||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||
| 148 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 149 | 8 | push @{ $self->pieces }, PLURALS_MODE->new( forms => $self->pf0, name => $self->piece, locale => $self->locale, ); | |||||||||||||||||||||||||||||||||||||||||
| 150 | 8 | $self->pf0( undef ); | |||||||||||||||||||||||||||||||||||||||||
| 151 | 8 | $self->mode( LITERAL_MODE ); | |||||||||||||||||||||||||||||||||||||||||
| 152 | 8 | $self->piece(''); | |||||||||||||||||||||||||||||||||||||||||
| 153 | 8 | $self->backward; | |||||||||||||||||||||||||||||||||||||||||
| 154 | 8 | next; | |||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||
| 157 | 354 | ▶ | if ( $char eq ')' && $self->next_char eq ')' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$char eq ")" and $self->next_char eq ")"
MC/DC50%1/2
$char eq ")" and $self->next_char eq ")"
$char eq ")"
$self->next_char eq ")"
Truth table66%2/3
A and B
A= $char eq ")"B= $self->next_char eq ")"
| |||||||||||||||||||||||||||||||||||||||||||
| 158 | 17 | $self->pf0( $plurals_parser->parse( $self->piece ) ); | |||||||||||||||||||||||||||||||||||||||||
| 159 | 17 | $self->piece(''); | |||||||||||||||||||||||||||||||||||||||||
| 160 | 17 | $self->to_next_char; # skip second ")" | |||||||||||||||||||||||||||||||||||||||||
| 161 | 17 | ▶ | if ( $self->next_char eq ':' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 162 | 13 | $self->to_next_char; # skip ":" | |||||||||||||||||||||||||||||||||||||||||
| 163 | 13 | next; | |||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||
| 165 | 4 | push @{ $self->pieces }, PLURALS_MODE->new( forms => $self->pf0, name => 'count', locale => $self->locale, ); | |||||||||||||||||||||||||||||||||||||||||
| 166 | 4 | $self->pf0( undef ); | |||||||||||||||||||||||||||||||||||||||||
| 167 | 4 | $self->mode( LITERAL_MODE ); | |||||||||||||||||||||||||||||||||||||||||
| 168 | 4 | next; | |||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||||||||||
| 171 | 1239 | $self->add_to_piece( $char ); | |||||||||||||||||||||||||||||||||||||||||
| 172 | } # while ( 1 ) | ||||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||
| 175 | 6 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||
| 177 | __END__ | ||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||
| 179 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||
| 181 | =encoding UTF-8 | ||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||
| 183 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||
| 185 | Locale::Babelfish::Phrase::Parser - Babelfish syntax parser. | ||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||
| 187 | =head1 VERSION | ||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||
| 189 | version 2.10 | ||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||
| 191 | =head1 METHODS | ||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||
| 193 | =head2 new | ||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||
| 195 | $class->new() | ||||||||||||||||||||||||||||||||||||||||||
| 196 | $class->new( $phrase ) | ||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||
| 198 | Instantiates parser. | ||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||
| 200 | =head2 init | ||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||
| 202 | Initializes parser. Should not be called directly. | ||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||
| 204 | =head2 finalize_mode | ||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||
| 206 | Finalizes all operations after phrase end. | ||||||||||||||||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||||||||||||||||
| 208 | =head2 parse | ||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||
| 210 | $parser->parse() | ||||||||||||||||||||||||||||||||||||||||||
| 211 | $parser->parse( $phrase ) | ||||||||||||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||||||||||||
| 213 | Parses specified phrase. | ||||||||||||||||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||||||||||||||||
| 215 | =head1 AUTHORS | ||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||
| 217 | =over 4 | ||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||
| 219 | =item * | ||||||||||||||||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||||||||||||||||
| 221 | Akzhan Abdulin <akzhan@cpan.org> | ||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||
| 223 | =item * | ||||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||
| 225 | Igor Mironov <grif@cpan.org> | ||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||
| 227 | =item * | ||||||||||||||||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||||||||||||||||
| 229 | Victor Efimov <efimov@reg.ru> | ||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||
| 231 | =item * | ||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||
| 233 | REG.RU LLC | ||||||||||||||||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||||||||||||||||
| 235 | =item * | ||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||
| 237 | Kirill Sysoev <k.sysoev@me.com> | ||||||||||||||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||||||||||||
| 239 | =item * | ||||||||||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||||||||||
| 241 | Alexandr Tkach <tkach@reg.ru> | ||||||||||||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||||||||||||
| 243 | =back | ||||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||
| 245 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||
| 247 | This software is Copyright (c) 2014 by REG.RU LLC. | ||||||||||||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||||||||||||
| 249 | This is free software, licensed under: | ||||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||
| 251 | The MIT (X11) License | ||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||
| 253 | =cut | ||||||||||||||||||||||||||||||||||||||||||