PageRenderTime 32ms CodeModel.GetById 21ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/libs/perl/Choicetool/Rules/Not.pm

#
Perl | 70 lines | 33 code | 17 blank | 20 comment | 0 complexity | b9089866c2671d22ce2af6040631f854 MD5 | raw file
 1# -*- perl -*-
 2
 3#
 4# Not.pm
 5#
 6# Copyright (C) 2008, 2009 Francesco Salvestrini
 7#
 8# This program is free software; you can redistribute it and/or modify
 9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License along
19# with this program; if not, write to the Free Software Foundation, Inc.,
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21#
22
23package Choicetool::Rules::Not;
24
25use 5.8.0;
26
27use warnings;
28use strict;
29use diagnostics;
30
31use Choicetool::Base::Debug;
32use Choicetool::Base::Trace;
33
34use base qw(UnaryOp);
35
36sub dump ($)
37{
38    my $self = shift;
39
40    assert(defined($self));
41
42    print "! " . $self->operand()->dump();
43}
44
45
46sub m4ify_header ($$)
47{
48    my $self   = shift;
49    my $prefix = shift;
50
51    assert(defined($self));
52    assert(defined($prefix));
53    assert(defined($self->id()));
54
55    return $prefix . "\n";
56}
57
58sub m4ify_footer ($$)
59{
60    my $self   = shift;
61    my $prefix = shift;
62
63    assert(defined($self));
64    assert(defined($prefix));
65    assert(defined($self->id()));
66
67    return $prefix . "\n";
68}
69
701;