gmlpp 786 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/usr/local/bin/perl -n
  2. #
  3. # pp
  4. #
  5. # This script pretty prints a graph in graphlet format.
  6. #
  7. # Note: this script needs perl version 5.
  8. #
  9. #------------------------------------------
  10. #
  11. # $Source: /home/br/CVS/graphlet/bin/gmlpp,v $
  12. # $Author: himsolt $
  13. # $Revision: 1.1.1.1 $
  14. # $Date: 1998/08/27 17:19:00 $
  15. # $Locker: $
  16. # $State: Exp $
  17. #
  18. #------------------------------------------
  19. #
  20. # (C) University of Passau 1995-1996, Graphlet Project
  21. #
  22. #
  23. BEGIN {
  24. $Level = 0;
  25. $SpacePerLevel = 2;
  26. }
  27. $Blanks = $SpacePerLevel * $Level;
  28. if (/\]/) {
  29. $Level --;
  30. }
  31. if (!/^\s*$/) {
  32. print (" " x ($SpacePerLevel * $Level), $_);
  33. }
  34. if (/\[/) {
  35. $Level++;
  36. }
  37. # ;;; Local Variables: ***
  38. # ;;; tab-width: 4 ***
  39. # ;;; tab-stop-list: (4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72) ***
  40. # ;;; End: ***