Differences From Artifact [c4b66df764]:

To Artifact [1eb6f99853]:


12
13
14
15
16
17
18




19
20
21
22
23
24
25
# Copyright (c) P.J.Gawthrop 1991, 1994, 1995, 1996, 1998

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




## Revision 1.19  2000/08/28 20:17:59  peterg
## Put in Winfried Neun's bug fix
## -- prevents segmentation violation using optimised gentran when matrix
## comtains a number
##
## Revision 1.18  2000/08/24 17:11:40  peterg
## Now optimises as well as segmenting - uses the SCOPE package







>
>
>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copyright (c) P.J.Gawthrop 1991, 1994, 1995, 1996, 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.20  2000/08/30 10:43:17  peterg
## Simplified version using GENTRAN matrix :=: matrix
## lang_matrix is no longer used at all
##
## Revision 1.19  2000/08/28 20:17:59  peterg
## Put in Winfried Neun's bug fix
## -- prevents segmentation violation using optimised gentran when matrix
## comtains a number
##
## Revision 1.18  2000/08/24 17:11:40  peterg
## Now optimises as well as segmenting - uses the SCOPE package
85
86
87
88
89
90
91





92
93
94
95
96
97
98
    -noglobals)
	noglobals='-noglobals';
	;;
    -parameters)
	parameters='-parameters';
        par='mttpar'
	;;





    *)
	echo $1 is an unknown option
        exit;;
  esac
  shift
done








>
>
>
>
>







89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
    -noglobals)
	noglobals='-noglobals';
	;;
    -parameters)
	parameters='-parameters';
        par='mttpar'
	;;
    -optimise)
	optimise='LOAD SCOPE; ON GENTRANOPT;';
        iname='INAME mtt_o;';
	;;

    *)
	echo $1 is an unknown option
        exit;;
  esac
  shift
done

112
113
114
115
116
117
118
119
120
121

122
123
124
125
126
127
128
129
130


131
132
133
134
135
136
137

#Set up gentran
cat <<EOF >mtt_setreduce.r
% Set up the code generator

% Load the general translator package
LOAD GENTRAN;
LOAD SCOPE;
GENTRANLANG!* := '$codegenerator;
ON GENTRANSEG; % Segmentation

ON GENTRANOPT; % Code optimise using scope

ON GETDECS;    % Create decrarations automatically
DEFTYPE!* := 'REAL; % and default to real
OFF GENDECS;  % No declarations
MAXEXPPRINTLEN!* := 80;
TEMPVARNUM!* := 1;
TEMPVARNAME!* := 'mtt_s;
INAME(mtt_o);


% Matrix output function
%in"$MTTPATH/trans/lang_matrix.r";

%Read the reduce definitions file
in "$1_def.r";

%Read the reduce  $REP   file







<
|
|
>
|


|



|
|
>
>







121
122
123
124
125
126
127

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148

#Set up gentran
cat <<EOF >mtt_setreduce.r
% Set up the code generator

% Load the general translator package
LOAD GENTRAN;

GENTRANLANG!* := '$codegenerator; %'
ON GENTRANSEG; % Segmentation 
% Optimise
$optimise 

ON GETDECS;    % Create decrarations automatically
DEFTYPE!* := 'REAL; % and default to real '
OFF GENDECS;  % No declarations
MAXEXPPRINTLEN!* := 80;
TEMPVARNUM!* := 1;
TEMPVARNAME!* := 'mtt_s; % '

$iname

% Matrix output function
%in"$MTTPATH/trans/lang_matrix.r";

%Read the reduce definitions file
in "$1_def.r";

%Read the reduce  $REP   file
156
157
158
159
160
161
162



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
%%%%%% End of bug fix


END;
EOF

#Inform user



echo Creating $outfile.m



# Remove the old log file
rm -f mtt_r2m.log


if [ "$rep" = "ode" ]||[ "$rep" = "cse" ]; then
  #echo Creating $1_odea.$ext
  outfileo=$outfile"o"
  echo Creating $outfileo.m

  #rm -f $1_odea.$ext.1;

  #Header
  lang_header $noglobals $parameters $1 $rep $ext 'mttx,mttu,mttt,mttpar' mttdx > $1_$2.pas
  lang_header $noglobals $parameters $1 $2o $ext 'mttx,mttu,mttt,mttpar' mtty  > $1_$2o.pas








>
>
>
|










|







167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
%%%%%% End of bug fix


END;
EOF

#Inform user
if [ -n "$optimise" ]; then
    blurb=' using code optimisation'
fi
echo Creating $outfile.m $blurb



# Remove the old log file
rm -f mtt_r2m.log


if [ "$rep" = "ode" ]||[ "$rep" = "cse" ]; then
  #echo Creating $1_odea.$ext
  outfileo=$outfile"o"
  echo Creating $outfileo.m $blurb

  #rm -f $1_odea.$ext.1;

  #Header
  lang_header $noglobals $parameters $1 $rep $ext 'mttx,mttu,mttt,mttpar' mttdx > $1_$2.pas
  lang_header $noglobals $parameters $1 $2o $ext 'mttx,mttu,mttt,mttpar' mtty  > $1_$2o.pas


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