Differences From Artifact [fab900c9ec]:

To Artifact [7c246fcfb8]:


9
10
11
12
13
14
15



16
17
18
19
20
21
22
# Copyright (C) 2000 by Peter J. Gawthrop

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



## Revision 1.9  2001/07/23 05:16:39  geraint
## Simple filter for Reduce reserved words in sympar.
##
## Revision 1.8  2001/07/04 06:00:12  gawthrop
## Fixed a funny with tr - changed SEPS and REPS - something to do with ^
##
## Revision 1.7  2001/04/13 07:14:12  geraint







>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.10  2001/07/28 21:10:18  geraint
## Generate warning instead of error if reserved word used.
##
## Revision 1.9  2001/07/23 05:16:39  geraint
## Simple filter for Reduce reserved words in sympar.
##
## Revision 1.8  2001/07/04 06:00:12  gawthrop
## Fixed a funny with tr - changed SEPS and REPS - something to do with ^
##
## Revision 1.7  2001/04/13 07:14:12  geraint
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
sys=$1 # System name
filename=$1_sympar.txt
# Inform user
echo Creating $filename

# Create list of all sympars including those that are aliased
sh $1_type.sh 'echo ' ' ' ' ' |\
awk '{printf("abg2sympar_m2txt %s %s\n ", $1, $2)}' |\
sh | sort -u > mtt_all_sympar.txt

# Sort the aliased list
mtt_strip_args < $1_aliased.txt | sort -u  > mtt_aliased_sort.txt

# Create list of unwanted stuff
cat  mtt_aliased_sort.txt> mtt_unwanted.txt

notvar="[%|#]NOT[V|P]AR";
sh $1_type.sh 'strip_notvars.sh ' ' ' ' mtt_unwanted.txt'

sort -u mtt_unwanted.txt > mtt_unwanted_sort.txt

# Compare it with the aliased list and show the differences
diff mtt_all_sympar.txt mtt_unwanted_sort.txt |\
awk '{if ($1=="<") printf("%s\t%s\n", $2,$3)}' > mtt_sympar.txt

# Assume same name in different system is the same
awk '{
    if ($1==name){
	sysname[i++]=$2
    }
    
    if ($1!=name){
        if (length(name)>0){
          printf("%s\t",name)







|















|


|







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
83
sys=$1 # System name
filename=$1_sympar.txt
# Inform user
echo Creating $filename

# Create list of all sympars including those that are aliased
sh $1_type.sh 'echo ' ' ' ' ' |\
gawk '{printf("abg2sympar_m2txt %s %s\n ", $1, $2)}' |\
sh | sort -u > mtt_all_sympar.txt

# Sort the aliased list
mtt_strip_args < $1_aliased.txt | sort -u  > mtt_aliased_sort.txt

# Create list of unwanted stuff
cat  mtt_aliased_sort.txt> mtt_unwanted.txt

notvar="[%|#]NOT[V|P]AR";
sh $1_type.sh 'strip_notvars.sh ' ' ' ' mtt_unwanted.txt'

sort -u mtt_unwanted.txt > mtt_unwanted_sort.txt

# Compare it with the aliased list and show the differences
diff mtt_all_sympar.txt mtt_unwanted_sort.txt |\
gawk '{if ($1=="<") printf("%s\t%s\n", $2,$3)}' > mtt_sympar.txt

# Assume same name in different system is the same
gawk '{
    if ($1==name){
	sysname[i++]=$2
    }
    
    if ($1!=name){
        if (length(name)>0){
          printf("%s\t",name)
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
        }
        printf("\n")

}' < mtt_sympar.txt >$filename

reserved_words=`\
    cat ${MTT_LIB}/reduce/reserved_words.txt	|\
    awk '{printf "%s ", $0}'			|\
    tr [a-z] [A-Z]`
sympar_words=`\
    cat ${filename}				|\
    cut -f1					|\
    awk '{printf "%s ", $0}'			|\
    tr [a-z] [A-Z]`
flag=0
for reserved_word in ${reserved_words}; do
    for sympar_word in ${sympar_words}; do
	if [ ${sympar_word} = ${reserved_word} ]; then
	    echo ""
	    echo "*** MTT Warning:"
	    echo "    ${sympar_word} is reserved (Reduce)"
	    echo ""
	fi
    done
done







|




|












102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
        }
        printf("\n")

}' < mtt_sympar.txt >$filename

reserved_words=`\
    cat ${MTT_LIB}/reduce/reserved_words.txt	|\
    gawk '{printf "%s ", $0}'			|\
    tr [a-z] [A-Z]`
sympar_words=`\
    cat ${filename}				|\
    cut -f1					|\
    gawk '{printf "%s ", $0}'			|\
    tr [a-z] [A-Z]`
flag=0
for reserved_word in ${reserved_words}; do
    for sympar_word in ${sympar_words}; do
	if [ ${sympar_word} = ${reserved_word} ]; then
	    echo ""
	    echo "*** MTT Warning:"
	    echo "    ${sympar_word} is reserved (Reduce)"
	    echo ""
	fi
    done
done

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