| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Copyright 2011-2012 Yuki Izumi. ( anneli AT cpan DOT org ) |
|
2
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under the |
|
3
|
|
|
|
|
|
|
# same terms as Perl itself. |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Erlang::Parser::Node::BinaryExpr; |
|
6
|
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
11
|
use Moose; |
|
|
3
|
|
|
|
|
3
|
|
|
|
3
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
|
|
with 'Erlang::Parser::Node'; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'output' => (is => 'rw', required => 1, isa => 'Erlang::Parser::Node'); |
|
11
|
|
|
|
|
|
|
has 'size' => (is => 'rw', required => 0, isa => 'Maybe[Erlang::Parser::Node]'); |
|
12
|
|
|
|
|
|
|
has 'qualifier' => (is => 'rw', required => 0, isa => 'Maybe[Str]'); |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub print { |
|
15
|
3270
|
|
|
3270
|
1
|
3242
|
my ($self, $fh, $depth) = @_; |
|
16
|
3270
|
|
100
|
|
|
4338
|
$depth ||= 0; |
|
17
|
|
|
|
|
|
|
|
|
18
|
3270
|
|
|
|
|
3493
|
print $fh '('; |
|
19
|
3270
|
|
|
|
|
79359
|
$self->output->print($fh, $depth); |
|
20
|
3270
|
|
|
|
|
3100
|
print $fh ')'; |
|
21
|
3270
|
100
|
|
|
|
78122
|
if (defined $self->size) { |
|
22
|
500
|
|
|
|
|
537
|
print $fh ':'; |
|
23
|
500
|
|
|
|
|
11527
|
$self->size->print($fh, $depth); |
|
24
|
|
|
|
|
|
|
} |
|
25
|
3270
|
100
|
|
|
|
79022
|
print $fh '/', $self->qualifier if defined $self->qualifier; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 NAME |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Erlang::Parser::Node::BinaryExpr - a term within a binary term |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Any expression that can be part of the body of a binary list or string. |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 Accessors |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=over 4 |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=item C<output> |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
The L<Erlang::Parser::Node> which provides the output for this term. |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=item C<size> |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
A L<Erlang::Parser::Node> which specifies the length (in bits) of this term, |
|
49
|
|
|
|
|
|
|
or C<undef>. |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item C<qualifier> |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Qualifiers that specify how this term is to be output in string form, or |
|
54
|
|
|
|
|
|
|
C<undef>. |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=back |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 Methods |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=over 4 |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=item C<print> |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Pretty-prints the node to its filehandle argument. |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=back |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 EXAMPLE |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
X:8/integer-signed-big |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# vim: set sw=4 ts=4: |