aboutsummaryrefslogtreecommitdiffstats
path: root/etc/srecode
diff options
context:
space:
mode:
authorChong Yidong2009-10-03 19:28:56 +0000
committerChong Yidong2009-10-03 19:28:56 +0000
commitc05676c5ac4c1722bcac8a31668f5fab2e7ae6d4 (patch)
tree51c46490ca339b80cc72377cb26c1409bb017fc5 /etc/srecode
parente6e267fcba9251bbb7eeb66ca55c08e47c635ab8 (diff)
downloademacs-c05676c5ac4c1722bcac8a31668f5fab2e7ae6d4.tar.gz
emacs-c05676c5ac4c1722bcac8a31668f5fab2e7ae6d4.zip
* srecode: New directory for SRecode template files.
Diffstat (limited to 'etc/srecode')
-rw-r--r--etc/srecode/cpp.srt260
-rw-r--r--etc/srecode/default.srt63
-rw-r--r--etc/srecode/doc-cpp.srt84
-rw-r--r--etc/srecode/doc-default.srt80
-rw-r--r--etc/srecode/doc-java.srt85
-rw-r--r--etc/srecode/ede-make.srt49
-rw-r--r--etc/srecode/el.srt311
-rw-r--r--etc/srecode/getset-cpp.srt50
-rw-r--r--etc/srecode/java.srt181
-rw-r--r--etc/srecode/make.srt79
-rw-r--r--etc/srecode/template.srt224
-rw-r--r--etc/srecode/test.srt148
-rw-r--r--etc/srecode/texi.srt173
-rw-r--r--etc/srecode/wisent.srt94
14 files changed, 1881 insertions, 0 deletions
diff --git a/etc/srecode/cpp.srt b/etc/srecode/cpp.srt
new file mode 100644
index 00000000000..4a144eb8108
--- /dev/null
+++ b/etc/srecode/cpp.srt
@@ -0,0 +1,260 @@
1;;; cpp.srt --- SRecode templates for c++-mode
2
3;; Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "c++-mode"
23
24set comment_start "/**"
25set comment_end " */"
26set comment_prefix " *"
27
28;; OVERRIDE THIS in your user or project template file to whatever
29;; you use for your project.
30set HEADEREXT ".h"
31
32context file
33
34template empty :time :user :file :cpp
35----
36{{>:filecomment}}
37
38{{#NOTHEADER}}
39
40{{^}}
41{{/NOTHEADER}}
42{{#HEADER}}
43{{>:header_guard}}
44{{/HEADER}}
45----
46
47template header_guard :file :blank
48----
49#ifndef {{FILENAME_SYMBOL}}
50#define {{FILENAME_SYMBOL}} 1
51
52{{^}}
53
54#endif // {{FILENAME_SYMBOL}}
55----
56
57context misc
58
59template arglist
60"Insert an argument list for a function.
61@todo - Support smart CR in a buffer for not too long lines."
62----
63({{#ARGS}}{{TYPE}} {{NAME}}{{#NOTLAST}},{{/NOTLAST}}{{/ARGS}})
64----
65
66context declaration
67
68prompt TYPE "Return Type: "
69
70template function :indent :blank
71"Insert a function declaration."
72----
73{{?TYPE}} {{?NAME}}{{>:misc:arglist}}
74{{#INITIALIZERS}}{{>B:initializers}}{{/INITIALIZERS}}
75{
76{{^}}
77}
78----
79bind "f"
80
81template function-prototype :indent :blank
82"Insert a function declaration."
83----
84{{?TYPE}} {{?NAME}}{{>:misc:arglist}};
85----
86
87
88prompt TYPE "Data Type: "
89
90template variable :indent :blank
91"Insert a variable declaration."
92----
93{{?TYPE}} {{?NAME}}{{#HAVEDEFAULT}} = {{DEFAULT}}{{/HAVEDEFAULT}};
94----
95bind "v"
96
97template variable-prototype :indent :blank
98"Insert a variable declaration."
99----
100{{?TYPE}} {{?NAME}};
101----
102bind "v"
103
104template class :indent :blank
105"Insert a C++ class. For use by user insertion.
106Override this template to change contents of a class.
107Override `class-tag' to override the outer structure of the class."
108----
109{{<A:class-tag}}
110 public:
111 {{>CONSTRUCTOR:classdecl:constructor-tag}}
112 {{>DESTRUCTOR:classdecl:destructor-tag}}
113 private:
114 {{^}}
115
116{{/A}}
117----
118
119template subclass :indent :blank
120"Insert a C++ subclass of some other class."
121sectiondictionary "PARENTS"
122set NAME "?PARENTNAME"
123----
124{{>A:class}}
125----
126
127template class-tag :indent :blank
128"Insert a C++ class with the expectation of it being used by a tag inserter.
129Override this to affect applications, or the outer class structure for
130the user-facing template."
131----
132class {{?NAME}} {{#PARENTS}}{{#FIRST}}: {{/FIRST}}public {{NAME}}{{/PARENTS}}
133{
134 {{^}}
135};
136----
137bind "c"
138
139template method :indent :blank
140"Method belonging to some class, declared externally."
141----
142{{?TYPE}} {{?PARENT}}::{{?NAME}}{{>:misc:arglist}}
143{{#INITIALIZERS}}{{>B:initializers}}{{/INITIALIZERS}}
144{
145{{^}}
146}
147----
148
149template include :blank
150"An include statement."
151----
152#include "{{?NAME}}"
153----
154bind "i"
155
156template label :blank :indent
157----
158 {{?NAME}}:
159----
160
161context classdecl
162
163template constructor-tag :indent :blank
164----
165{{?NAME}}{{>:misc:arglist}}
166{ {{^}} }
167----
168
169;; This one really sucks. How can I finish it?
170template initializers :indent
171----
172{{#FIRST}}:
173{{/FIRST}}{{INITNAME}}(){{#NOTLAST}},{{/NOTLAST}}
174----
175
176template destructor-tag :indent :blank
177----
178~{{?NAME}}{{>:misc:arglist}}
179{ {{^}} }
180----
181
182;;; Base Comment functions for overriding.
183context classdecl
184
185template comment-function-group-start :indent :blank
186"Used for putting comments in front of a functional group of declarations.
187Override this with your own preference to avoid using doxygen."
188----
189{{>A:classdecl:doxygen-function-group-start}}
190----
191
192template comment-function-group-end :indent :blank
193"Used for putting comments in front of a functional group of declarations.
194Override this with your own preference to avoid using doxygen."
195----
196{{>A:classdecl:doxygen-function-group-end}}
197----
198
199context declaration
200
201template comment-function :indent :blank
202"Used to put a nice comment in front of a function.
203Override this with your own preference to avoid using doxygen"
204----
205{{>A:declaration:doxygen-function}}
206----
207
208;;; DOXYGEN FEATURES
209;;
210;;
211context classdecl
212
213prompt GROUPNAME "Name of declaration group: "
214
215template doxygen-function-group-start :indent :blank
216----
217/**
218 * {{?GROUPNAME}}
219 * @{
220 */
221
222----
223
224template doxygen-function-group-end :indent :blank
225----
226/**
227 * @}
228 */
229
230----
231
232context declaration
233
234template doxygen-function :indent :blank
235----
236/**
237 * @name {{NAME}} - {{DOC}}{{^}}{{#ARGS}}
238 * @param {{NAME}} - {{DOC}}{{/ARGS}}
239 * @return {{TYPE}}
240 */
241----
242
243template doxygen-variable-same-line
244----
245/**< {{DOC}}{{^}} */
246----
247
248template doxygen-section-comment :blank :indent
249"Insert a comment that separates sections of an Emacs Lisp file."
250----
251
252/** {{?TITLE}}
253 *
254 * {{^}}
255 */
256
257----
258
259
260;; end
diff --git a/etc/srecode/default.srt b/etc/srecode/default.srt
new file mode 100644
index 00000000000..a4fae80f6a2
--- /dev/null
+++ b/etc/srecode/default.srt
@@ -0,0 +1,63 @@
1;;; default.srt --- SRecode templates for srecode-template-mode
2
3;; Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "default"
23
24set comment_start "#"
25
26set COPYRIGHT "This program is free software; you can redistribute it and/or
27modify it under the terms of the GNU General Public License as
28published by the Free Software Foundation; either version 2, or (at
29your option) any later version.
30
31This program is distributed in the hope that it will be useful, but
32WITHOUT ANY WARRANTY; without even the implied warranty of
33MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34General Public License for more details.
35
36You should have received a copy of the GNU General Public License
37along with this program; see the file COPYING. If not, write to
38the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
39Boston, MA 02110-1301, USA."
40
41set DOLLAR "$"
42
43context file
44
45template copyright
46----
47{{COPYRIGHT:srecode-comment-prefix}}
48----
49
50template filecomment :file :user :time
51----
52{{comment_start}} {{FILENAME}} --- {{^}}
53{{comment_prefix}}
54{{comment_prefix}} Copyright (C) {{YEAR}} {{?AUTHOR}}
55{{comment_prefix}}
56{{comment_prefix}} Author: {{AUTHOR}} <{{EMAIL}}>{{#RCS}}
57{{comment_prefix}} X-RCS: {{DOLLAR}}Id{{DOLLAR}}{{/RCS}}
58{{comment_prefix}}
59{{>:copyright}}
60{{comment_end}}
61----
62
63;; end \ No newline at end of file
diff --git a/etc/srecode/doc-cpp.srt b/etc/srecode/doc-cpp.srt
new file mode 100644
index 00000000000..c7933447b68
--- /dev/null
+++ b/etc/srecode/doc-cpp.srt
@@ -0,0 +1,84 @@
1;; doc-c.srt --- SRecode templates for "document" applications
2
3;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "c++-mode"
23
24set application "document"
25context declaration
26
27;;; Notes on the DOCUMENT templates.
28;;
29;; These templates recycle existing templates for doxygen in the
30;; more general C++ template set.
31
32template section-comment :indent :blank
33"A comment separating major sections of a file."
34----
35{{>:declaration:doxygen-section-comment}}
36----
37
38template function-comment :tag :indent :blank
39"A comment occuring in front of a function.
40Recycle doxygen comment code from the more general template set."
41----
42{{>:declaration:doxygen-function}}
43----
44
45template variable-same-line-comment :tag
46"A comment occuring after a veriable declaration.
47Recycle doxygen comment code from the more general template set."
48----
49{{>:declaration:doxygen-variable-same-line}}
50----
51
52;; These happen to be the same as in a classdecl.
53template group-comment-start :blank :indent
54"A comment occuring in front of a group of declarations.
55Recycle doxygen comment code from the more general template set."
56----
57{{>:classdecl:doxygen-function-group-start}}
58----
59
60template group-comment-end :blank :indent
61"A comment occuring at the end of a a group of declarations.
62Recycle doxygen comment code from the more general template set."
63----
64{{>:classdecl:doxygen-function-group-end}}
65----
66
67;; Some templates only show up in classdecls.
68context classdecl
69
70template group-comment-start :blank :indent
71"A comment occuring in front of a group of declarations.
72Recycle doxygen comment code from the more general template set."
73----
74{{>:classdecl:doxygen-function-group-start}}
75----
76
77template group-comment-end :blank :indent
78"A comment occuring at the end of a a group of declarations.
79Recycle doxygen comment code from the more general template set."
80----
81{{>:classdecl:doxygen-function-group-end}}
82----
83
84;; end
diff --git a/etc/srecode/doc-default.srt b/etc/srecode/doc-default.srt
new file mode 100644
index 00000000000..76cae314305
--- /dev/null
+++ b/etc/srecode/doc-default.srt
@@ -0,0 +1,80 @@
1;; doc-default.srt --- SRecode templates for "document" applications
2
3;; Copyright (C) 2009 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "default"
23
24set application "document"
25
26context declaration
27
28template section-comment :blank :indent
29"A comment occuring in front of a group of declarations."
30----
31{{comment_start}} {{?TITLE}}
32{{comment_prefix}}
33{{comment_prefix}} {{^}}
34{{comment_end}}
35----
36
37template function-comment :tag :indent :blank
38"A comment occuring in front of a function."
39----
40{{comment_start}} {{?NAME}} --
41{{DOC:srecode-comment-prefix}}
42{{comment_end}}
43----
44
45template variable-same-line-comment :tag
46"A comment occuring after a veriable declaration."
47----
48{{comment_start}} {{?DOC}} {{comment_end}}
49----
50
51;; These happen to be the same as in a classdecl.
52template group-comment-start :blank :indent
53"A comment occuring in front of a group of declarations."
54----
55{{comment_start}} {{?GROUPNAME}} --
56{{comment_end}}
57----
58
59template group-comment-end :indent
60"A comment occuring at the end of a a group of declarations."
61----
62{{comment_start}} End {{?GROUPNAME}} {{comment_end}}
63----
64
65;; Some templates only show up in classdecls.
66context classdecl
67
68template group-comment-start :blank :indent
69"A comment occuring in front of a group of declarations."
70----
71{{>:declaration:group-comment-start}}
72----
73
74template group-comment-end :indent
75"A comment occuring at the end of a a group of declarations."
76----
77{{>:declaration:group-comment-end}}
78----
79
80;; end \ No newline at end of file
diff --git a/etc/srecode/doc-java.srt b/etc/srecode/doc-java.srt
new file mode 100644
index 00000000000..727ff09ba0e
--- /dev/null
+++ b/etc/srecode/doc-java.srt
@@ -0,0 +1,85 @@
1;; doc-java.srt --- SRecode templates for "document" applications
2
3;; Copyright (C) 2009 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "java-mode"
23
24set application "document"
25
26context declaration
27
28;;; Notes on the DOCUMENT templates.
29;;
30;; These templates recycle existing templates for javadoc in the
31;; more general C++ template set.
32
33template section-comment :indent :blank
34"A comment separating major sections of a file."
35----
36{{>:declaration:javadoc-section-comment}}
37----
38
39template function-comment :tag :indent :blank
40"A comment occuring in front of a function.
41Recycle javadoc comment code from the more general template set."
42----
43{{>:declaration:javadoc-function}}
44----
45
46template variable-same-line-comment :tag
47"A comment occuring after a veriable declaration.
48Recycle javadoc comment code from the more general template set."
49----
50{{>:declaration:javadoc-variable-same-line}}
51----
52
53;; These happen to be the same as in a classdecl.
54template group-comment-start :blank :indent
55"A comment occuring in front of a group of declarations.
56Recycle javadoc comment code from the more general template set."
57----
58{{>:classdecl:javadoc-function-group-start}}
59----
60
61template group-comment-end :blank :indent
62"A comment occuring at the end of a a group of declarations.
63Recycle javadoc comment code from the more general template set."
64----
65{{>:classdecl:javadoc-function-group-end}}
66----
67
68;; Some templates only show up in classdecls.
69context classdecl
70
71template group-comment-start :blank :indent
72"A comment occuring in front of a group of declarations.
73Recycle javadoc comment code from the more general template set."
74----
75{{>:classdecl:javadoc-function-group-start}}
76----
77
78template group-comment-end :blank :indent
79"A comment occuring at the end of a a group of declarations.
80Recycle javadoc comment code from the more general template set."
81----
82{{>:classdecl:javadoc-function-group-end}}
83----
84
85;; end
diff --git a/etc/srecode/ede-make.srt b/etc/srecode/ede-make.srt
new file mode 100644
index 00000000000..e0d6f734db4
--- /dev/null
+++ b/etc/srecode/ede-make.srt
@@ -0,0 +1,49 @@
1;; ede-make.srt --- SRecode templates for Makefiles used by EDE.
2
3;; Copyright (C) 2008 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "makefile-mode"
23set escape_start "{{"
24set escape_end "}}"
25set application "ede"
26
27context file
28
29template ede-empty :file
30----
31# Automatically Generated {{FILE}} by EDE.
32# For use with: {{MAKETYPE}}
33#
34# DO NOT MODIFY THIS FILE OR YOUR CHANGES MAY BE LOST.
35# EDE is the Emacs Development Environment.
36# http://cedet.sourceforge.net/ede.shtml
37#
38
39----
40
41context declaration
42
43template ede-vars
44----
45{{#VARIABLE}}
46{{NAME}}={{#VALUE}} {{VAL}}{{/VALUE}}{{/VARIABLE}}
47----
48
49;; end \ No newline at end of file
diff --git a/etc/srecode/el.srt b/etc/srecode/el.srt
new file mode 100644
index 00000000000..5bd3538be63
--- /dev/null
+++ b/etc/srecode/el.srt
@@ -0,0 +1,311 @@
1;;; el.srt --- SRecode templates for Emacs Lisp mode
2
3;; Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
4
5;; Author: Eric Ludlam <zappo@gnu.org>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set escape_start "$"
23set escape_end "$"
24
25set mode "emacs-lisp-mode"
26
27set comment_start ";;;"
28set comment_prefix ";;"
29set comment_end ""
30
31set DOLLAR "$"
32
33context file
34
35template section-comment :blank
36"Insert a comment that separates sections of an Emacs Lisp file."
37----
38
39;;; $^$
40;;
41
42----
43bind "s"
44
45
46template empty :user :time :file
47"Insert a skeleton for an Emacs Lisp file."
48----
49$>:filecomment$
50
51;;; Commentary:
52;;
53;; $^$
54
55;;; Code:
56
57
58(provide '$FILE$)
59
60;;; $FILENAME$ ends here
61
62----
63
64prompt MODESYM "Major Mode Symbol (sans -mode): "
65prompt MODENAME "Nice Name of mode: " defaultmacro "MODESYM"
66prompt MODEEXTENSION "File name extension for mode: "
67
68template major-mode :file :blank :indent
69"Insert the framework needed for a major mode."
70sectiondictionary "FONTLOCK"
71set NAME macro "MODESYM" "-mode-font-lock-keywords"
72set DOC "Keywords for use with srecode macros and font-lock."
73sectiondictionary "MODEHOOK"
74set NAME macro "MODESYM" "-mode-hook"
75set DOC "Hook run when " macro "MODESYM" " starts."
76set GROUP macro "MODESYM" "-mode"
77set CUSTOMTYPE "'hook"
78sectiondictionary "MODEFCN"
79set NAME macro "MODESYM" "-mode"
80set DOC "Major-mode for " macro "MODESYM" "-mode buffers."
81set INTERACTIVE ""
82----
83$>:declaration:defgroup$
84
85$>:syntax-table$
86
87$<FONTLOCK:declaration:variable$
88 '(
89 )
90$/FONTLOCK$
91
92$>:declaration:keymap$
93
94$<MODEHOOK:declaration:variable-option$nil$/MODEHOOK$
95
96;;;###autoload
97$<MODEFCN:declaration:function$
98 (interactive)
99 (kill-all-local-variables)
100 (setq major-mode '$MODESYM$-mode
101 mode-name "$?MODENAME$"
102 comment-start ";;"
103 comment-end "")
104 (set (make-local-variable 'comment-start-skip)
105 "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
106 (set-syntax-table $MODESYM$-mode-syntax-table)
107 (use-local-map $MODESYM$-mode-map)
108 (set (make-local-variable 'font-lock-defaults)
109 '($MODESYM$-mode-font-lock-keywords
110 nil ;; perform string/comment fontification
111 nil ;; keywords are case sensitive.
112 ;; This puts _ & - as a word constituant,
113 ;; simplifying our keywords significantly
114 ((?_ . "w") (?- . "w"))))
115 (run-hooks '$MODESYM$-mode-hook)
116$/MODEFCN$
117
118;;;###autoload
119(add-to-list 'auto-mode-alist '("\\.$?MODEEXTENSION$$DOLLAR$" . $MODESYM$-mode))
120
121$<A:section-comment$Commands for $MODESYM$$/A$
122
123$<B:section-comment$Utils for $MODESYM$$/B$
124----
125
126template syntax-table
127"Create a syntax table."
128sectiondictionary "A"
129set NAME macro "?MODESYM" "-mode-syntax-table"
130set DOC "Syntax table used in " macro "?MODESYM" " buffers."
131----
132$<A:declaration:variable$
133 (let ((table (make-syntax-table (standard-syntax-table))))
134 (modify-syntax-entry ?\; ". 12" table) ;; SEMI, Comment start ;;
135 (modify-syntax-entry ?\n ">" table) ;; Comment end
136 (modify-syntax-entry ?\" "\"" table) ;; String
137 (modify-syntax-entry ?\- "_" table) ;; Symbol
138 (modify-syntax-entry ?\\ "\\" table) ;; Quote
139 (modify-syntax-entry ?\` "'" table) ;; Prefix ` (backquote)
140 (modify-syntax-entry ?\' "'" table) ;; Prefix ' (quote)
141 (modify-syntax-entry ?\, "'" table) ;; Prefix , (comma)
142
143 table)
144$/A$
145----
146
147
148context declaration
149
150template include :blank
151"Insert a require statement."
152----
153(require '$?NAME$)
154----
155bind "i"
156
157template include-protected :blank
158"Insert a require statement."
159----
160(condition-case nil
161 (require '$?NAME$)
162 (error nil))
163----
164
165prompt INTERACTIVE "Is this an interactive function? " default " (interactive)\n " read y-or-n-p
166prompt NAME "Name: " defaultmacro "PRENAME"
167
168template function :el :indent :blank
169"Insert a defun outline."
170----
171(defun $?NAME$ ($#ARGS$$NAME$$#NOTLAST$ $/NOTLAST$$/ARGS$)
172 "$DOC$"
173$?INTERACTIVE$$^$
174 )
175----
176bind "f"
177
178
179template variable :el :indent :blank
180"Inert a variable.
181DOC is optional."
182----
183(defvar $?NAME$ $^$
184 "$DOC$")
185----
186bind "v"
187
188template variable-const :el :indent :blank
189"Inert a variable."
190----
191(defconst $?NAME$ $^$
192 "$DOC$")
193----
194
195template variable-option :el :el-custom :indent :blank
196"Inert a variable created using defcustom."
197----
198(defcustom $?NAME$ $^$
199 "*$DOC$"
200 :group $GROUP$
201 :type $?CUSTOMTYPE$)
202----
203bind "o"
204
205template class :el :indent :blank
206"Insert a new class."
207----
208(defclass $?NAME$ ()
209 (($?ARG1$ :initarg :$ARG1$
210 :documentation
211 "$^$")
212 )
213 "Class $NAME$ ")
214----
215bind "c"
216
217template class-tag :el :indent :blank
218"Insert a new class."
219----
220(defclass $?NAME$ ($#PARENTS$$NAME$ $/PARENTS$)
221 ($^$
222 )
223 "Class $NAME$ ")
224----
225
226template method :el :ctxt :indent :blank
227"Insert a new method."
228----
229(defmethod $?NAME$ ((this $?PARENT$))
230 "$DOC$"
231 $^$
232 )
233----
234bind "m"
235
236template method-tag :el :ctxt :indent :blank
237"Insert a new method for tag inserter."
238----
239(defmethod $NAME$ ($#ARGS$$#FIRST$($NAME$ $PARENT$)$/FIRST$$#NOTFIRST$ $NAME$$/NOTFIRST$$/ARGS$)
240 "$DOC$"
241 $^$
242 )
243----
244
245prompt NAME "Method to Override: " defaultmacro "PRENAME" read mode-local-read-function
246prompt PARENT "Major Mode for binding: " defaultmacro "MODESYM"
247
248;; Note: PARENT is used for override methods and for classes. Handy!
249template modelocal :el :ctxt :indent :blank
250"Insert a new mode-local function."
251----
252(define-mode-local-override $?NAME$ $?PARENT$ ()
253 "$DOC$"
254 $^$)
255----
256bind "l"
257
258
259template defgroup :indent :blank
260"Create a custom group."
261----
262(defgroup $?MODESYM$-mode nil
263 "$MODESYM$ group."
264 :group 'langauges)
265----
266bind "g"
267
268
269template keymap :indent :blank
270"Insert a keymap of some sort"
271----
272(defvar $?MODESYM$-mode-map
273 (let ((km (make-sparse-keymap)))
274 (define-key km "\C-c\C-c" '$MODESYM$-mode$^$)
275 km)
276 "Keymap used in `$MODESYM$-mode'.")
277----
278bind "k"
279
280
281context classdecl
282
283prompt NAME "Slot Name: "
284
285template variable-tag :indent :indent :blank
286"A field in a class."
287----
288($?NAME$ :initarg :$NAME$
289 $#DEFAULTVALUE$:initform $VALUE$$/DEFAULTVALUE$
290 :documentation
291 "$DOC$")
292
293----
294
295template variable :indent :indent :blank
296"A field in a class."
297----
298($?NAME$ :initarg :$NAME$
299 :initform nil
300 :type list
301 :documentation
302 "$DOC$")
303
304----
305bind "s"
306
307
308
309;; end
310
311
diff --git a/etc/srecode/getset-cpp.srt b/etc/srecode/getset-cpp.srt
new file mode 100644
index 00000000000..089f803ea3e
--- /dev/null
+++ b/etc/srecode/getset-cpp.srt
@@ -0,0 +1,50 @@
1;;; getset-cpp.srt --- SRecode templates for C++ class getter/setters.
2
3;; Copyright (C) 2007, 2008 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "c++-mode"
23set application "getset"
24
25context declaration
26
27template getset-in-class :tag :indent :blank
28----
29{{>A:classdecl:comment-function-group-start}}
30{{TYPE}} get{{NICENAME}}() const {
31 return {{NAME}};
32}
33void set{{NICENAME}}({{TYPE}} {{NICENAME}}) {
34 {{NAME}} = {{NICENAME}};
35}
36{{>A:classdecl:comment-function-group-end}}
37----
38
39template getset-field :blank :indent
40----
41{{?TYPE}} f{{?NAME}};
42----
43
44template getset-initializer :indent
45----
46f{{NAME}}(){{#NOTLAST}},{{/NOTLAST}}
47----
48
49;; end
50
diff --git a/etc/srecode/java.srt b/etc/srecode/java.srt
new file mode 100644
index 00000000000..764c6fb1ed5
--- /dev/null
+++ b/etc/srecode/java.srt
@@ -0,0 +1,181 @@
1;; java.srt
2
3;; Copyright (C) 2009 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "java-mode"
23set escape_start "{{"
24set escape_end "}}"
25
26context file
27
28set comment_start "/**"
29set comment_end " */"
30set comment_prefix " *"
31
32template empty :file :user :time :java :indent
33"Fill out an empty file."
34sectiondictionary "CLASSSECTION"
35set NAME macro "FILENAME_AS_CLASS"
36----
37{{>:filecomment}}
38
39package {{FILENAME_AS_PACKAGE}};
40
41{{>CLASSSECTION:declaration:class}}
42
43----
44bind "e"
45
46context declaration
47
48template import :blank :indent
49"Template to import a package."
50----
51{{>:declaration:include}}
52----
53bind "i"
54
55template class :blank :indent
56"Template to declare a variable."
57sectiondictionary "DOCSECTION"
58set NAME macro "NAME"
59----
60{{>DOCSECTION:declaration:javadoc-class}}
61public class {{?NAME}} {
62
63 {{^}}
64
65} // {{NAME}}
66----
67bind "c"
68
69;;; Semantic Tag support
70;;
71template class-tag :indent :blank
72"Insert a Java class with the expectation of it being used by a tag inserter.
73Override this to affect applications, or the outer class structure for
74the user-facing template."
75----
76{{>:declaration:javadoc-class}}
77public Class {{?NAME}} {{#PARENTS}}{{#FIRST}}extends {{/FIRST}}{{#NOTFIRST}}implements {{/NOTFIRST}}{{NAME}}{{/PARENTS}}
78{
79 {{^}}
80};
81----
82
83template include :blank
84"An include statement."
85----
86import {{NAME}};
87----
88
89context misc
90
91template arglist
92"Insert an argument list for a function.
93@todo - Support smart CR in a buffer for not too long lines."
94----
95({{#ARGS}}{{TYPE}} {{NAME}}{{#NOTLAST}},{{/NOTLAST}}{{/ARGS}})
96----
97
98context classdecl
99
100template function :indent :blank
101----
102public {{?TYPE}} {{?NAME}}{{>:misc:arglist}} {
103{{^}}
104}
105----
106bind "m"
107
108template variable :indent :blank
109"Insert a variable declaration."
110----
111{{?TYPE}} {{?NAME}}{{#HAVEDEFAULT}} = {{DEFAULT}}{{/HAVEDEFAULT}};
112----
113bind "v"
114
115;;; Java Doc Comments
116;;
117context classdecl
118
119prompt GROUPNAME "Name of declaration group: "
120
121template javadoc-function-group-start :indent :blank
122----
123/**
124 * {{?GROUPNAME}}
125 * @{
126 */
127
128----
129
130template javadoc-function-group-end :indent :blank
131----
132/**
133 * @}
134 */
135
136----
137
138context declaration
139
140template javadoc-class :indent :blank :time :user :tag
141----
142/**
143 * {{DOC}}{{^}}
144 *
145 * Created: {{DATE}}
146 *
147 * @author {{AUTHOR}}
148 * @version
149 * @since
150 */
151----
152
153template javadoc-function :indent :blank :tag
154----
155/**
156 * {{DOC}}{{^}}
157 * {{#ARGS}}
158 * @param {{?NAME}} - {{DOC}}{{/ARGS}}
159 * @return {{TYPE}}{{#THROWS}}
160 * @exception {{NAME}} - {{EXDOC}}{{/THROWS}}
161 */
162----
163
164template javadoc-variable-same-line
165----
166/**< {{DOC}}{{^}} */
167----
168
169template javadoc-section-comment :blank :indent
170"Insert a comment that separates sections of an Emacs Lisp file."
171----
172
173/** {{?TITLE}}
174 *
175 * {{^}}
176 */
177
178----
179
180
181;; end \ No newline at end of file
diff --git a/etc/srecode/make.srt b/etc/srecode/make.srt
new file mode 100644
index 00000000000..3c9440b7917
--- /dev/null
+++ b/etc/srecode/make.srt
@@ -0,0 +1,79 @@
1;; make.srt
2
3;; Copyright (C) 2009 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "makefile-mode"
23set escape_start "{{"
24set escape_end "}}"
25set comment_start "#"
26set comment_prefix "#"
27set TAB "\t"
28
29context file
30
31template empty :file :user
32----
33{{>:filecomment}}
34
35all: {{^}}
36
37{{comment_start}} end
38----
39
40context declaration
41
42;; GNU Make has real functions you can define, but semantic uses
43;; 'function for rules. This is unfortunate, and should be fixed.
44template rule :blank
45----
46{{?NAME}}:
47{{TAB}}{{^}}
48----
49bind "r"
50
51template inferencerule :blank
52----
53%.{{?SRCEXTENSION}}: %.{{?DESTEXTENSION}}
54{{TAB}}{{^}}
55----
56bind "i"
57
58template phonyrule :blank
59----
60.PHONY {{?NAME}}
61{{NAME}}:
62{{TAB}}{{^}}
63----
64bind "p"
65
66
67template variable :blank
68"Insert a variable declaration."
69----
70{{?NAME}}:= {{^}}
71----
72bind "v"
73
74template include :blank
75----
76include {{?NAME}}
77----
78
79;; end \ No newline at end of file
diff --git a/etc/srecode/template.srt b/etc/srecode/template.srt
new file mode 100644
index 00000000000..87cce2f3199
--- /dev/null
+++ b/etc/srecode/template.srt
@@ -0,0 +1,224 @@
1;;; template.srt --- Templates for Semantic Recoders
2
3;; Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
4
5;; Author: Eric Ludlam <zappo@gnu.org>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set escape_start "$"
23set escape_end "$"
24set mode "srecode-template-mode"
25set priority "70"
26
27set comment_start ";;"
28set comment_end ""
29set comment_prefix ";;"
30
31set SEPARATOR "----"
32
33set DOLLAR "$"
34
35context file
36
37prompt MAJORMODE "Major Mode for templates: " read srecode-read-major-mode-name
38prompt START "Escape Start Characters: " default "{{"
39prompt END "Escape End Characters: " default "}}"
40
41template empty :file :user :time :srt
42"Insert a skeleton for a template file."
43----
44$>:filecomment$
45
46set mode "$?MAJORMODE$"
47set escape_start "$?START$"
48set escape_end "$?END$"
49
50context file
51
52$^$
53
54
55;; end
56----
57
58template mode-basics :srt
59"Fill out a full template including parts for basic new mode stuff."
60sectiondictionary "E"
61set NAME "empty :file :user :time"
62set DOC "Fill out an empty file."
63set KEY "e"
64sectiondictionary "C1"
65set NAME "declaration"
66sectiondictionary "DTF"
67set NAME "function :blank :indent"
68set DOC "Template to declare a function."
69set KEY "f"
70sectiondictionary "DTV"
71set NAME "variable :blank :indent"
72set DOC "Template to declare a variable."
73set KEY "v"
74sectiondictionary "PR"
75set NAME "NAME"
76set PROMPT "Name for declaration: "
77----
78$>:declaration:commentchars$
79
80$<E:declaration:function$
81$ESCAPE_START$>:filecomment$ESCAPE_END$
82$/E$
83
84$>C1:declaration:context$
85
86$>PR:declaration:prompt$
87
88$>DTF:declaration:function$
89$>DTV:declaration:function$
90----
91bind "m"
92
93
94context declaration
95
96prompt NAME "Name of new template: "
97prompt KEY "Key Binding: " read read-char
98
99template function :blank
100"Insert a template block for Srecoder templates."
101----
102template $?NAME$$#ARG$$NAME$$/ARG$
103"$DOC$"
104$SEPARATOR$
105$^$
106$SEPARATOR$
107bind "$?KEY$"
108----
109bind "f"
110
111prompt NAME "Name of new variable: "
112
113template variable :blank
114"Inert a variable."
115----
116set $?NAME$ "$^$"
117----
118bind "v"
119
120template prompt :blank
121"Insert a prompt."
122----
123prompt $?NAME$ "$?PROMPT$"
124----
125bind "p"
126
127template priority :blank
128"Insert a priority statemept."
129----
130set priority $^$
131----
132
133template application :blank
134"Insert a priority statemept."
135----
136set application "$^$"
137----
138
139template context :blank
140"Insert a context statement."
141----
142context $NAME$
143----
144bind "c"
145
146template commentchars :blank
147"Insert the variables for handling comments."
148----
149set comment_start ""
150set comment_end ""
151set comment_prefix ""
152----
153
154context code
155
156prompt NAME "Name of variable: " read srecode-read-variable-name
157
158template variable :srt
159"Insert a variable with completion from the current file."
160----
161$ESCAPE_START$$?NAME$$ESCAPE_END$
162----
163bind "v"
164
165prompt NAME "Name of macro: "
166
167template ask :srt
168"Insert a prompting variable."
169----
170$ESCAPE_START$?$?NAME$$ESCAPE_END$
171----
172bind "a"
173
174template comment :srt
175----
176$ESCAPE_START$!$^$$ESCAPE_END$
177----
178bind "c"
179
180prompt TEMPLATE "Template to include: " read srecode-read-template-name
181
182template include :srt
183----
184$ESCAPE_START$>:$?TEMPLATE$$ESCAPE_END$
185----
186bind "i"
187
188template includewrap :srt
189----
190$ESCAPE_START$<:$?TEMPLATE$$ESCAPE_END$$^$$ESCAPE_START$/$NAME$$ESCAPE_END$
191----
192bind "w"
193
194template point :srt
195----
196$ESCAPE_START$^$ESCAPE_END$
197----
198bind "p"
199
200template section :srt
201"Insert a section, or looping construct."
202----
203$ESCAPE_START$#$?NAME$$ESCAPE_END$
204$^$
205$ESCAPE_START$/$NAME$$ESCAPE_END$
206----
207bind "s"
208
209template escape-start-quoted :srt
210"Escape Start"
211----
212$ESCAPE_START$ESCAPE_START$ESCAPE_END$
213----
214bind "q"
215
216template escape-end-quoted :srt
217"Escape Start"
218----
219$ESCAPE_START$ESCAPE_END$ESCAPE_END$
220----
221bind "e"
222
223
224;; end
diff --git a/etc/srecode/test.srt b/etc/srecode/test.srt
new file mode 100644
index 00000000000..4c68f8ba176
--- /dev/null
+++ b/etc/srecode/test.srt
@@ -0,0 +1,148 @@
1;; test.srt --- SRecode templates for testing
2
3;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "srecode-template-mode"
23set escape_start "$"
24set escape_end "$"
25set application "tests"
26
27set UTESTVAR1 ".SRT VAR 1"
28;;
29;; These are for testing features of template files.
30;;
31context test
32
33template test :user
34----
35$! This is a comment in the template. $
36;; $AUTHOR$
37;; $AUTHOR:upcase$
38----
39
40template subs :blank
41----
42;; Before Loop
43$#LOOP$
44;; - loop stuff
45$/LOOP$
46;; After Loop
47----
48
49;; Before insertion
50;; After insertion
51
52template firstlast
53sectiondictionary "A"
54set MOOSE "FIRST"
55sectiondictionary "A"
56set MOOSE "MIDDLE"
57sectiondictionary "A"
58set MOOSE "LAST"
59----
60$#A$
61;; << -- $MOOSE$
62$#FIRST$;; I'm First$/FIRST$
63$#NOTFIRST$;; I'm Not First$/NOTFIRST$
64$#LAST$;; I'm Last$/LAST$
65$#NOTLAST$;; I'm Not Last$/NOTLAST$
66;; -- >>
67$/A$
68----
69
70
71template wrapsomething :region
72----
73;; Put this line in front:
74$REGIONTEXT$
75;; Put this line at the end:
76----
77
78template gapsomething :blank
79----
80### ALL ALONE ON A LINE ###
81----
82
83template inlinetext
84"Insert text that has no nelines"
85----
86 *In the middle*
87----
88
89template includable :blank
90----
91;; An includable $COMMENT$ we could use.
92;; $^$
93;; Text after a point inserter.
94----
95
96template wrapinclude-basic
97----
98$>WI1:includable$
99----
100
101template wrapinclude-around
102----
103$<WI1:includable$Intermediate Comments$/WI1$
104----
105
106template complex-subdict
107sectiondictionary "A"
108set MYVAR1 "cow"
109set MYVAR2 "dog"
110set CPLX "I have a " macro "MYVAR1" " and a " macro "MYVAR2" "."
111----
112;; $#A$$CPLX$$/A$
113----
114
115template wrap-new-template
116sectiondictionary "NEWTMP"
117set DOC "A nice doc string goes here."
118----
119$<NEWTMP:declaration:function$Random text in the new template
120$/NEWTMP$
121----
122
123template column-data
124sectiondictionary "A"
125set MOOSE "FIRST"
126sectiondictionary "A"
127set MOOSE "VERY VERY LONG STRING THAT WILL BE CROPPED."
128sectiondictionary "A"
129set MOOSE "MIDDLE"
130sectiondictionary "A"
131set MOOSE "S"
132sectiondictionary "A"
133set MOOSE "LAST"
134----
135Table of Values:
136Left Justified | Right Justified$#A$
137$|MOOSE:20:right$ | $|MOOSE:20:left$$/A$
138----
139
140template custom-arg-handler :utest
141sectiondictionary "A"
142set MOOSE "why"
143----
144OUTSIDE SECTION: $UTESTVAR1$
145INSIDE SECTION: $#A$$UTESTVAR1$$/A$
146----
147
148;; end \ No newline at end of file
diff --git a/etc/srecode/texi.srt b/etc/srecode/texi.srt
new file mode 100644
index 00000000000..2a225e133a4
--- /dev/null
+++ b/etc/srecode/texi.srt
@@ -0,0 +1,173 @@
1;; texi.srt --- SRecode templates for Texinfo
2
3;; Copyright (C) 2008 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "texinfo-mode"
23
24set escape_start "$"
25set escape_end "$"
26set DOLLAR "$"
27
28context file
29
30prompt NAME "Name of manual: "
31
32template empty :file :user :time
33"Fill a new texinfo file with some baseline stuff."
34----
35\input texinfo @c -*-texinfo-*-
36$#RCS$
37@c
38@c $Id: srecode-texi.srt,v 1.5 2009/01/01 19:01:42 zappo Exp $
39@c
40$/RCS$
41@c %**start of header
42@setfilename $FILE$.info
43@set TITLE $?NAME$
44@set AUTHOR $?AUTHOR$
45@settitle @value{TITLE}
46@c %**end of header
47
48@ifinfo
49@format
50START-INFO-DIR-ENTRY
51* $FILE$: ($FILE$). $NAME$
52END-INFO-DIR-ENTRY
53@end format
54@end ifinfo
55
56@titlepage
57@sp 10
58@center @titlefont{$FILE$}
59@vskip 0pt plus 1 fill
60Copyright @copyright{} $YEAR$ $AUTHOR$
61@end titlepage
62
63@node Top
64@top @value{TITLE}
65
66$^$
67
68@menu
69* Index::
70@end menu
71
72
73
74
75@node Index
76@chapter Index
77
78@contents
79
80@bye
81----
82
83prompt NAME "Name of item: "
84
85context declaration
86
87;; Note to self: It would be cool to replace the junk in
88;; semantic/document.el with macros from here.
89template function :blank :texitag
90"Import some function tag into texinfo."
91----
92
93@defun $NAME$$#ARGS$ $NAME$$/ARGS$
94@anchor{$NAME$}
95$TAGDOC$
96@end defun
97
98----
99bind "f"
100
101template function-command :blank :texitag
102"Import some function tag into texinfo."
103----
104
105@deffn Command $NAME$$#ARGS$ $NAME$$/ARGS$
106@anchor{$NAME$}
107$TAGDOC$
108@end deffn
109
110----
111bind "f"
112
113
114template variable :blank :texitag
115"Import some variable tag into texinfo"
116----
117
118@defvar $NAME$$#ARGS$ $NAME$$/ARGS$
119@anchor{$NAME$}
120$TAGDOC$
121@end defvar
122
123----
124bind "v"
125
126prompt NAME "Name of node: "
127
128template node :texi
129"Insert a node right about here."
130----
131
132@node $?NAME$
133@$?LEVEL$ $NAME$
134
135$^$
136
137----
138bind "n"
139
140template subnode :texi
141"Insert a node right about here."
142----
143
144@node $?NAME$
145@$?NEXTLEVEL$ $NAME$
146
147$^$
148
149----
150bind "n"
151
152
153template menu :blank
154"Menu items for texinfo."
155----
156
157@menu
158$^$
159@end menu
160
161----
162bind "m"
163
164prompt NAME "Menu item: "
165
166template menuitem :blank
167"Insert a menu item."
168----
169* $?NAME$:: $^$
170----
171
172
173;; end \ No newline at end of file
diff --git a/etc/srecode/wisent.srt b/etc/srecode/wisent.srt
new file mode 100644
index 00000000000..ef7cddca06a
--- /dev/null
+++ b/etc/srecode/wisent.srt
@@ -0,0 +1,94 @@
1;; wisent.srt --- SRecode templates for Emacs/WISENT grammar files.
2
3;; Copyright (C) 2007, 2008 Free Software Foundation, Inc.
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "wisent-grammar-mode"
23set comment_start ";;"
24set comment_prefix ";;"
25set comment_end ""
26
27context file
28
29template empty :file :user :time
30"Insert a skeleton for a grammar file."
31----
32{{>:filecomment}}
33
34;;; Commentary:
35;;
36;; Parser for {{?TARGETMODE}} mode
37
38%languagemode {{TARGETMODE}}-mode
39%parsetable wisent-{{TARGETMODE}}-parser-tables
40%keywordtable wisent-{{TARGETMODE}}-keywords
41%tokentable wisent-{{TARGETMODE}}-tokens
42%languagemode {{TARGETMODE}}-mode
43%setupfunction wisent-{{TARGETMODE}}-default-setup
44
45%start goal
46
47;;; KEYWORDS
48%type <keyword>
49
50%%
51
52goal
53 : {{^}}
54 ;
55
56%%
57(define-lex wisent-{{TARGETMODE}}-lexer
58 "Lexical analzer to handle {{TARGETMODE}} buffers."
59 ;; semantic-lex-newline
60 semantic-lex-ignore-whitespace
61 semantic-lex-ignore-newline
62 semantic-lex-ignore-comments
63
64 semantic-lex-default-action
65 )
66
67;; {{FILENAME}} ends here
68----
69
70context declaration
71
72template function
73----
74{{?NAME}}
75 : {{^}}
76 ;
77----
78bind "f"
79
80template keyword
81----
82%keyword {{?NAME:upcase}} "{{NAME:downcase}}"
83%put {{NAME:upcase}} summary "{{NAME}} {{^}}"
84----
85bind "k"
86
87template token
88----
89%type <{{?LEXTOKEN}}>
90%token <{{LEXTOKEN}}> {{LEXTOKEN}}
91----
92bind "t"
93
94;; end \ No newline at end of file