File mttroot/mtt/bin/trans/mtt_p2c artifact 90b198b8c1 part of check-in 2a27bcb9cc


#! /bin/sh


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

# Bourne shell script: mtt_p2c
# Pascal to c converter for MTT
# Uses the wonderful GNU p2c by  Dave Gillespie, daveg@csvax.cs.caltech.edu.    
# P.J.Gawthrop July 1998
# Copyright (c) P.J.Gawthrop 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.1  1998/07/25 16:28:38  peterg
## Initial revision
##
###############################################################


# Options
info=''
while [ -n "`echo $1 | grep '^-'`" ]; do
  case $1 in
	-I )
                info=info;;
	*)
		echo "$1 is an invalid argument - ignoring" ;;
  esac
  shift
done

# Inform user
echo Creating $1_$2.c

# Use p2c to do the translation - but zap the PASCAL_MAIN which we don't want. 
p2c -V  $1_$2.p  2>/dev/null

mv $1_$2.c mtt_junk
grep -v 'PASCAL_MAIN' < mtt_junk > $1_$2.c

# Info if needed
if [ -n "$info" ]; then
    cat $1_ode2odes.log
else
    rm -f $1_ode2odes.log
fi



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