Artifact 4377d907004aff063cbe3f9697f09767b14e8e5ca45a939e1e5303276f0cce37:


#! /bin/sh

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

# Bourne shell script: sympar_r2c
# Convert symbolic parameters to a c declaration list

# Copyright (c) P.J.Gawthrop 1997.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
# Revision 1.1  1997/03/01  11:20:36  peterg
# Initial revision
###############################################################

# Inform user
echo Creating $1_sympar.c

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

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


%Read the symbolic parameters file
in "$1_sympar.r";


%Generate the global variable list.
OUT "$1_sympar.c";
%External (global) variable list

write "/* Symbolic paramaters for system $1 */ "$
write "/* Generated by MTT */ "$
write "/* External (global) variable list */ "$

IF MTTNvar>0 THEN
BEGIN
  FOR i := 1:MTTNvar DO
    IF numberp(MTTVar(i,1)) 
      THEN 
      BEGIN
      % Do nowt
      END
      ELSE
      BEGIN
         write "extern double ", MTTVar(i,1), ";"$
      END$
END$
SHUT "$1_sympar.c";


EOF



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