#!/usr/bin/env perl
# -*- perl -*-

#
# Author: Slaven Rezic
#
# Copyright (C) 1999,2018 Slaven Rezic. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
# Mail: slaven@rezic.de
# WWW:  http://bbbike.de
#

while(<STDIN>) {
    s/^\.if\s+defined\(([^\)]+)\)/.IF "\${$1}" != ""/;
    s/^\.if(\s+)/.IF$1/;
    s/^\.else(\s+)/.ELSE$1/;
    s/^\.endif(\s+)/.ENDIF$1/;
    print;
}

__END__
