Overview
Comment:Initial revision
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: aa9c74c6de52691b775c8b0eb7f96f69fbfdabd83cebc5770338e6be7a3625cd
User & Date: gawthrop@users.sourceforge.net on 1999-08-18 06:17:14
Other Links: branch diff | manifest | tags
Context
1999-08-18
06:17:55
Modular form check-in: bcf49c0943 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
06:17:14
Initial revision check-in: aa9c74c6de user: gawthrop@users.sourceforge.net tags: origin/master, trunk
06:15:48
Stripped down to just representations menu - see mtt_make_menu check-in: 60ea7e4abf user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/bin/trans/examples_txt2tk version [357d77bc30].

























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#! /bin/sh

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

# Bourne shell script: examples_txt2tk
# Creates tk/tcl file for xmtt.
# Copyright (c) P.J.Gawthrop, 1998,1999


# Examples menu
awk 'BEGIN{
    basemenu=".exam.exam"
    oldmenu=basemenu
    OLDPATH="";
    }
    {
    if (NF>1){
    PATH=$1;
    N=split(PATH,path,"/"); # Find current example path
    oldN=split(OLDPATH,oldpath,"/"); # Find last example path
    same=1; menu=basemenu;
    while ((path[same]==oldpath[same])&&(same<=N)){
       menu=menu"."tolower(path[same])
       same++
    }
      oldmenu=menu
      for (i=same;i<=N;i++){
        menu=tolower(menu"."path[i])
        category=path[i];
	printf("\n# Example category %s (%i)\n", category, N)
        printf("%s  add  cascade -label \"%s\" -menu %s \n", oldmenu, category, menu);
        printf("menu %s\n", menu)
	oldmenu=menu
      }
    oldN=N
    OLDPATH=PATH
    oldcategory=category
    example=$2
    printf(" set mtt \"xmtt -example %s\" \n", example); 
    printf("%s add command -label %s -command \"exec $mtt &\"\n", menu, example);
 }
}' 

Added mttroot/mtt/bin/trans/mtt_make_menu version [8d1d5f9f81].







































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#! /bin/sh

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

# Bourne shell script: mtt_make_menu
# Creates tk/tcl menus for xmtt.
# Copyright (c) P.J.Gawthrop, 1998,1999

#MTT blurb
title=`mtt --version`

#Collect all systems (inc dir name)
dirname=`basename $PWD`
systems=`echo *_abg.fig | sed 's/\([a-zA-Z0-9]*\)_abg.fig/\1/g'`
dirname_in_systems=`echo $systems | grep -c $dirname`
if [ "$dirname_in_systems" = "0" ]; then
    systems="$systems $dirname"
fi

# Default system
system=$dirname

cat<<EOF
# Default system
set system "$system"

# Arguments to mtt
set args "-q"

# The top level menu
button .mtt -text "$title ($dirname)" -command "exec mtt warranty &"
menubutton .man -text "Manual" -menu .man.man
menubutton .util  -text "Utilities" -menu .util.util
menubutton .opt  -text "Options" -menu .opt.opt
menubutton .sys -text "Systems" -menu .sys.sys
menubutton .rep -text "Representations (major)" -menu .rep.rep
menubutton .repall -text "Representations (all)" -menu .repall.repall
menubutton .exam -text "Examples" -menu .exam.exam
button .mtt_quit -text "Quit" -command exit
pack .mtt .exam .rep  .repall .sys  .util .opt  .man .mtt_quit
 
menu .man.man
.man.man add command -label "Browser (html)" -command "exec mtt -q hinfo &"
.man.man add command -label "Info" -command "exec xterm -e mtt -q info &"
.man.man add command -label "Text (pdf)" -command "exec mtt -q manual &"

menu .util.util
# .mtt.opt.util add command -label "copy example" -command 
# .mtt.opt.util add command -label "copy" 
.util.util add command -label "clean" -command "exec mtt -q Clean &"
.util.util add command -label "recursive clean" -command "exec mtt -q rclean &"

menu .opt.opt


# System choice
menu .sys.sys
EOF

for sys in $systems; do
    echo .sys.sys add radio -label "$sys"  -command {set system "$sys"} 
done

# Create the options menu
mtt |  awk '{
  if (Options) {
    option=substr($1,2);
    label="";
    for (i=2;i<=NF;i++)
      label = sprintf("%s %s",label,$i);
    printf(".opt.opt add check -label \"%s (-%s)\" -variable %s -command {set args \"$args -%s\"}\n", label, option, option, option); 
  }
  if ($1=="Options:") Options = 1;
}'

# Examples menu
cat <<EOF
menu .exam.exam
EOF

examples_txt2tk< $MTTPATH/EXAMPLES

cat<<EOF
menu .rep.rep
menu .repall.repall
EOF

reps_txt2tk <$MTTPATH/REPS 










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