#!/usr/bin/perl

use strict;
use diagnostics;

while (<STDIN>) {
  my $line = $_;
  if ($line =~ /^newCmd\((.*)\)/) {
    my @entries = split(/,/, $1);
    if (scalar(@entries) == 8) {
      for (my $i = 0; $i < scalar(@entries); $i++) {
        $entries[$i] =~ s/'//g;
      }
      my $flag = $entries[2];
      if ($flag ne "x") {
        print "<command>\n";
        print "  <name>" . $entries[0] . "</name>\n"
          if (length($entries[0]) > 0);
        print "  <div class=\"description\">" . $entries[3] . "</div>\n"
          if (length($entries[3]) > 0);
        print "  <paramRequirements>" . $entries[4] . "</paramRequirements>\n"
          if (length($entries[4]) > 0);
        for (my $j = 5; $j < scalar(@entries); $j++) {
          print "  <param>" . $entries[$j] . "</param>\n"
            if (length($entries[$j]) > 0);
        }
        print "</command>\n";
      } # skip xrefs
    }
  }
}