#!/usr/local/bin/perl # -*-perl-*- # # prMunge takes a CPP processed promela file and breaks it into # separate lines and removes a lot of white space. # # ie: # if :: (1) -> skip; :: (2) -> skip; fi; # will become: # if # :: (1) -> # skip; # :: (2) -> # skip; # fi; # # This makes debugging *much* simpler because line numbers actually # mean something. # # This is in the public domain, you are merely a jerk if you # don't include this notice in a derived work. # while (<>) { s/\s*(;|->)/\1\n/g; #s/(::)/\n\1/g; s/\n\s*\n/\n/g; s/(\S)[ \t\r\f]+/\1 /g; print unless /^\s*\n$/; }