PageRenderTime 35ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

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

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