On Mon, Jan 14, 2002 at 07:32:15PM -0500, Aaron D. Marasco wrote:
>
> Please explain if you are doing anything "complicated" so we can all learn.
> ;)
Well, that's no fun! ;)
> The double hyphen in front of the incoming text is optional and could have
> spaces on either side of it. The spaces between "fields" is arbitrary (but
> never tabs). The signal fields always have at least one space on the left,
Is that in addition to the space after the double hyphen?
> and the comments always have the colon at the end (makes script a lot
> simpler).
Are there any kinds of lines besides comments and signal fields?
> The overall length of the script is the most important, speed is
> no concern. Lines are limited to 78 characters too. :(
Four lines:
#!perl -nl
s/^ ?-- ?//;push@a,[s/:$//?"--== $_ ==--":/^ *(\S+)\s+(\S+)\s*(\S*)/];
$;=$:if($:=length$1)>$;}{*b=$_,$#b?($b[2]=~s/.+/_vector($& downto 0)/,
$b[2]=~s/^/ std_logic/,printf"%-$;s : %s%s;\n",@b):print@b for@a
__END__
Ronald