Overview
Comment:Initial revision
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 980c4b25e6d41993bb84dfe954a7406b3198d7a929cc30fccf8bbd6b4dd35b54
User & Date: gawthrop@users.sourceforge.net on 1999-11-07 06:43:20
Other Links: branch diff | manifest | tags
Context
1999-11-09
22:32:41
Under RCS ready for using arrays to contaain defaults. check-in: 51995a8d73 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1999-11-07
06:43:20
Initial revision check-in: 980c4b25e6 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1999-11-04
04:54:24
Removed recreation of smx file. check-in: 8c9b3e5410 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/bin/trans/cse2smx_lang version [0fb70f9e53].

























































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108

# Language
if [ -n "$2" ]; then
    lang=$2
else
    lang="r"
fi


# Inform user
echo Creating $1_smx.$lang
#echo Creating $1_smxx.$lang
#echo Creating $1_smxtx.$lang

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

rm -f $1_smx.$lang
rm -f $1_smxx.$lang
rm -f $1_smxtx.$lang

# Use reduce to accomplish the transformation
reduce << EOF  >cse2smx_lang.log

lang := $lang;

in "$1_subs.r";
in "$1_def.r";
in "$1_cse.r";
in "$1_cr.r";

clear mttx; % Dont need this now - use mkid instead

OFF Echo;

% Load the general translator package
LOAD GENTRAN;
GENTRANLANG!* := 'Pascal;
ON GENTRANSEG;
MAXEXPPRINTLEN!* := 80;
TEMPVARNUM!* := 1;
TEMPVARNAME!* := 'mtt_t;

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


%Set up output according to the language.
 OFF NAT;
 GENTRANOUT "$1_smx.$lang";

% Set up output according to the language.
    IF (lang = r) THEN 
    BEGIN
      write "matrix mtta(", mttnx, ",", mttnx, ");";    
      write "matrix mttb(", mttnx, ",", mttnu, ");";    
      write "matrix mttc(", mttny, ",", mttnx, ");";    
      write "matrix mttd(", mttny, ",", mttnu, ");";    
    END;

% find MTTA : the A matrix
  FOR i := 1:MTTNx DO
  BEGIN
    mttAAx_i := 0;
    FOR j := 1:MTTNx DO
    BEGIN
      xj := mkid(mttx,j);
      a_ij := df(MTTEdx(i,1), xj, 1);
      aa_ij := MTTE(i,j) - mttdt*a_ij;
      IF (aa_ij NEQ 0) THEN
        GENTRAN mtta(i,j) ::=: aa_ij;
        mttAAx_i := mttAAx_i + aa_ij*xj;
      END;
      IF (mttAAx_i NEQ 0) THEN
        GENTRAN mttax(i) ::=: mttAAx_i;
  END;

%Shut the  output according to the language.
 GENTRANSHUT "$1_smx.$lang";


EOF

if [ "$lang" = "m" ]; then
  mv $1_smx.$lang  mtt_junk
  lang_header $1 smx m 'mttx,mttu,mttdt' '[mtta,mttax]' > $1_smx.m
  cat mtt_junk | mtt_p2m >> $1_smx.m
  rm -f mtt_junk

#  mv $1_smxx.$lang  mtt_junk
#  lang_header $1 smxx m 'mttx,mttu,mttxx,mttdt' '[mttax]' > $1_smxx.m
#  cat mtt_junk | mtt_p2m >> $1_smxx.m
#  rm -f mtt_junk
#
#  mv $1_smxtx.$lang  mtt_junk
#  lang_header $1 smxtx m 'mttx,mttu,mttxx,mttdt' '[mttax]' > $1_smxtx.m
#  cat mtt_junk | mtt_p2m >> $1_smxtx.m
#  rm -f mtt_junk
#
#
fi

# Now invoke the standard error handling.
mtt_error_r cse2smx_lang.log





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