"Fossies" - the Fresh Open Source Software Archive

Member "automake-1.16.3/lib/Automake/ItemDef.pm" (19 Nov 2020, 2006 Bytes) of package /linux/misc/automake-1.16.3.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ItemDef.pm" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.16.2_vs_1.16.3.

    1 # Copyright (C) 2003-2020 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 <https://www.gnu.org/licenses/>.
   15 
   16 package Automake::ItemDef;
   17 
   18 use 5.006;
   19 use strict;
   20 use warnings FATAL => 'all';
   21 
   22 use Carp;
   23 
   24 =head1 NAME
   25 
   26 Automake::ItemDef - base class for Automake::VarDef and Automake::RuleDef
   27 
   28 =head1 DESCRIPTION
   29 
   30 =head2 Methods
   31 
   32 =over 4
   33 
   34 =item C<my $def = Automake::new ($comment, $location, $owner)>
   35 
   36 Create a new Makefile-item definition.
   37 
   38 C<$comment> is any comment preceding the definition.  (Because
   39 Automake reorders items in the output, it also tries to carry comments
   40 around.)
   41 
   42 C<$location> is the place where the definition occurred, it should be
   43 an instance of L<Automake::Location>.
   44 
   45 C<$owner> specifies who owns the rule.
   46 
   47 =cut
   48 
   49 sub new ($$$$)
   50 {
   51   my ($class, $comment, $location, $owner) = @_;
   52 
   53   my $self = {
   54     comment => $comment,
   55     location => $location,
   56     owner => $owner,
   57   };
   58   bless $self, $class;
   59 
   60   return $self;
   61 }
   62 
   63 =item C<$def-E<gt>comment>
   64 
   65 =item C<$def-E<gt>location>
   66 
   67 =item C<$def-E<gt>owner>
   68 
   69 Accessors to the various constituents of an C<ItemDef>.  See the
   70 documentation of C<new>'s arguments for a description of these.
   71 
   72 =cut
   73 
   74 sub comment ($)
   75 {
   76   my ($self) = @_;
   77   return $self->{'comment'};
   78 }
   79 
   80 sub location ($)
   81 {
   82   my ($self) = @_;
   83   return $self->{'location'};
   84 }
   85 
   86 sub owner ($)
   87 {
   88   my ($self) = @_;
   89   return $self->{'owner'};
   90 }
   91 
   92 =head1 SEE ALSO
   93 
   94 L<Automake::VarDef>, and L<Automake::RuleDef>.
   95 
   96 =cut
   97 
   98 1;