Prefer https: URLs
[automake.git] / lib / Automake / ItemDef.pm
bloba01b3c1fc5643ac3adb6de3cd0a4da790d33dadc
1 # Copyright (C) 2003-2017 Free Software Foundation, Inc.
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.
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.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 package Automake::ItemDef;
18 use 5.006;
19 use strict;
20 use Carp;
22 =head1 NAME
24 Automake::ItemDef - base class for Automake::VarDef and Automake::RuleDef
26 =head1 DESCRIPTION
28 =head2 Methods
30 =over 4
32 =item C<my $def = Automake::new ($comment, $location, $owner)>
34 Create a new Makefile-item definition.
36 C<$comment> is any comment preceding the definition. (Because
37 Automake reorders items in the output, it also tries to carry comments
38 around.)
40 C<$location> is the place where the definition occurred, it should be
41 an instance of L<Automake::Location>.
43 C<$owner> specifies who owns the rule.
45 =cut
47 sub new ($$$$)
49 my ($class, $comment, $location, $owner) = @_;
51 my $self = {
52 comment => $comment,
53 location => $location,
54 owner => $owner,
56 bless $self, $class;
58 return $self;
61 =item C<$def-E<gt>comment>
63 =item C<$def-E<gt>location>
65 =item C<$def-E<gt>owner>
67 Accessors to the various constituents of an C<ItemDef>. See the
68 documentation of C<new>'s arguments for a description of these.
70 =cut
72 sub comment ($)
74 my ($self) = @_;
75 return $self->{'comment'};
78 sub location ($)
80 my ($self) = @_;
81 return $self->{'location'};
84 sub owner ($)
86 my ($self) = @_;
87 return $self->{'owner'};
90 =head1 SEE ALSO
92 L<Automake::VarDef>, and L<Automake::RuleDef>.
94 =cut
98 ### Setup "GNU" style for perl-mode and cperl-mode.
99 ## Local Variables:
100 ## perl-indent-level: 2
101 ## perl-continued-statement-offset: 2
102 ## perl-continued-brace-offset: 0
103 ## perl-brace-offset: 0
104 ## perl-brace-imaginary-offset: 0
105 ## perl-label-offset: -2
106 ## cperl-indent-level: 2
107 ## cperl-brace-offset: 0
108 ## cperl-continued-brace-offset: 0
109 ## cperl-label-offset: -2
110 ## cperl-extra-newline-before-brace: t
111 ## cperl-merge-trailing-else: nil
112 ## cperl-continued-statement-offset: 2
113 ## End: