Overview
Context
Changes
Added mttroot/mtt/bin/trans/sympar2global_txt2lang version [afc066bc3b].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
# Bourne shell script: sympar2global_txt2lang
# Symbolic parameters to default paramers in computer language
# P.J.Gawthrop March 1997
# Copyright (c) P.J.Gawthrop, 1997.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
###############################################################
# Set up language stuff.
language=$2
case $language in
m)
ext='m'
Lc='#';
Rc='#';
;;
c)
ext='c'
Lc='/*';
Rc='*/';
;;
*)
echo Language $2 not supported - sorry; exit 1
esac
cat <<EOF
$Lc====== Set up the global variables ======$Rc
EOF
# Matlab bit
#Write out the variables in matlab global format
if [ "$language" = "m" ]; then
awk '
BEGIN{
var = "foobar";
print "global ..."
}
{i++; print tolower($1), "..."; var = $1}
END{
print var ";" # Repeat the last variable to avoid the trailing ...
}' $1_sympar.txt
fi
if [ "$language" = "c" ]; then
awk '{
i++; print "extern double", tolower($1) ";";
}' $1_sympar.txt
fi
echo
# Now invoke the standard error handling.
# mtt_error mtt_error.txt
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |