1;/*
2; * BEGIN LICENSE BLOCK
3; * Version: CMPL 1.1
4; *
5; * The contents of this file are subject to the Cisco-style Mozilla Public
6; * License Version 1.1 (the "License"); you may not use this file except
7; * in compliance with the License.  You may obtain a copy of the License
8; * at www.eclipse-clp.org/license.
9; *
10; * Software distributed under the License is distributed on an "AS IS"
11; * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See
12; * the License for the specific language governing rights and limitations
13; * under the License.
14; *
15; * The Original Code is  The ECLiPSe Constraint Logic Programming System.
16; * The Initial Developer of the Original Code is  Cisco Systems, Inc.
17; * Portions created by the Initial Developer are
18; * Copyright (C) 1990,2006 Cisco Systems, Inc.  All Rights Reserved.
19; *
20; * Contributor(s): Mireille Ducasse, ECRC.
21; *
22; * END LICENSE BLOCK
23; *
24; *	$Id: opium-mode.el,v 1.1 2006/09/23 01:54:34 snovello Exp $
25; */
26
27;
28; opium mode to help to declare opium's objects
29;
30
31(defun opium-mode ()
32  (interactive)
33      (setq mode-name "opium-mode")
34)
35
36
37(defun scenario ()
38  (interactive)
39           (end-of-line)
40           (insert-string "\nopium_scenario(\n")
41           (insert-string
42               (concat "\tname\t\t: "
43                       (read-string "Name ? ")
44                       ",\n"))
45           (insert-string
46               (concat "\tfiles\t\t: ["
47                       (read-string "Source Files, included the current file ? (separate with ',') ")
48                       "],\n"))
49           (insert-string
50               (concat "\tscenarios\t: ["
51                       (read-string "Further scenarios needed to run the actual one ? (separate with ',') ")
52                       "],\n"))
53           (insert-string
54               (concat "\tmessage\t\t:\n\""
55                       (read-string " Help Message ? ")
56                       "\"\n"))
57           (insert-string "\t).\n")
58           (message "opium_scenario defined"))
59
60
61(defun command ()
62  (interactive)
63               (insert-string "\nopium_command(\n")
64               (insert-string
65                   (concat "\tname\t\t: "
66                           (read-string "Name ? ")
67                           ",\n"))
68               (insert-string
69                   (concat "\targ_list\t: ["
70                           (read-string "Arguments ? (separate with ',') ")
71                           "],\n"))
72               (insert-string
73                   (concat "\targ_type_list\t: ["
74                           (read-string "Argument Types ? (separate with ',') ")
75                           "],\n"))
76               (insert-string
77                   (concat "\tabbrev\t\t: "
78                           (read-string "Abbrev ? (no arguments, '_' if no abbrev) ")
79                           ",\n"))
80               (insert-string
81                   (concat "\tinterface\t: "
82                           (read-string "Interface ? (button/menu/hidden) ")
83                           ",\n"))
84               (insert-string
85                   (concat "\tcommand_type\t: "
86                           (read-string "Command type ? (trace/opium/tool) ")
87                           ",\n"))
88              (insert-string
89                   (concat "\timplementation\t: "
90                           (read-string "Name of the implementation ? ")
91                           ",\n"))
92               (insert-string
93                   (concat "\tparameters\t: ["
94                           (read-string "Related Parameters ? (separate with ',') ")
95                           "],\n"))
96               (insert-string
97                   (concat "\tmessage\t\t:\n\""
98                           (read-string "Help Message ? ")
99                           "\"\n"))
100               (insert-string "\t).\n")
101               (message "opium_command defined"))
102
103
104(defun primitive ()
105  (interactive)
106               (insert-string "\nopium_primitive(\n")
107               (insert-string
108                   (concat "\tname\t\t: "
109                           (read-string "Name ? ")
110                           ",\n"))
111               (insert-string
112                   (concat "\targ_list\t: ["
113                           (read-string "Arguments ? (separate with ',') ")
114                           "],\n"))
115               (insert-string
116                   (concat "\targ_type_list\t: ["
117                           (read-string "Argument Types ? (separate with ',') ")
118                           "],\n"))
119               (insert-string
120                   (concat "\tabbrev\t\t: "
121                           (read-string "Abbrev ? (no arguments) ")
122                           ",\n"))
123              (insert-string
124                   (concat "\timplementation\t: "
125                           (read-string "Name of the implementation ? ")
126                           ",\n"))
127               (insert-string
128                   (concat "\tmessage\t\t:\n\""
129                           (read-string "Help Message ? ")
130                           "\"\n"))
131               (insert-string "\t).\n")
132               (message "opium_primitive defined"))
133
134
135(defun procedure ()
136  (interactive)
137           (insert-string "\nopium_procedure(\n")
138               (insert-string
139                   (concat "\tname\t\t: "
140                           (read-string "Name ? ")
141                           ",\n"))
142               (insert-string
143                   (concat "\targ_list\t: ["
144                           (read-string "Arguments ? (separate with ',') ")
145                           "],\n"))
146               (insert-string
147                   (concat "\timplementation\t: "
148                           (read-string " Name of the implementation ? ")
149                           ",\n"))
150               (insert-string
151                   (concat "\tparameters\t: ["
152                           (read-string "Related Parameters ? (separate with ',') ")
153                           "],\n"))
154               (insert-string
155                   (concat "\tmessage\t\t:\n\""
156                           (read-string "Help Message ? ")
157                           "\"\n"))
158               (insert-string "\t).\n")
159               (message "opium_procedure defined"))
160
161
162(defun parameter ()
163  (interactive)
164               (insert-string "\nopium_parameter(\n")
165               (insert-string
166                   (concat "\tname\t\t: "
167                           (read-string "Name ? ")
168                           ",\n"))
169               (insert-string
170                   (concat "\targ_list\t: ["
171                           (read-string "Arguments ? (separate with ',') ")
172                           "],\n"))
173               (insert-string
174                   (concat "\targ_type_list\t: ["
175                           (read-string "Argument Types ? (separate with ',') ")
176                           "],\n"))
177               (insert-string
178                   (concat "\tparameter_type\t: "
179                           (read-string "Parameter type ? (single/multiple) ")
180                           ",\n"))
181               (insert-string
182                   (concat "\tdefault\t\t: ["
183                           (read-string "Default Value of the Arguments ? (separate with ',') ")
184                           "],\n"))
185               (insert-string
186                   (concat "\tcommands\t: ["
187                           (read-string "Related Commands ? (separate with ',') ")
188                           "],\n"))
189               (insert-string
190                   (concat "\tmessage\t\t: \n\""
191                           (read-string "Help Message ? ")
192                           "\"\n"))
193               (insert-string "\t).\n")
194               (message "opium_parameter defined"))
195
196
197(defun type ()
198  (interactive)
199               (insert-string "\nopium_type(\n")
200               (insert-string
201                   (concat "\tname\t\t: "
202                           (read-string "Name ? ")
203                           ",\n"))
204               (insert-string
205                   (concat "\timplementation\t: "
206                           (read-string " Name of the implementation ? ")
207                           ",\n"))
208               (insert-string
209                   (concat "\tmessage\t\t: \n\""
210                           (read-string "Help Message ? ")
211                           "\"\n"))
212               (insert-string "\t).\n")
213               (message "opium_type defined"))
214
215
216(defun demo ()
217  (interactive)
218               (insert-string "\nopium_demo(\n")
219               (insert-string
220                   (concat "\tname\t\t: "
221                           (read-string "Name ? ")
222                           ",\n"))
223               (insert-string
224                   (concat "\tdemo_goal\t: ("
225                           (read-string " Goals to be used for the demo? (separate with ',') ")
226                           "),\n"))
227	       (insert-string
228                   (concat "\tcondition\t: ("
229                           (read-string " Conditions/initialisation for the demo goal? (separate with ',') ")
230                           "),\n"))
231               (insert-string
232                   (concat "\tmessage\t\t: \n\""
233                           (read-string "Help Message ? ")
234                           "\"\n"))
235               (insert-string "\t).\n")
236               (message "opium_demo defined"))
237