/usr/share/perl5/ExtUtils/XSpp/Node.pm is in libextutils-xspp-perl 0.1800-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | package ExtUtils::XSpp::Node;
use strict;
use warnings;
use Carp ();
=head1 NAME
ExtUtils::XSpp::Node - Base class for elements of the parser output
=head1 DESCRIPTION
ExtUtils::XSpp::Node is a base class for all elements of the
parser's output.
=head1 METHODS
=head2 new
Calls the C<$self->init(@_)> method after construction.
Override C<init()> in subclasses.
=cut
sub new {
my $class = shift;
my $this = bless {}, $class;
$this->init( @_ );
return $this;
}
=head2 init
Called by the constructor. Every sub-class needs to override this.
=cut
sub init {
Carp::croak(
"Programmer was too lazy to implement init() in her Node sub-class"
);
}
=head2 ExtUtils::XSpp::Node::print
Return a string to be output in the final XS file.
Every sub-class must override this method.
=cut
sub print {
Carp::croak(
"Programmer was too lazy to implement print() in her Node sub-class"
);
}
sub condition { $_[0]->{CONDITION} }
sub condition_expression {
my $this = shift;
return $this->emit_condition if $this->emit_condition;
return 'defined( ' . $this->condition . ' )' if $this->condition;
return '1';
}
sub emit_condition { $_[0]->{EMIT_CONDITION} }
1;
|