ADDED mttroot/mtt/bin/trans/mtt_header Index: mttroot/mtt/bin/trans/mtt_header ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/mtt_header @@ -0,0 +1,114 @@ +#!/bin/sh + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_header +# Headings for functions +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +# Arguments +system=$1 +rep=$2 +language=$3 +args=$4 +output=$5 +extras=$6 + +# Find system constants +Nx=`mtt_getsize $system x` # States +Nxx=`mtt_getsize $system xx` # States x States +Nu=`mtt_getsize $system u` # Inputs +Ny=`mtt_getsize $system y` # Outputs +Nyz=`mtt_getsize $system yz` # Zero outputs +Npar=`wc -l $system\_sympar.txt | awk '{print $1}'` + +# Representation-specific stuff +case $rep in + cse) + states=yes; + inputs=yes; + ;; + cseo) + states=yes; + inputs=yes; + ;; + ode) + states=yes; + inputs=yes; + ;; + odeo) + states=yes; + inputs=yes; + ;; + sm) + states=no; + inputs=no; + ;; + *) + +esac +# Lanuage specific stuff +case $language in + m) + modeline='% -*-octave-*- Put Emacs into octave-mode%'; + ext='m'; + Lc='##'; + Rc=''; + Lb='('; + Rb=')'; + function="function" + declaration="[$output] = $1_$rep($args);" + ;; + *) + echo Language $language not supported - sorry; exit 1 +esac + + +# Header information +cat<