| 1 | #!/usr/local/bin/perl | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | genericseq.pl - generates xml sequence diagrams from various inputs | ||
| 8 | |||
| 9 | =head1 USAGE | ||
| 10 | |||
| 11 | genericseq.pl -t 'Title' SeqModule [args_for_SeqModule...] | ||
| 12 | |||
| 13 | =head1 DESCRIPTION | ||
| 14 | |||
| 15 | Currently there are three sequencing modules you can use for SeqModule | ||
| 16 | above. They are | ||
| 17 | |||
| 18 | UML::Sequence::SimpleSeq | ||
| 19 | UML::Sequence::PerlSeq | ||
| 20 | UML::Sequence::JavaSeq | ||
| 21 | |||
| 22 | See the documentation in these modules for details on their arguments. | ||
| 23 | To write your own sequence helper, see UML::Sequence::SimpleSeq and | ||
| 24 | implement the same API. | ||
| 25 | |||
| 26 | =cut | ||
| 27 | |||
| 28 | use UML::Sequence; | ||
| 29 | use Getopt::Std; | ||
| 30 | |||
| 31 | my $usage = | ||
| 32 | "usage: $0 [-t 'Title for Diagram'] outline_style [outline_args...]\n"; | ||
| 33 | |||
| 34 | die $usage if (@ARGV < 1); | ||
| 35 | |||
| 36 | getopt('t'); | ||
| 37 | use vars qw($opt_t); | ||
| 38 | |||
| 39 | my $style = shift; | ||
| 40 | my $outline; | ||
| 41 | my $methods; | ||
| 42 | my $parse_method; | ||
| 43 | my $grab_methods; | ||
| 44 | |||
| 45 | { | ||
| 46 | no strict; | ||
| 47 | my $style_file = $style; | ||
| 48 | $style_file =~ s!::!/!g; | ||
| 49 | require "$style_file.pm"; | ||
| 50 | |||
| 51 | $outline = $style->grab_outline_text(@ARGV); | ||
| 52 | $methods = $style->grab_methods($outline); | ||
| 53 | $parse_method = $style->can(parse_signature); | ||
| 54 | $grab_methods = $style->can(grab_methods); | ||
| 55 | } | ||
| 56 | |||
| 57 | my $tree = UML::Sequence->new($methods, $outline, $parse_method, $grab_methods); | ||
| 58 | |||
| 59 | print($tree->build_xml_sequence($opt_t)); | ||
| 60 |