Overview
Comment:Fixed problem with shell expanding * (used as important rep marker)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 86a2a906ba0585a971478c155939d42481085b8109a7312bae54bc6416cfe336
User & Date: gawthrop@users.sourceforge.net on 2001-07-24 04:18:32
Other Links: branch diff | manifest | tags
Context
2001-07-24
04:25:16
Relabeled ports - easier for sensitivity to handle check-in: 1b1d48282e user: gawthrop@users.sourceforge.net tags: origin/master, trunk
04:18:32
Fixed problem with shell expanding * (used as important rep marker) check-in: 86a2a906ba user: gawthrop@users.sourceforge.net tags: origin/master, trunk
04:17:30
Removed all " from #SUMMARY lines - messes up xmtt check-in: c89a6ab013 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/mtt2reps_txt from [09ec17ae5f] to [38143b0d0c].

1
2
3
4
5
6
7
8
9
10
11



12
13
14
15
16
17
18
#! /bin/sh

# mtt2reps_txt: Gives a tabular listing of representations and languages
# P J Gawthrop July 1998, October 1998
# Copyright (c) P.J.Gawthrop, 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.10  2000/09/14 07:54:13  peterg
## Removed -e option in echo
##
## Revision 1.9  2000/04/05 08:34:30  peterg
## removed output tab
##
## Revision 1.8  2000/04/05 08:04:01  peterg











>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/sh

# mtt2reps_txt: Gives a tabular listing of representations and languages
# P J Gawthrop July 1998, October 1998
# Copyright (c) P.J.Gawthrop, 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.11  2001/04/28 03:38:36  geraint
## Refined selection of matching patterns - checks for exact match.
##
## Revision 1.10  2000/09/14 07:54:13  peterg
## Removed -e option in echo
##
## Revision 1.9  2000/04/05 08:34:30  peterg
## removed output tab
##
## Revision 1.8  2000/04/05 08:04:01  peterg
42
43
44
45
46
47
48


49
50

51

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
##
## Revision 1.1  1998/10/20 08:15:08  peterg
## Initial revision
##
###############################################################

sep='|'; # Separates the languages from the rest.


representations=`grep '#SUMMARY' $MTTPATH/mtt | awk '{print $2'} | sort -u `


for rep in $representations ; do

    ## Title should be same for all languages -- but extract the first non-empty version
      title=`grep '#SUMMARY' $MTTPATH/mtt | tr '\t' ' ' | grep "[ *]$rep[ *]" | \
      awk  '{if (NF>2) {for (i=3;i<NF-1;i++) printf("%s ",$i); NF1=NF-1; printf("%s\n",$NF1)}}' |\
      head -1`
      

    language=`grep '#SUMMARY' $MTTPATH/mtt |\
      awk '
        {
          if (index(rep,"*")==length(rep)){
            if ($2==rep) print $NF
          }
          else
            if (($2==rep)||($2==sprintf("%s*",rep))) print $NF
        }' rep=$rep |\
      sort -u | sed 's/[()]//g'` 

      Title='('$title')'
      echo $rep $Title  $sep $language
     
done











>
>
|

>

>

|



<








|



|






45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
##
## Revision 1.1  1998/10/20 08:15:08  peterg
## Initial revision
##
###############################################################

sep='|'; # Separates the languages from the rest.

## List of all representations (deleting the *)
representations=`grep '#SUMMARY' $MTTPATH/mtt | awk '{sub("\*","+"); print $2'} | sort -u `


for rep in $representations ; do
    Rep=`echo $rep | tr '+' '*'`
    ## Title should be same for all languages -- but extract the first non-empty version
      title=`grep '#SUMMARY' $MTTPATH/mtt | tr '\t' ' ' | grep "[ *]$Rep[ *]" | \
      awk  '{if (NF>2) {for (i=3;i<NF-1;i++) printf("%s ",$i); NF1=NF-1; printf("%s\n",$NF1)}}' |\
      head -1`
      

    language=`grep '#SUMMARY' $MTTPATH/mtt |\
      awk '
        {
          if (index(rep,"*")==length(rep)){
            if ($2==rep) print $NF
          }
          else
            if (($2==rep)||($2==sprintf("%s*",rep))) print $NF
        }' rep=$Rep |\
      sort -u | sed 's/[()]//g'` 

      Title='('$title')'
      echo "$Rep" $Title  $sep $language
     
done





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