File mttroot/mtt/bin/trans/lbl2args_txt2out artifact 05b9541fdd part of check-in 575219514b


#!/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.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 |\

awk '{
  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 ]