Differences From Artifact [bc8b4abfab]:

To Artifact [b8cecb2297]:


11
12
13
14
15
16
17



18
19
20
21
22
23
24
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+
+









# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% Revision 1.9  1998/07/30 15:07:17  peterg
# %% Added _ to the disallowed chars around t
# %%
# %% Revision 1.8  1998/07/30 12:52:38  peterg
# %% Adds ; to end of statements
# %% Translates ' to " before removal
# %%
# %% Revision 1.7  1998/07/30 09:32:33  peterg
# %% Replaces:
# %% 	euler by 1
86
87
88
89
90
91
92
93

94









95
96
97
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
89
90
91
92
93
94
95

96
97
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
129
130
131







-
+

+
+
+
+
+
+
+
+
+



-
-
+
+
+
+










-
-
-
-
-
-
-








quote = "\047";
doublequote = "\042";
}
{
  N=split($1,a,"=");
  if (N==2) {
    LHS = a[1];
    RHS = tolower(a[2]);
    RHS = a[2];
    gsub(quote, doublequote, RHS);
    sub(/^LAST/, "mttLAST", LHS);
    sub(/^DT/, "mttDT", LHS);
    sub(/^STEPFACTOR/, "mttSTEPFACTOR", LHS);
    sub(/^METHOD/, "mttMETHOD", LHS);
    sub(/^WMIN/, "mttWMIN", LHS);
    sub(/^WMAX/, "mttWMAX", LHS);
    sub(/^WSTEPS/, "mttWSTEPS", LHS);
    LHS = tolower(LHS);
    RHS = tolower(RHS);
    sub(/["]*euler["]*/, 1, RHS);   
    sub(/["]*implicitl["]*/, 2, RHS);   
    sub(/["]*implicit["]*/, 3, RHS);  
    statement = sprintf("%s=%s",LHS,RHS);
    if (match(statement,";")==0)
    statement = sprintf("%s= %s",LHS,RHS);
    if ( (match(statement,";")==0)&&\
         ((match(statement,"if ")==0))&&\
         ((match(statement,"for ")==0)) )
      statement = sprintf("%s;", statement);
  }
  else
    statement = $1;

  if (NF<2) print statement
  if (NF>1)  print statement " # " $2
}' | sed\
     -e 's/\[\([0-9]*\)\]/(\1)/g' \
     -e 's/\([^a-zA-Z_]\)t\([^a-zA-Z_]\)/\1mttt\2/g' \
     -e 's/LAST/mttLAST/g' \
     -e 's/DT/mttDT/g' \
     -e 's/STEPFACTOR/mttSTEPFACTOR/g' \
     -e 's/METHOD/mttMETHOD/g' \
     -e 's/WMIN/mttWMIN/g' \
     -e 's/WMAX/mttWMAX/g' \
     -e 's/WSTEPS/mttWSTEPS/g' \
     -e 's/x(/mttx(/g' \
     -e 's/u(/mttu(/g' \
     -e 's/mttmtt/mtt/g' \
>> $1_$2.m





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