File Coverage

File:/tmp/automake/lib/Automake/ItemDef.pm
Coverage:0.0%

linestmtbrancondsubpodtimecode
1# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
2
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 2, or (at your option)
6# any later version.
7
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12
13# You should have received a copy of the GNU General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16package Automake::ItemDef;
17use strict;
18use Carp;
19
20 - 43
=head1 NAME

Automake::ItemDef - base class for Automake::VarDef and Automake::RuleDef

=head1 DESCRIPTION

=head2 Methods

=over 4

=item C<my $def = Automake::new ($comment, $location, $owner)>

Create a new Makefile-item definition.

C<$comment> is any comment preceding the definition.  (Because
Automake reorders items in the output, it also tries to carry comments
around.)

C<$location> is the place where the definition occurred, it should be
an instance of L<Automake::Location>.

C<$owner> specifies who owns the rule.

=cut
44
45sub new ($$$$)
46{
47  my ($class, $comment, $location, $owner) = @_;
48
49  my $self = {
50    comment => $comment,
51    location => $location,
52    owner => $owner,
53  };
54  bless $self, $class;
55
56  return $self;
57}
58
59 - 68
=item C<$def-E<gt>comment>

=item C<$def-E<gt>location>

=item C<$def-E<gt>owner>

Accessors to the various constituents of an C<ItemDef>.  See the
documentation of C<new>'s arguments for a description of these.

=cut
69
70sub comment ($)
71{
72  my ($self) = @_;
73  return $self->{'comment'};
74}
75
76sub location ($)
77{
78  my ($self) = @_;
79  return $self->{'location'};
80}
81
82sub owner ($)
83{
84  my ($self) = @_;
85  return $self->{'owner'};
86}
87
88 - 92
=head1 SEE ALSO

L<Automake::VarDef>, and L<Automake::RuleDef>.

=cut
93
941;
95
96### Setup "GNU" style for perl-mode and cperl-mode.
97## Local Variables:
98## perl-indent-level: 2
99## perl-continued-statement-offset: 2
100## perl-continued-brace-offset: 0
101## perl-brace-offset: 0
102## perl-brace-imaginary-offset: 0
103## perl-label-offset: -2
104## cperl-indent-level: 2
105## cperl-brace-offset: 0
106## cperl-continued-brace-offset: 0
107## cperl-label-offset: -2
108## cperl-extra-newline-before-brace: t
109## cperl-merge-trailing-else: nil
110## cperl-continued-statement-offset: 2
111## End: