File mttroot/mtt/bin/trans/make_stdin artifact 1fe38150b6 part of check-in acfbf3a2c8


#! /bin/sh

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

## 	$Id$	

# Copyright (C) 1999 by Peter J. Gawthrop

# Tell user
Sys=$1
lang=$2
date=`date`
Nu=`grep "MTTNu " <$Sys\_def.r | awk '{print $3}' | sed 's/;//'`
echo  "Creating $1_input.$2 for standard input"

cat <<EOF > $1_input.$2 
PROCEDURE $1_input(VAR mttu : InputVector;
                       mttt : REAL;
                       mttx : StateVector;
                       mtty : OutputVector);

{Created by MTT on $date for standard input to simulation}

VAR t : REAL; ch: char;

BEGIN{$1_input}

  {Zap comments}
  REPEAT
    read(ch);
    IF ch="#" THEN 
      readln;
  UNTIL NOT (ch="#");

  read(t); { Read, and discard, first column (time) }
  FOR mtti:=1 TO $Nu DO {Read the inputs}
    read(mttu[mtti]);
  readln; {Next line}

END{$1_input};
EOF

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