line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SQL::Abstract::FromQuery::FR;
|
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
1648
|
use strict;
|
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
82
|
|
4
|
3
|
|
|
3
|
|
14
|
use warnings;
|
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
74
|
|
5
|
3
|
|
|
3
|
|
15
|
use parent 'SQL::Abstract::FromQuery';
|
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
20
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=encoding latin1
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=cut
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# redefine rules 'null' and 'bool' from the root grammar
|
13
|
|
|
|
|
|
|
{
|
14
|
3
|
|
|
3
|
|
198
|
use Regexp::Grammars;
|
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
19
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
return qr{
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
NULL?
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
| ENTRE (*COMMIT) (?: ET | )
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
O(?:UI)? (?{ $MATCH = 1 })
|
31
|
|
|
|
|
|
|
| V(?:RAI)? (?{ $MATCH = 1 })
|
32
|
|
|
|
|
|
|
| NO?N? (?{ $MATCH = 0 })
|
33
|
|
|
|
|
|
|
| F(?:AUX|ALSE)? (?{ $MATCH = 0 })
|
34
|
|
|
|
|
|
|
| Y(?:ES)? (?{ $MATCH = 1 })
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
}xms;
|
37
|
|
|
|
|
|
|
};
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
#======================================================================
|
41
|
|
|
|
|
|
|
# CLASS METHODS
|
42
|
|
|
|
|
|
|
#======================================================================
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub sub_grammar {
|
45
|
3
|
|
|
3
|
0
|
7
|
my $class = shift;
|
46
|
3
|
|
|
|
|
10
|
return ('SQL::Abstract::FromQuery::FR');
|
47
|
|
|
|
|
|
|
}
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub _error_handler {
|
51
|
3
|
|
|
3
|
|
8
|
my $class = shift;
|
52
|
|
|
|
|
|
|
return 'SAISIE INCORRECTE', sub {
|
53
|
3
|
|
|
3
|
|
31
|
my ($error, $rule, $context) = @_;
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
my $msg = {
|
56
|
|
|
|
|
|
|
negated_values => 'Aucune valeur après la négation',
|
57
|
|
|
|
|
|
|
op_and_value => "Aucune valeur après l'opérateur de comparaison",
|
58
|
|
|
|
|
|
|
between => 'Pas de valeurs min/max après "ENTRE/BETWEEN"',
|
59
|
|
|
|
|
|
|
standard => 'Texte inattendu après la valeur initiale',
|
60
|
3
|
|
|
|
|
16
|
}->{$rule};
|
61
|
3
|
|
33
|
|
|
12
|
$msg //= "Impossible d'appliquer la règle '$rule'";
|
62
|
3
|
50
|
|
|
|
7
|
$msg .= " ('$context')" if $context;
|
63
|
3
|
|
|
|
|
12
|
return $msg;
|
64
|
3
|
|
|
|
|
23
|
};
|
65
|
|
|
|
|
|
|
}
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
#======================================================================
|
68
|
|
|
|
|
|
|
# ACTIONS HOOKED TO THE GRAMMAR
|
69
|
|
|
|
|
|
|
#======================================================================
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub between {
|
72
|
3
|
|
|
3
|
0
|
89
|
my ($self, $h) = @_;
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
return
|
75
|
|
|
|
|
|
|
# if parent method was already invoked through grammar inheritance
|
76
|
3
|
|
66
|
|
|
17
|
$h->{'SQL::Abstract::FromQuery::between'}
|
77
|
|
|
|
|
|
|
# otherwise, call parent explicitly with data from the present grammar
|
78
|
|
|
|
|
|
|
|| $self->next::method($h);
|
79
|
|
|
|
|
|
|
}
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
#======================================================================
|
83
|
|
|
|
|
|
|
1; # End of SQL::Abstract::FromQuery::FR
|
84
|
|
|
|
|
|
|
#======================================================================
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
__END__
|