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
100
101
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
|
;; Copyright (C) 2001, 2004 Peter Milliken
;;
;; Author: Peter Milliken <peterm@resmed.com.au>,
;; <peterm@unwired.com.au>
;;
;; Keywords: language sensitive abbreviation template placeholder token
;;
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;******************************************************************************
;; These definitions are my personal customisations for the language. This is
;; where you should place YOUR customisations.
;;
;; Sometimes there is a definition(s) in here that override definitions in the
;; main language template file that are here to make that definition more
;; "usable" - this is because I (primarily) try and generate/maintain the main
;; .lse files from EBNF definitions of the language. Sometimes I just can't
;; express the appropriate customisation in the EBNF and so I am forced to
;; override the placeholder definition in this file.
;;
;; This entries in this file should be used as an example of how to create your
;; own customisations. I would caution that you don't delete any definitions
;; though until you are sure that your edit sessions will not be adversely
;; affected. The best way to check out the effects of a delete is to "compile"
;; (else-compile-buffer) the "delete" command for that definition (this will
;; remove it from your edit session and you can nolonger access the definition
;; until next you load language template files) and then see whether anything
;; has been "lost" in your code generation ability i.e. say you think you don't
;; need the definition for placeholder XXX, just place the following lines at
;; the end of one of your source files (when ELSE is enabled for that buffer)
;; and perform a compile (M-x else-compile-buffer) with the cursor positioned at
;; the beginning of the line:
;;
;; DELETE PLACEHOLDER XXX -
;; /LANGUAGE = "C" -
;;
;; This will delete definition XXX from memory.
;;
;;******************************************************************************
DELETE PLACEHOLDER COMPILATION_UNIT -
/LANGUAGE="C" -
DEFINE PLACEHOLDER COMPILATION_UNIT -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION="" -
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"[module_level_comments]"
"[{include_files}...]"
" "
"[{data_types_or_declarations}...]"
" "
"[{function_definition}...]"
" "
"[main_function]"
END DEFINE
DELETE PLACEHOLDER #INCLUDE -
/LANGUAGE="C" -
DEFINE PLACEHOLDER #INCLUDE -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION="" -
/DUPLICATION=VERTICAL -
/SEPARATOR="" -
/TYPE=MENU
"#include <{file_name}>"
"#include "{file_name}""
END DEFINE
DELETE PLACEHOLDER FILE_NAME -
/LANGUAGE="C" -
DEFINE PLACEHOLDER FILE_NAME -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION="" -
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=TERMINAL
"Enter the name of the include file here i.e. stdio.h"
END DEFINE
DELETE PLACEHOLDER MODULE_LEVEL_COMMENTS -
/LANGUAGE="C" -
DEFINE PLACEHOLDER MODULE_LEVEL_COMMENTS -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION=""
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"/* ===[ {module} ]=============================================================="
""
"@@Description: {text}"
""
"@@Revisions:"
""
"@@@@REV DATE BY DESCRIPTION"
"@@------ --------- --- ------------------------------------------------"
"@@[text] [text] [text] [text]"
"@@-----------------------------------------------------------------------------"
""
"@@@@This item is the property of ResMed Ltd, and contains confidential and trade"
"@@@@secret information. It may not be transfered from the custody or control of"
"@@@@ResMed except as authorised in writing by an officer of ResMed. Neither this"
"@@@@item nor the information it contains may be used, transfered, reproduced,"
"@@@@published, or disclosed, in whole or in part, and directly or indirectly,"
"@@@@except as expressly authorised by an officer of ResMed, pursuant to written"
"@@@@agreement."
""
"@@@@Copyright (c) 2004 ResMed Ltd. All rights reserved."
"@@===========================================================================*/"
""
END DEFINE
DELETE PLACEHOLDER MODULE -
/LANGUAGE="C" -
DEFINE PLACEHOLDER MODULE -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION="" -
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=TERMINAL
"Enter the name of the module i.e. gs_lib.c"
END DEFINE
DELETE PLACEHOLDER FUNCTION_DEFINITION -
/LANGUAGE="C" -
DEFINE PLACEHOLDER FUNCTION_DEFINITION -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION="" -
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"[declaration_specifiers] {declarator}"
"[declaration]..."
"{"
" [declaration]..."
" [statement]..."
"}"
END DEFINE
DELETE TOKEN MAIN_FUNCTION_DEF -
/LANGUAGE="C" -
DEFINE TOKEN MAIN_FUNCTION_DEF -
/LANGUAGE="C" -
/DESCRIPTION="defines a main function"
"[function_level_comments]"
"{main() OR main function that accept arguments from the command line}"
"{"
" [block_decl]..."
""
" {statement}..."
"}"
END DEFINE
DELETE PLACEHOLDER FUNCTION_LEVEL_COMMENTS -
/LANGUAGE="C" -
DEFINE PLACEHOLDER FUNCTION_LEVEL_COMMENTS -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION=""
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"/* ===[ {text} ]==============================================="
""
"@@@Summary: {text}"
""
"@@@Description: {text}"
""
"@@@Return Value: {text} always returns P_SUCCESS"
""
"@@@========================================================================== */"
END DEFINE
DELETE PLACEHOLDER CONDITIONAL_EXPRESSION -
/LANGUAGE="C" -
DEFINE PLACEHOLDER CONDITIONAL_EXPRESSION -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION="" -
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=MENU -
"logical_or_expression"/PLACEHOLDER
"{logical_or_expression} ? {expression} : {conditional_expression}"
END DEFINE
DELETE PLACEHOLDER CASE_PART -
/LANGUAGE="C" -
DEFINE PLACEHOLDER CASE_PART -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION=""
/DUPLICATION=VERTICAL -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"case {constant_expression}:"
"[case {constant_expression}:]..."
" [statement]..."
" break;"
END DEFINE
DELETE PLACEHOLDER DEFAULT_PART -
/LANGUAGE="C" -
DEFINE PLACEHOLDER DEFAULT_PART -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION=""
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"default :"
" [statement]..."
" break;"
END DEFINE
DELETE PLACEHOLDER WHILE_STATEMENT -
/LANGUAGE="C" -
DEFINE PLACEHOLDER WHILE_STATEMENT -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION=""
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"while ({expression})"
"{"
" {statement}..."
"}"
END DEFINE
DELETE PLACEHOLDER IF_STATEMENT -
/LANGUAGE="C" -
DEFINE PLACEHOLDER IF_STATEMENT -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION=""
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"if ({expression})"
"{"
" {statement}..."
"}"
"[elsif_part]..."
"[else_part]"
END DEFINE
DELETE PLACEHOLDER ELSIF_PART -
/LANGUAGE="C" -
DEFINE PLACEHOLDER ELSIF_PART -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION=""
/DUPLICATION=VERTICAL -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"else if ({expression})"
"{"
" {statement}..."
"}"
END DEFINE
DELETE PLACEHOLDER ELSE_PART -
/LANGUAGE="C" -
DEFINE PLACEHOLDER ELSE_PART -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION=""
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"else"
"{"
" {statement}..."
"}"
END DEFINE
DELETE PLACEHOLDER SWITCH_STATEMENT -
/LANGUAGE="C" -
DEFINE PLACEHOLDER SWITCH_STATEMENT -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION=""
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"switch ({expression})"
"{"
" [case_part]..."
" [default_part]"
"}"
END DEFINE
DELETE PLACEHOLDER DO_STATEMENT -
/LANGUAGE="C" -
DEFINE PLACEHOLDER DO_STATEMENT -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION=""
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"do"
"{"
" {statement}..."
"} while ({expression});"
END DEFINE
DELETE PLACEHOLDER DEFAULT_PART -
/LANGUAGE="C" -
DEFINE PLACEHOLDER DEFAULT_PART -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION=""
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
/RUN_CODE=eut-test1/BEFORE
/RUN_CODE=eut-test2/AFTER
/RUN_CODE=eut-test3/ONINSERT
"default :"
" [statement]..."
" break;"
END DEFINE
DELETE PLACEHOLDER FOR_STATEMENT -
/LANGUAGE="C" -
DEFINE PLACEHOLDER FOR_STATEMENT -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION=""
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"for ([loop_init]; [loop_control]; [expression])"
"{"
" {statement}..."
"}"
END DEFINE
DELETE PLACEHOLDER PROTOTYPE_DECLARATION -
/LANGUAGE="C" -
DEFINE PLACEHOLDER PROTOTYPE_DECLARATION -
/LANGUAGE="C" -
/NOAUTO_SUBSTITUTE -
/DESCRIPTION=""
/DUPLICATION=CONTEXT_DEPENDENT -
/SEPARATOR="" -
/TYPE=NONTERMINAL -
"[function_level_comments]"
"[static_or_extern] {data_type_specifier} [*]{function_name} ([{parameter_declaration}...[, ...]]);"
END DEFINE
DELETE TOKEN COMMENT -
/LANGUAGE="C" -
DEFINE TOKEN COMMENT -
/LANGUAGE="C" -
/PLACEHOLDER=COMMENT_STATEMENT
END DEFINE
DELETE TOKEN C -
/LANGUAGE="C" -
DEFINE TOKEN C -
/LANGUAGE="C" -
"/* {text} */"
END DEFINE
DELETE TOKEN P -
/LANGUAGE="C" -
DEFINE TOKEN P -
/LANGUAGE="C" -
/RUN_CODE=eut-test2/AFTER
"p_report_format(0, rinfo_p, str);"
END DEFINE
|