File mttroot/mtt/bin/trans/makesubs artifact 070575132f part of check-in b307857564


#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: makesubs
# Makes the default substitution file

# Copyright (C) 2000 by Peter J. Gawthrop


###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.1  2000/12/28 09:09:52  peterg
## Initial revision
##
##
###############################################################

#Inform user
echo Creating $1_subs.r

cat > $1_subs.r <<EOF
% Default SUBS file
% File $1_subs.r
% Generated by MTT on `date`.

EOF

cat $MTTPATH/trans/m/rcs_header.txt	>> $1_subs.r

cat >> $1_subs.r <<EOF
% Put algebraic substitution commands here
FOR ALL i LET arbint(i) = 0; % Zap arbitary constants
END;
EOF


exit

## NB the following messes up the expansion switch ????
cat >> $1_subs.r <<EOF
% Ordering switch
ORDER
EOF

# Symbolic params first
awk '{
  print $1 ","
}' < $1_sympar.txt >> $1_subs.r

# Then states
Nx=`mtt_getsize $1 x` # States

awk 'END{
  for (k=1;k<Nx;k++){
    printf("mttx%i,\n", k);
  }
    printf("mttx%i;\n", Nx);
  
}' Nx=$Nx < $1_sympar.txt >> $1_subs.r

cat >> $1_subs.r <<EOF
END;
EOF











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