Artifact a1533381147fb0af6be53e996b269178c013061b6d15a73965ca157c1bfe03bf:


#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: lbl_txt2tex
# Latex summary of the lbl file

# Copyright (c) P.J.Gawthrop 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
###############################################################


# Inform user
echo Creating $1_lbl.tex

#Create the alias file complete with headers.
echo "% Label summary file ($1_lbl.tex)" > $1_lbl.tex
echo "% Generated by MTT at `date`" >> $1_lbl.tex

#Write out the Description
    grep '[%|#]SUMMARY' $1_lbl.txt | sed 's/_/\\_/g'  |\
    awk '{
           print "\\paragraph{System " $2 ":"
           for (i=3;i<=NF;i++) print $i " ";
           print  "}"
         }' >> $1_lbl.tex
    grep '[%|#]DESCRIPTION' $1_lbl.txt | sed 's/_/\\_/g'  |\
    awk '{
           for (i=2;i<=NF;i++) print $i " ";
         }' >> $1_lbl.tex

#Write out the aliases
cat <<EOF >> $1_lbl.tex
\begin{description}
EOF
    grep '[%|#]ALIAS' $1_lbl.txt | sed 's/_/\\_/g' |\
    awk '{
      if (match($2,"\\$")>0){
        print "\\item [Parameter \\" $2 "] represents " $3
      }
      else{
        print "\\item [Port " $2 "] represents actual port " $3 "" 
      }
     }
    END{if (NR==0) print "\\item This component has no aliases"
}'  | sort >> $1_lbl.tex
cat <<EOF >> $1_lbl.tex
\end{description}
EOF












MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]