File mttroot/mtt/bin/trans/lbl2args_txt2out artifact 81dc428574 part of check-in 66bb5feadf


#!/bin/sh
# Writes argument list to standard output ready for use in calling lbl file

  ###################################### 
  ##### Model Transformation Tools #####
  ######################################
  
  ###############################################################
  ## Version control history
  ###############################################################
  ## $Id$
  ## $Log$
  ## Revision 1.2  2001/07/03 22:59:08  gawthrop
  ## Fixed problems with argument passing for CRs
  ##
  ## Revision 1.1  2001/06/11 15:06:58  gawthrop
  ## Now handles user-defined components
  ##
  ###############################################################

# Copyright (C) 2001 by Peter J. Gawthrop

if [ -f "$1_lbl.txt" ]; then
grep '[#%]ALIAS' $1_lbl.txt |\

gawk '{
  if (match($2,"\\$[0-9]")==1) ## Test if its a argument alias
  {
    i = substr($2,2);
    arg[i] = $3
    N++
  }
}
END{
    for (j=1;j<=N;j++){
      if (length(arg[j])==0)
        arg[j] = "??";
    }
    for (j=1;j<N;j++){
      if (length(arg[j])==0)
        arg[j] = "??";
      printf("%s;", arg[j]);
    }
    printf("%s\n",arg[N]);
}'
fi

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