On Mon, Jan 14, 2002 at 10:54:28PM -0500, Ronald J Kimball wrote:
> #!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__

P.S.  As demonstrated by Schwern's solution, my second substitution on
$b[2] is, of course, unnecessary.

#!perl -nl
s/^ ?-- ?//;push@a,[s/:$//?"--== $_ ==--":/^ *(\S+)\s+(\S+)\s*(\S*)/];
$;=$:if($:=length$1)>$;}{*b=$_,$#b?($b[2]=~s/.+/_vector($& downto 0)/,
printf"%-$;s : %s std_logic%s;\n",@b):print@b for@a

__END__

Ronald

Reply via email to