10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# Copyright (c) P.J.Gawthrop 1998
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.10 2000/12/28 12:32:06 peterg
## Put under RCS
##
## Revision 1.9 2000/11/16 13:11:06 peterg
## Included PAR and UNITS declarations
##
## Revision 1.8 1999/02/17 21:42:19 peterg
|
>
>
>
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# Copyright (c) P.J.Gawthrop 1998
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.11 2002/04/19 08:39:45 gawthrop
## Changed \# to # and \% to # to avoid warning in latest gawk version
##
## Revision 1.10 2000/12/28 12:32:06 peterg
## Put under RCS
##
## Revision 1.9 2000/11/16 13:11:06 peterg
## Included PAR and UNITS declarations
##
## Revision 1.8 1999/02/17 21:42:19 peterg
|
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
#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 '{
printf("\\paragraph{System %s:",$2);
for (i=3;i<=NF;i++) printf("%s ",$i); print ""
print "}"
}' >> $1_lbl.tex
grep '[%|#]DESCRIPTION' $1_lbl.txt | sed 's/_/\\_/g' |\
awk '{
for (i=2;i<=NF;i++) printf("%s ",$i); print ""
}' >> $1_lbl.tex
#Write out the aliases
cat <<EOF >> $1_lbl.tex
\paragraph{Interface information:}
\begin{description}
EOF
grep '[%|#]ALIAS' $1_lbl.txt | sed 's/_/\\_/g' |\
awk '{
N=split($2,a,"|");
for (i=1;i<=N;i++){
if (match(a[i],"\\$")>0){
printf("\\item [Parameter \\%s] represents actual parameter ",a[i])
}
else if (match($3,"/")>0){
printf("\\item [Component %s] is in library ",a[i])
|
|
|
|
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
#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' |\
gawk '{
printf("\\paragraph{System %s:",$2);
for (i=3;i<=NF;i++) printf("%s ",$i); print ""
print "}"
}' >> $1_lbl.tex
grep '[%|#]DESCRIPTION' $1_lbl.txt | sed 's/_/\\_/g' |\
gawk '{
for (i=2;i<=NF;i++) printf("%s ",$i); print ""
}' >> $1_lbl.tex
#Write out the aliases
cat <<EOF >> $1_lbl.tex
\paragraph{Interface information:}
\begin{description}
EOF
grep '[%|#]ALIAS' $1_lbl.txt | sed 's/_/\\_/g' |\
gawk '{
N=split($2,a,"|");
for (i=1;i<=N;i++){
if (match(a[i],"\\$")>0){
printf("\\item [Parameter \\%s] represents actual parameter ",a[i])
}
else if (match($3,"/")>0){
printf("\\item [Component %s] is in library ",a[i])
|
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
#Write out the VARS
cat <<EOF >> $1_lbl.tex
\paragraph{Variable declarations:}
\begin{description}
EOF
grep '[%|#][V|P]AR' $1_lbl.txt | sed 's/_/\\_/g' |\
awk '{
printf("\\item %s\n",$2)
}
END{if (NR==0) print "\\item This component has no PAR declarations"
}' | sort >> $1_lbl.tex
cat <<EOF >> $1_lbl.tex
\end{description}
EOF
#Write out the UNITS
cat <<EOF >> $1_lbl.tex
\paragraph{Units declarations:}
\begin{description}
EOF
grep '[%|#]UNITS' $1_lbl.txt | sed 's/_/\\_/g' |\
awk '{
printf("\\item [Port %s] has domain %s\n",$2, $3)
printf("\\begin{description}\n")
printf("\\item [Effort units] %s\n",$4)
printf("\\item [Flow units] %s\n",$5)
printf("\\end{description}\n")
}
END{if (NR==0) print "\\item This component has no UNITs declarations"
|
|
|
|
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
#Write out the VARS
cat <<EOF >> $1_lbl.tex
\paragraph{Variable declarations:}
\begin{description}
EOF
grep '[%|#][V|P]AR' $1_lbl.txt | sed 's/_/\\_/g' |\
gawk '{
printf("\\item %s\n",$2)
}
END{if (NR==0) print "\\item This component has no PAR declarations"
}' | sort >> $1_lbl.tex
cat <<EOF >> $1_lbl.tex
\end{description}
EOF
#Write out the UNITS
cat <<EOF >> $1_lbl.tex
\paragraph{Units declarations:}
\begin{description}
EOF
grep '[%|#]UNITS' $1_lbl.txt | sed 's/_/\\_/g' |\
gawk '{
printf("\\item [Port %s] has domain %s\n",$2, $3)
printf("\\begin{description}\n")
printf("\\item [Effort units] %s\n",$4)
printf("\\item [Flow units] %s\n",$5)
printf("\\end{description}\n")
}
END{if (NR==0) print "\\item This component has no UNITs declarations"
|