diff options
| author | Chong Yidong | 2009-10-03 19:28:56 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-10-03 19:28:56 +0000 |
| commit | c05676c5ac4c1722bcac8a31668f5fab2e7ae6d4 (patch) | |
| tree | 51c46490ca339b80cc72377cb26c1409bb017fc5 /etc/srecode | |
| parent | e6e267fcba9251bbb7eeb66ca55c08e47c635ab8 (diff) | |
| download | emacs-c05676c5ac4c1722bcac8a31668f5fab2e7ae6d4.tar.gz emacs-c05676c5ac4c1722bcac8a31668f5fab2e7ae6d4.zip | |
* srecode: New directory for SRecode template files.
Diffstat (limited to 'etc/srecode')
| -rw-r--r-- | etc/srecode/cpp.srt | 260 | ||||
| -rw-r--r-- | etc/srecode/default.srt | 63 | ||||
| -rw-r--r-- | etc/srecode/doc-cpp.srt | 84 | ||||
| -rw-r--r-- | etc/srecode/doc-default.srt | 80 | ||||
| -rw-r--r-- | etc/srecode/doc-java.srt | 85 | ||||
| -rw-r--r-- | etc/srecode/ede-make.srt | 49 | ||||
| -rw-r--r-- | etc/srecode/el.srt | 311 | ||||
| -rw-r--r-- | etc/srecode/getset-cpp.srt | 50 | ||||
| -rw-r--r-- | etc/srecode/java.srt | 181 | ||||
| -rw-r--r-- | etc/srecode/make.srt | 79 | ||||
| -rw-r--r-- | etc/srecode/template.srt | 224 | ||||
| -rw-r--r-- | etc/srecode/test.srt | 148 | ||||
| -rw-r--r-- | etc/srecode/texi.srt | 173 | ||||
| -rw-r--r-- | etc/srecode/wisent.srt | 94 |
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 | |||
| 22 | set mode "c++-mode" | ||
| 23 | |||
| 24 | set comment_start "/**" | ||
| 25 | set comment_end " */" | ||
| 26 | set comment_prefix " *" | ||
| 27 | |||
| 28 | ;; OVERRIDE THIS in your user or project template file to whatever | ||
| 29 | ;; you use for your project. | ||
| 30 | set HEADEREXT ".h" | ||
| 31 | |||
| 32 | context file | ||
| 33 | |||
| 34 | template empty :time :user :file :cpp | ||
| 35 | ---- | ||
| 36 | {{>:filecomment}} | ||
| 37 | |||
| 38 | {{#NOTHEADER}} | ||
| 39 | |||
| 40 | {{^}} | ||
| 41 | {{/NOTHEADER}} | ||
| 42 | {{#HEADER}} | ||
| 43 | {{>:header_guard}} | ||
| 44 | {{/HEADER}} | ||
| 45 | ---- | ||
| 46 | |||
| 47 | template header_guard :file :blank | ||
| 48 | ---- | ||
| 49 | #ifndef {{FILENAME_SYMBOL}} | ||
| 50 | #define {{FILENAME_SYMBOL}} 1 | ||
| 51 | |||
| 52 | {{^}} | ||
| 53 | |||
| 54 | #endif // {{FILENAME_SYMBOL}} | ||
| 55 | ---- | ||
| 56 | |||
| 57 | context misc | ||
| 58 | |||
| 59 | template 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 | |||
| 66 | context declaration | ||
| 67 | |||
| 68 | prompt TYPE "Return Type: " | ||
| 69 | |||
| 70 | template function :indent :blank | ||
| 71 | "Insert a function declaration." | ||
| 72 | ---- | ||
| 73 | {{?TYPE}} {{?NAME}}{{>:misc:arglist}} | ||
| 74 | {{#INITIALIZERS}}{{>B:initializers}}{{/INITIALIZERS}} | ||
| 75 | { | ||
| 76 | {{^}} | ||
| 77 | } | ||
| 78 | ---- | ||
| 79 | bind "f" | ||
| 80 | |||
| 81 | template function-prototype :indent :blank | ||
| 82 | "Insert a function declaration." | ||
| 83 | ---- | ||
| 84 | {{?TYPE}} {{?NAME}}{{>:misc:arglist}}; | ||
| 85 | ---- | ||
| 86 | |||
| 87 | |||
| 88 | prompt TYPE "Data Type: " | ||
| 89 | |||
| 90 | template variable :indent :blank | ||
| 91 | "Insert a variable declaration." | ||
| 92 | ---- | ||
| 93 | {{?TYPE}} {{?NAME}}{{#HAVEDEFAULT}} = {{DEFAULT}}{{/HAVEDEFAULT}}; | ||
| 94 | ---- | ||
| 95 | bind "v" | ||
| 96 | |||
| 97 | template variable-prototype :indent :blank | ||
| 98 | "Insert a variable declaration." | ||
| 99 | ---- | ||
| 100 | {{?TYPE}} {{?NAME}}; | ||
| 101 | ---- | ||
| 102 | bind "v" | ||
| 103 | |||
| 104 | template class :indent :blank | ||
| 105 | "Insert a C++ class. For use by user insertion. | ||
| 106 | Override this template to change contents of a class. | ||
| 107 | Override `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 | |||
| 119 | template subclass :indent :blank | ||
| 120 | "Insert a C++ subclass of some other class." | ||
| 121 | sectiondictionary "PARENTS" | ||
| 122 | set NAME "?PARENTNAME" | ||
| 123 | ---- | ||
| 124 | {{>A:class}} | ||
| 125 | ---- | ||
| 126 | |||
| 127 | template class-tag :indent :blank | ||
| 128 | "Insert a C++ class with the expectation of it being used by a tag inserter. | ||
| 129 | Override this to affect applications, or the outer class structure for | ||
| 130 | the user-facing template." | ||
| 131 | ---- | ||
| 132 | class {{?NAME}} {{#PARENTS}}{{#FIRST}}: {{/FIRST}}public {{NAME}}{{/PARENTS}} | ||
| 133 | { | ||
| 134 | {{^}} | ||
| 135 | }; | ||
| 136 | ---- | ||
| 137 | bind "c" | ||
| 138 | |||
| 139 | template 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 | |||
| 149 | template include :blank | ||
| 150 | "An include statement." | ||
| 151 | ---- | ||
| 152 | #include "{{?NAME}}" | ||
| 153 | ---- | ||
| 154 | bind "i" | ||
| 155 | |||
| 156 | template label :blank :indent | ||
| 157 | ---- | ||
| 158 | {{?NAME}}: | ||
| 159 | ---- | ||
| 160 | |||
| 161 | context classdecl | ||
| 162 | |||
| 163 | template constructor-tag :indent :blank | ||
| 164 | ---- | ||
| 165 | {{?NAME}}{{>:misc:arglist}} | ||
| 166 | { {{^}} } | ||
| 167 | ---- | ||
| 168 | |||
| 169 | ;; This one really sucks. How can I finish it? | ||
| 170 | template initializers :indent | ||
| 171 | ---- | ||
| 172 | {{#FIRST}}: | ||
| 173 | {{/FIRST}}{{INITNAME}}(){{#NOTLAST}},{{/NOTLAST}} | ||
| 174 | ---- | ||
| 175 | |||
| 176 | template destructor-tag :indent :blank | ||
| 177 | ---- | ||
| 178 | ~{{?NAME}}{{>:misc:arglist}} | ||
| 179 | { {{^}} } | ||
| 180 | ---- | ||
| 181 | |||
| 182 | ;;; Base Comment functions for overriding. | ||
| 183 | context classdecl | ||
| 184 | |||
| 185 | template comment-function-group-start :indent :blank | ||
| 186 | "Used for putting comments in front of a functional group of declarations. | ||
| 187 | Override this with your own preference to avoid using doxygen." | ||
| 188 | ---- | ||
| 189 | {{>A:classdecl:doxygen-function-group-start}} | ||
| 190 | ---- | ||
| 191 | |||
| 192 | template comment-function-group-end :indent :blank | ||
| 193 | "Used for putting comments in front of a functional group of declarations. | ||
| 194 | Override this with your own preference to avoid using doxygen." | ||
| 195 | ---- | ||
| 196 | {{>A:classdecl:doxygen-function-group-end}} | ||
| 197 | ---- | ||
| 198 | |||
| 199 | context declaration | ||
| 200 | |||
| 201 | template comment-function :indent :blank | ||
| 202 | "Used to put a nice comment in front of a function. | ||
| 203 | Override this with your own preference to avoid using doxygen" | ||
| 204 | ---- | ||
| 205 | {{>A:declaration:doxygen-function}} | ||
| 206 | ---- | ||
| 207 | |||
| 208 | ;;; DOXYGEN FEATURES | ||
| 209 | ;; | ||
| 210 | ;; | ||
| 211 | context classdecl | ||
| 212 | |||
| 213 | prompt GROUPNAME "Name of declaration group: " | ||
| 214 | |||
| 215 | template doxygen-function-group-start :indent :blank | ||
| 216 | ---- | ||
| 217 | /** | ||
| 218 | * {{?GROUPNAME}} | ||
| 219 | * @{ | ||
| 220 | */ | ||
| 221 | |||
| 222 | ---- | ||
| 223 | |||
| 224 | template doxygen-function-group-end :indent :blank | ||
| 225 | ---- | ||
| 226 | /** | ||
| 227 | * @} | ||
| 228 | */ | ||
| 229 | |||
| 230 | ---- | ||
| 231 | |||
| 232 | context declaration | ||
| 233 | |||
| 234 | template doxygen-function :indent :blank | ||
| 235 | ---- | ||
| 236 | /** | ||
| 237 | * @name {{NAME}} - {{DOC}}{{^}}{{#ARGS}} | ||
| 238 | * @param {{NAME}} - {{DOC}}{{/ARGS}} | ||
| 239 | * @return {{TYPE}} | ||
| 240 | */ | ||
| 241 | ---- | ||
| 242 | |||
| 243 | template doxygen-variable-same-line | ||
| 244 | ---- | ||
| 245 | /**< {{DOC}}{{^}} */ | ||
| 246 | ---- | ||
| 247 | |||
| 248 | template 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 | |||
| 22 | set mode "default" | ||
| 23 | |||
| 24 | set comment_start "#" | ||
| 25 | |||
| 26 | set COPYRIGHT "This program is free software; you can redistribute it and/or | ||
| 27 | modify it under the terms of the GNU General Public License as | ||
| 28 | published by the Free Software Foundation; either version 2, or (at | ||
| 29 | your option) any later version. | ||
| 30 | |||
| 31 | This program is distributed in the hope that it will be useful, but | ||
| 32 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 33 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 34 | General Public License for more details. | ||
| 35 | |||
| 36 | You should have received a copy of the GNU General Public License | ||
| 37 | along with this program; see the file COPYING. If not, write to | ||
| 38 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| 39 | Boston, MA 02110-1301, USA." | ||
| 40 | |||
| 41 | set DOLLAR "$" | ||
| 42 | |||
| 43 | context file | ||
| 44 | |||
| 45 | template copyright | ||
| 46 | ---- | ||
| 47 | {{COPYRIGHT:srecode-comment-prefix}} | ||
| 48 | ---- | ||
| 49 | |||
| 50 | template 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 | |||
| 22 | set mode "c++-mode" | ||
| 23 | |||
| 24 | set application "document" | ||
| 25 | context 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 | |||
| 32 | template section-comment :indent :blank | ||
| 33 | "A comment separating major sections of a file." | ||
| 34 | ---- | ||
| 35 | {{>:declaration:doxygen-section-comment}} | ||
| 36 | ---- | ||
| 37 | |||
| 38 | template function-comment :tag :indent :blank | ||
| 39 | "A comment occuring in front of a function. | ||
| 40 | Recycle doxygen comment code from the more general template set." | ||
| 41 | ---- | ||
| 42 | {{>:declaration:doxygen-function}} | ||
| 43 | ---- | ||
| 44 | |||
| 45 | template variable-same-line-comment :tag | ||
| 46 | "A comment occuring after a veriable declaration. | ||
| 47 | Recycle 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. | ||
| 53 | template group-comment-start :blank :indent | ||
| 54 | "A comment occuring in front of a group of declarations. | ||
| 55 | Recycle doxygen comment code from the more general template set." | ||
| 56 | ---- | ||
| 57 | {{>:classdecl:doxygen-function-group-start}} | ||
| 58 | ---- | ||
| 59 | |||
| 60 | template group-comment-end :blank :indent | ||
| 61 | "A comment occuring at the end of a a group of declarations. | ||
| 62 | Recycle 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. | ||
| 68 | context classdecl | ||
| 69 | |||
| 70 | template group-comment-start :blank :indent | ||
| 71 | "A comment occuring in front of a group of declarations. | ||
| 72 | Recycle doxygen comment code from the more general template set." | ||
| 73 | ---- | ||
| 74 | {{>:classdecl:doxygen-function-group-start}} | ||
| 75 | ---- | ||
| 76 | |||
| 77 | template group-comment-end :blank :indent | ||
| 78 | "A comment occuring at the end of a a group of declarations. | ||
| 79 | Recycle 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 | |||
| 22 | set mode "default" | ||
| 23 | |||
| 24 | set application "document" | ||
| 25 | |||
| 26 | context declaration | ||
| 27 | |||
| 28 | template 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 | |||
| 37 | template 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 | |||
| 45 | template 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. | ||
| 52 | template 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 | |||
| 59 | template 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. | ||
| 66 | context classdecl | ||
| 67 | |||
| 68 | template group-comment-start :blank :indent | ||
| 69 | "A comment occuring in front of a group of declarations." | ||
| 70 | ---- | ||
| 71 | {{>:declaration:group-comment-start}} | ||
| 72 | ---- | ||
| 73 | |||
| 74 | template 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 | |||
| 22 | set mode "java-mode" | ||
| 23 | |||
| 24 | set application "document" | ||
| 25 | |||
| 26 | context 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 | |||
| 33 | template section-comment :indent :blank | ||
| 34 | "A comment separating major sections of a file." | ||
| 35 | ---- | ||
| 36 | {{>:declaration:javadoc-section-comment}} | ||
| 37 | ---- | ||
| 38 | |||
| 39 | template function-comment :tag :indent :blank | ||
| 40 | "A comment occuring in front of a function. | ||
| 41 | Recycle javadoc comment code from the more general template set." | ||
| 42 | ---- | ||
| 43 | {{>:declaration:javadoc-function}} | ||
| 44 | ---- | ||
| 45 | |||
| 46 | template variable-same-line-comment :tag | ||
| 47 | "A comment occuring after a veriable declaration. | ||
| 48 | Recycle 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. | ||
| 54 | template group-comment-start :blank :indent | ||
| 55 | "A comment occuring in front of a group of declarations. | ||
| 56 | Recycle javadoc comment code from the more general template set." | ||
| 57 | ---- | ||
| 58 | {{>:classdecl:javadoc-function-group-start}} | ||
| 59 | ---- | ||
| 60 | |||
| 61 | template group-comment-end :blank :indent | ||
| 62 | "A comment occuring at the end of a a group of declarations. | ||
| 63 | Recycle 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. | ||
| 69 | context classdecl | ||
| 70 | |||
| 71 | template group-comment-start :blank :indent | ||
| 72 | "A comment occuring in front of a group of declarations. | ||
| 73 | Recycle javadoc comment code from the more general template set." | ||
| 74 | ---- | ||
| 75 | {{>:classdecl:javadoc-function-group-start}} | ||
| 76 | ---- | ||
| 77 | |||
| 78 | template group-comment-end :blank :indent | ||
| 79 | "A comment occuring at the end of a a group of declarations. | ||
| 80 | Recycle 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 | |||
| 22 | set mode "makefile-mode" | ||
| 23 | set escape_start "{{" | ||
| 24 | set escape_end "}}" | ||
| 25 | set application "ede" | ||
| 26 | |||
| 27 | context file | ||
| 28 | |||
| 29 | template 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 | |||
| 41 | context declaration | ||
| 42 | |||
| 43 | template 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 | |||
| 22 | set escape_start "$" | ||
| 23 | set escape_end "$" | ||
| 24 | |||
| 25 | set mode "emacs-lisp-mode" | ||
| 26 | |||
| 27 | set comment_start ";;;" | ||
| 28 | set comment_prefix ";;" | ||
| 29 | set comment_end "" | ||
| 30 | |||
| 31 | set DOLLAR "$" | ||
| 32 | |||
| 33 | context file | ||
| 34 | |||
| 35 | template section-comment :blank | ||
| 36 | "Insert a comment that separates sections of an Emacs Lisp file." | ||
| 37 | ---- | ||
| 38 | |||
| 39 | ;;; $^$ | ||
| 40 | ;; | ||
| 41 | |||
| 42 | ---- | ||
| 43 | bind "s" | ||
| 44 | |||
| 45 | |||
| 46 | template 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 | |||
| 64 | prompt MODESYM "Major Mode Symbol (sans -mode): " | ||
| 65 | prompt MODENAME "Nice Name of mode: " defaultmacro "MODESYM" | ||
| 66 | prompt MODEEXTENSION "File name extension for mode: " | ||
| 67 | |||
| 68 | template major-mode :file :blank :indent | ||
| 69 | "Insert the framework needed for a major mode." | ||
| 70 | sectiondictionary "FONTLOCK" | ||
| 71 | set NAME macro "MODESYM" "-mode-font-lock-keywords" | ||
| 72 | set DOC "Keywords for use with srecode macros and font-lock." | ||
| 73 | sectiondictionary "MODEHOOK" | ||
| 74 | set NAME macro "MODESYM" "-mode-hook" | ||
| 75 | set DOC "Hook run when " macro "MODESYM" " starts." | ||
| 76 | set GROUP macro "MODESYM" "-mode" | ||
| 77 | set CUSTOMTYPE "'hook" | ||
| 78 | sectiondictionary "MODEFCN" | ||
| 79 | set NAME macro "MODESYM" "-mode" | ||
| 80 | set DOC "Major-mode for " macro "MODESYM" "-mode buffers." | ||
| 81 | set 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 | |||
| 126 | template syntax-table | ||
| 127 | "Create a syntax table." | ||
| 128 | sectiondictionary "A" | ||
| 129 | set NAME macro "?MODESYM" "-mode-syntax-table" | ||
| 130 | set 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 | |||
| 148 | context declaration | ||
| 149 | |||
| 150 | template include :blank | ||
| 151 | "Insert a require statement." | ||
| 152 | ---- | ||
| 153 | (require '$?NAME$) | ||
| 154 | ---- | ||
| 155 | bind "i" | ||
| 156 | |||
| 157 | template include-protected :blank | ||
| 158 | "Insert a require statement." | ||
| 159 | ---- | ||
| 160 | (condition-case nil | ||
| 161 | (require '$?NAME$) | ||
| 162 | (error nil)) | ||
| 163 | ---- | ||
| 164 | |||
| 165 | prompt INTERACTIVE "Is this an interactive function? " default " (interactive)\n " read y-or-n-p | ||
| 166 | prompt NAME "Name: " defaultmacro "PRENAME" | ||
| 167 | |||
| 168 | template function :el :indent :blank | ||
| 169 | "Insert a defun outline." | ||
| 170 | ---- | ||
| 171 | (defun $?NAME$ ($#ARGS$$NAME$$#NOTLAST$ $/NOTLAST$$/ARGS$) | ||
| 172 | "$DOC$" | ||
| 173 | $?INTERACTIVE$$^$ | ||
| 174 | ) | ||
| 175 | ---- | ||
| 176 | bind "f" | ||
| 177 | |||
| 178 | |||
| 179 | template variable :el :indent :blank | ||
| 180 | "Inert a variable. | ||
| 181 | DOC is optional." | ||
| 182 | ---- | ||
| 183 | (defvar $?NAME$ $^$ | ||
| 184 | "$DOC$") | ||
| 185 | ---- | ||
| 186 | bind "v" | ||
| 187 | |||
| 188 | template variable-const :el :indent :blank | ||
| 189 | "Inert a variable." | ||
| 190 | ---- | ||
| 191 | (defconst $?NAME$ $^$ | ||
| 192 | "$DOC$") | ||
| 193 | ---- | ||
| 194 | |||
| 195 | template 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 | ---- | ||
| 203 | bind "o" | ||
| 204 | |||
| 205 | template 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 | ---- | ||
| 215 | bind "c" | ||
| 216 | |||
| 217 | template class-tag :el :indent :blank | ||
| 218 | "Insert a new class." | ||
| 219 | ---- | ||
| 220 | (defclass $?NAME$ ($#PARENTS$$NAME$ $/PARENTS$) | ||
| 221 | ($^$ | ||
| 222 | ) | ||
| 223 | "Class $NAME$ ") | ||
| 224 | ---- | ||
| 225 | |||
| 226 | template method :el :ctxt :indent :blank | ||
| 227 | "Insert a new method." | ||
| 228 | ---- | ||
| 229 | (defmethod $?NAME$ ((this $?PARENT$)) | ||
| 230 | "$DOC$" | ||
| 231 | $^$ | ||
| 232 | ) | ||
| 233 | ---- | ||
| 234 | bind "m" | ||
| 235 | |||
| 236 | template 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 | |||
| 245 | prompt NAME "Method to Override: " defaultmacro "PRENAME" read mode-local-read-function | ||
| 246 | prompt PARENT "Major Mode for binding: " defaultmacro "MODESYM" | ||
| 247 | |||
| 248 | ;; Note: PARENT is used for override methods and for classes. Handy! | ||
| 249 | template modelocal :el :ctxt :indent :blank | ||
| 250 | "Insert a new mode-local function." | ||
| 251 | ---- | ||
| 252 | (define-mode-local-override $?NAME$ $?PARENT$ () | ||
| 253 | "$DOC$" | ||
| 254 | $^$) | ||
| 255 | ---- | ||
| 256 | bind "l" | ||
| 257 | |||
| 258 | |||
| 259 | template defgroup :indent :blank | ||
| 260 | "Create a custom group." | ||
| 261 | ---- | ||
| 262 | (defgroup $?MODESYM$-mode nil | ||
| 263 | "$MODESYM$ group." | ||
| 264 | :group 'langauges) | ||
| 265 | ---- | ||
| 266 | bind "g" | ||
| 267 | |||
| 268 | |||
| 269 | template 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 | ---- | ||
| 278 | bind "k" | ||
| 279 | |||
| 280 | |||
| 281 | context classdecl | ||
| 282 | |||
| 283 | prompt NAME "Slot Name: " | ||
| 284 | |||
| 285 | template 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 | |||
| 295 | template 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 | ---- | ||
| 305 | bind "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 | |||
| 22 | set mode "c++-mode" | ||
| 23 | set application "getset" | ||
| 24 | |||
| 25 | context declaration | ||
| 26 | |||
| 27 | template getset-in-class :tag :indent :blank | ||
| 28 | ---- | ||
| 29 | {{>A:classdecl:comment-function-group-start}} | ||
| 30 | {{TYPE}} get{{NICENAME}}() const { | ||
| 31 | return {{NAME}}; | ||
| 32 | } | ||
| 33 | void set{{NICENAME}}({{TYPE}} {{NICENAME}}) { | ||
| 34 | {{NAME}} = {{NICENAME}}; | ||
| 35 | } | ||
| 36 | {{>A:classdecl:comment-function-group-end}} | ||
| 37 | ---- | ||
| 38 | |||
| 39 | template getset-field :blank :indent | ||
| 40 | ---- | ||
| 41 | {{?TYPE}} f{{?NAME}}; | ||
| 42 | ---- | ||
| 43 | |||
| 44 | template getset-initializer :indent | ||
| 45 | ---- | ||
| 46 | f{{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 | |||
| 22 | set mode "java-mode" | ||
| 23 | set escape_start "{{" | ||
| 24 | set escape_end "}}" | ||
| 25 | |||
| 26 | context file | ||
| 27 | |||
| 28 | set comment_start "/**" | ||
| 29 | set comment_end " */" | ||
| 30 | set comment_prefix " *" | ||
| 31 | |||
| 32 | template empty :file :user :time :java :indent | ||
| 33 | "Fill out an empty file." | ||
| 34 | sectiondictionary "CLASSSECTION" | ||
| 35 | set NAME macro "FILENAME_AS_CLASS" | ||
| 36 | ---- | ||
| 37 | {{>:filecomment}} | ||
| 38 | |||
| 39 | package {{FILENAME_AS_PACKAGE}}; | ||
| 40 | |||
| 41 | {{>CLASSSECTION:declaration:class}} | ||
| 42 | |||
| 43 | ---- | ||
| 44 | bind "e" | ||
| 45 | |||
| 46 | context declaration | ||
| 47 | |||
| 48 | template import :blank :indent | ||
| 49 | "Template to import a package." | ||
| 50 | ---- | ||
| 51 | {{>:declaration:include}} | ||
| 52 | ---- | ||
| 53 | bind "i" | ||
| 54 | |||
| 55 | template class :blank :indent | ||
| 56 | "Template to declare a variable." | ||
| 57 | sectiondictionary "DOCSECTION" | ||
| 58 | set NAME macro "NAME" | ||
| 59 | ---- | ||
| 60 | {{>DOCSECTION:declaration:javadoc-class}} | ||
| 61 | public class {{?NAME}} { | ||
| 62 | |||
| 63 | {{^}} | ||
| 64 | |||
| 65 | } // {{NAME}} | ||
| 66 | ---- | ||
| 67 | bind "c" | ||
| 68 | |||
| 69 | ;;; Semantic Tag support | ||
| 70 | ;; | ||
| 71 | template class-tag :indent :blank | ||
| 72 | "Insert a Java class with the expectation of it being used by a tag inserter. | ||
| 73 | Override this to affect applications, or the outer class structure for | ||
| 74 | the user-facing template." | ||
| 75 | ---- | ||
| 76 | {{>:declaration:javadoc-class}} | ||
| 77 | public Class {{?NAME}} {{#PARENTS}}{{#FIRST}}extends {{/FIRST}}{{#NOTFIRST}}implements {{/NOTFIRST}}{{NAME}}{{/PARENTS}} | ||
| 78 | { | ||
| 79 | {{^}} | ||
| 80 | }; | ||
| 81 | ---- | ||
| 82 | |||
| 83 | template include :blank | ||
| 84 | "An include statement." | ||
| 85 | ---- | ||
| 86 | import {{NAME}}; | ||
| 87 | ---- | ||
| 88 | |||
| 89 | context misc | ||
| 90 | |||
| 91 | template 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 | |||
| 98 | context classdecl | ||
| 99 | |||
| 100 | template function :indent :blank | ||
| 101 | ---- | ||
| 102 | public {{?TYPE}} {{?NAME}}{{>:misc:arglist}} { | ||
| 103 | {{^}} | ||
| 104 | } | ||
| 105 | ---- | ||
| 106 | bind "m" | ||
| 107 | |||
| 108 | template variable :indent :blank | ||
| 109 | "Insert a variable declaration." | ||
| 110 | ---- | ||
| 111 | {{?TYPE}} {{?NAME}}{{#HAVEDEFAULT}} = {{DEFAULT}}{{/HAVEDEFAULT}}; | ||
| 112 | ---- | ||
| 113 | bind "v" | ||
| 114 | |||
| 115 | ;;; Java Doc Comments | ||
| 116 | ;; | ||
| 117 | context classdecl | ||
| 118 | |||
| 119 | prompt GROUPNAME "Name of declaration group: " | ||
| 120 | |||
| 121 | template javadoc-function-group-start :indent :blank | ||
| 122 | ---- | ||
| 123 | /** | ||
| 124 | * {{?GROUPNAME}} | ||
| 125 | * @{ | ||
| 126 | */ | ||
| 127 | |||
| 128 | ---- | ||
| 129 | |||
| 130 | template javadoc-function-group-end :indent :blank | ||
| 131 | ---- | ||
| 132 | /** | ||
| 133 | * @} | ||
| 134 | */ | ||
| 135 | |||
| 136 | ---- | ||
| 137 | |||
| 138 | context declaration | ||
| 139 | |||
| 140 | template 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 | |||
| 153 | template 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 | |||
| 164 | template javadoc-variable-same-line | ||
| 165 | ---- | ||
| 166 | /**< {{DOC}}{{^}} */ | ||
| 167 | ---- | ||
| 168 | |||
| 169 | template 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 | |||
| 22 | set mode "makefile-mode" | ||
| 23 | set escape_start "{{" | ||
| 24 | set escape_end "}}" | ||
| 25 | set comment_start "#" | ||
| 26 | set comment_prefix "#" | ||
| 27 | set TAB "\t" | ||
| 28 | |||
| 29 | context file | ||
| 30 | |||
| 31 | template empty :file :user | ||
| 32 | ---- | ||
| 33 | {{>:filecomment}} | ||
| 34 | |||
| 35 | all: {{^}} | ||
| 36 | |||
| 37 | {{comment_start}} end | ||
| 38 | ---- | ||
| 39 | |||
| 40 | context 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. | ||
| 44 | template rule :blank | ||
| 45 | ---- | ||
| 46 | {{?NAME}}: | ||
| 47 | {{TAB}}{{^}} | ||
| 48 | ---- | ||
| 49 | bind "r" | ||
| 50 | |||
| 51 | template inferencerule :blank | ||
| 52 | ---- | ||
| 53 | %.{{?SRCEXTENSION}}: %.{{?DESTEXTENSION}} | ||
| 54 | {{TAB}}{{^}} | ||
| 55 | ---- | ||
| 56 | bind "i" | ||
| 57 | |||
| 58 | template phonyrule :blank | ||
| 59 | ---- | ||
| 60 | .PHONY {{?NAME}} | ||
| 61 | {{NAME}}: | ||
| 62 | {{TAB}}{{^}} | ||
| 63 | ---- | ||
| 64 | bind "p" | ||
| 65 | |||
| 66 | |||
| 67 | template variable :blank | ||
| 68 | "Insert a variable declaration." | ||
| 69 | ---- | ||
| 70 | {{?NAME}}:= {{^}} | ||
| 71 | ---- | ||
| 72 | bind "v" | ||
| 73 | |||
| 74 | template include :blank | ||
| 75 | ---- | ||
| 76 | include {{?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 | |||
| 22 | set escape_start "$" | ||
| 23 | set escape_end "$" | ||
| 24 | set mode "srecode-template-mode" | ||
| 25 | set priority "70" | ||
| 26 | |||
| 27 | set comment_start ";;" | ||
| 28 | set comment_end "" | ||
| 29 | set comment_prefix ";;" | ||
| 30 | |||
| 31 | set SEPARATOR "----" | ||
| 32 | |||
| 33 | set DOLLAR "$" | ||
| 34 | |||
| 35 | context file | ||
| 36 | |||
| 37 | prompt MAJORMODE "Major Mode for templates: " read srecode-read-major-mode-name | ||
| 38 | prompt START "Escape Start Characters: " default "{{" | ||
| 39 | prompt END "Escape End Characters: " default "}}" | ||
| 40 | |||
| 41 | template empty :file :user :time :srt | ||
| 42 | "Insert a skeleton for a template file." | ||
| 43 | ---- | ||
| 44 | $>:filecomment$ | ||
| 45 | |||
| 46 | set mode "$?MAJORMODE$" | ||
| 47 | set escape_start "$?START$" | ||
| 48 | set escape_end "$?END$" | ||
| 49 | |||
| 50 | context file | ||
| 51 | |||
| 52 | $^$ | ||
| 53 | |||
| 54 | |||
| 55 | ;; end | ||
| 56 | ---- | ||
| 57 | |||
| 58 | template mode-basics :srt | ||
| 59 | "Fill out a full template including parts for basic new mode stuff." | ||
| 60 | sectiondictionary "E" | ||
| 61 | set NAME "empty :file :user :time" | ||
| 62 | set DOC "Fill out an empty file." | ||
| 63 | set KEY "e" | ||
| 64 | sectiondictionary "C1" | ||
| 65 | set NAME "declaration" | ||
| 66 | sectiondictionary "DTF" | ||
| 67 | set NAME "function :blank :indent" | ||
| 68 | set DOC "Template to declare a function." | ||
| 69 | set KEY "f" | ||
| 70 | sectiondictionary "DTV" | ||
| 71 | set NAME "variable :blank :indent" | ||
| 72 | set DOC "Template to declare a variable." | ||
| 73 | set KEY "v" | ||
| 74 | sectiondictionary "PR" | ||
| 75 | set NAME "NAME" | ||
| 76 | set 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 | ---- | ||
| 91 | bind "m" | ||
| 92 | |||
| 93 | |||
| 94 | context declaration | ||
| 95 | |||
| 96 | prompt NAME "Name of new template: " | ||
| 97 | prompt KEY "Key Binding: " read read-char | ||
| 98 | |||
| 99 | template function :blank | ||
| 100 | "Insert a template block for Srecoder templates." | ||
| 101 | ---- | ||
| 102 | template $?NAME$$#ARG$$NAME$$/ARG$ | ||
| 103 | "$DOC$" | ||
| 104 | $SEPARATOR$ | ||
| 105 | $^$ | ||
| 106 | $SEPARATOR$ | ||
| 107 | bind "$?KEY$" | ||
| 108 | ---- | ||
| 109 | bind "f" | ||
| 110 | |||
| 111 | prompt NAME "Name of new variable: " | ||
| 112 | |||
| 113 | template variable :blank | ||
| 114 | "Inert a variable." | ||
| 115 | ---- | ||
| 116 | set $?NAME$ "$^$" | ||
| 117 | ---- | ||
| 118 | bind "v" | ||
| 119 | |||
| 120 | template prompt :blank | ||
| 121 | "Insert a prompt." | ||
| 122 | ---- | ||
| 123 | prompt $?NAME$ "$?PROMPT$" | ||
| 124 | ---- | ||
| 125 | bind "p" | ||
| 126 | |||
| 127 | template priority :blank | ||
| 128 | "Insert a priority statemept." | ||
| 129 | ---- | ||
| 130 | set priority $^$ | ||
| 131 | ---- | ||
| 132 | |||
| 133 | template application :blank | ||
| 134 | "Insert a priority statemept." | ||
| 135 | ---- | ||
| 136 | set application "$^$" | ||
| 137 | ---- | ||
| 138 | |||
| 139 | template context :blank | ||
| 140 | "Insert a context statement." | ||
| 141 | ---- | ||
| 142 | context $NAME$ | ||
| 143 | ---- | ||
| 144 | bind "c" | ||
| 145 | |||
| 146 | template commentchars :blank | ||
| 147 | "Insert the variables for handling comments." | ||
| 148 | ---- | ||
| 149 | set comment_start "" | ||
| 150 | set comment_end "" | ||
| 151 | set comment_prefix "" | ||
| 152 | ---- | ||
| 153 | |||
| 154 | context code | ||
| 155 | |||
| 156 | prompt NAME "Name of variable: " read srecode-read-variable-name | ||
| 157 | |||
| 158 | template variable :srt | ||
| 159 | "Insert a variable with completion from the current file." | ||
| 160 | ---- | ||
| 161 | $ESCAPE_START$$?NAME$$ESCAPE_END$ | ||
| 162 | ---- | ||
| 163 | bind "v" | ||
| 164 | |||
| 165 | prompt NAME "Name of macro: " | ||
| 166 | |||
| 167 | template ask :srt | ||
| 168 | "Insert a prompting variable." | ||
| 169 | ---- | ||
| 170 | $ESCAPE_START$?$?NAME$$ESCAPE_END$ | ||
| 171 | ---- | ||
| 172 | bind "a" | ||
| 173 | |||
| 174 | template comment :srt | ||
| 175 | ---- | ||
| 176 | $ESCAPE_START$!$^$$ESCAPE_END$ | ||
| 177 | ---- | ||
| 178 | bind "c" | ||
| 179 | |||
| 180 | prompt TEMPLATE "Template to include: " read srecode-read-template-name | ||
| 181 | |||
| 182 | template include :srt | ||
| 183 | ---- | ||
| 184 | $ESCAPE_START$>:$?TEMPLATE$$ESCAPE_END$ | ||
| 185 | ---- | ||
| 186 | bind "i" | ||
| 187 | |||
| 188 | template includewrap :srt | ||
| 189 | ---- | ||
| 190 | $ESCAPE_START$<:$?TEMPLATE$$ESCAPE_END$$^$$ESCAPE_START$/$NAME$$ESCAPE_END$ | ||
| 191 | ---- | ||
| 192 | bind "w" | ||
| 193 | |||
| 194 | template point :srt | ||
| 195 | ---- | ||
| 196 | $ESCAPE_START$^$ESCAPE_END$ | ||
| 197 | ---- | ||
| 198 | bind "p" | ||
| 199 | |||
| 200 | template section :srt | ||
| 201 | "Insert a section, or looping construct." | ||
| 202 | ---- | ||
| 203 | $ESCAPE_START$#$?NAME$$ESCAPE_END$ | ||
| 204 | $^$ | ||
| 205 | $ESCAPE_START$/$NAME$$ESCAPE_END$ | ||
| 206 | ---- | ||
| 207 | bind "s" | ||
| 208 | |||
| 209 | template escape-start-quoted :srt | ||
| 210 | "Escape Start" | ||
| 211 | ---- | ||
| 212 | $ESCAPE_START$ESCAPE_START$ESCAPE_END$ | ||
| 213 | ---- | ||
| 214 | bind "q" | ||
| 215 | |||
| 216 | template escape-end-quoted :srt | ||
| 217 | "Escape Start" | ||
| 218 | ---- | ||
| 219 | $ESCAPE_START$ESCAPE_END$ESCAPE_END$ | ||
| 220 | ---- | ||
| 221 | bind "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 | |||
| 22 | set mode "srecode-template-mode" | ||
| 23 | set escape_start "$" | ||
| 24 | set escape_end "$" | ||
| 25 | set application "tests" | ||
| 26 | |||
| 27 | set UTESTVAR1 ".SRT VAR 1" | ||
| 28 | ;; | ||
| 29 | ;; These are for testing features of template files. | ||
| 30 | ;; | ||
| 31 | context test | ||
| 32 | |||
| 33 | template test :user | ||
| 34 | ---- | ||
| 35 | $! This is a comment in the template. $ | ||
| 36 | ;; $AUTHOR$ | ||
| 37 | ;; $AUTHOR:upcase$ | ||
| 38 | ---- | ||
| 39 | |||
| 40 | template 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 | |||
| 52 | template firstlast | ||
| 53 | sectiondictionary "A" | ||
| 54 | set MOOSE "FIRST" | ||
| 55 | sectiondictionary "A" | ||
| 56 | set MOOSE "MIDDLE" | ||
| 57 | sectiondictionary "A" | ||
| 58 | set 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 | |||
| 71 | template wrapsomething :region | ||
| 72 | ---- | ||
| 73 | ;; Put this line in front: | ||
| 74 | $REGIONTEXT$ | ||
| 75 | ;; Put this line at the end: | ||
| 76 | ---- | ||
| 77 | |||
| 78 | template gapsomething :blank | ||
| 79 | ---- | ||
| 80 | ### ALL ALONE ON A LINE ### | ||
| 81 | ---- | ||
| 82 | |||
| 83 | template inlinetext | ||
| 84 | "Insert text that has no nelines" | ||
| 85 | ---- | ||
| 86 | *In the middle* | ||
| 87 | ---- | ||
| 88 | |||
| 89 | template includable :blank | ||
| 90 | ---- | ||
| 91 | ;; An includable $COMMENT$ we could use. | ||
| 92 | ;; $^$ | ||
| 93 | ;; Text after a point inserter. | ||
| 94 | ---- | ||
| 95 | |||
| 96 | template wrapinclude-basic | ||
| 97 | ---- | ||
| 98 | $>WI1:includable$ | ||
| 99 | ---- | ||
| 100 | |||
| 101 | template wrapinclude-around | ||
| 102 | ---- | ||
| 103 | $<WI1:includable$Intermediate Comments$/WI1$ | ||
| 104 | ---- | ||
| 105 | |||
| 106 | template complex-subdict | ||
| 107 | sectiondictionary "A" | ||
| 108 | set MYVAR1 "cow" | ||
| 109 | set MYVAR2 "dog" | ||
| 110 | set CPLX "I have a " macro "MYVAR1" " and a " macro "MYVAR2" "." | ||
| 111 | ---- | ||
| 112 | ;; $#A$$CPLX$$/A$ | ||
| 113 | ---- | ||
| 114 | |||
| 115 | template wrap-new-template | ||
| 116 | sectiondictionary "NEWTMP" | ||
| 117 | set DOC "A nice doc string goes here." | ||
| 118 | ---- | ||
| 119 | $<NEWTMP:declaration:function$Random text in the new template | ||
| 120 | $/NEWTMP$ | ||
| 121 | ---- | ||
| 122 | |||
| 123 | template column-data | ||
| 124 | sectiondictionary "A" | ||
| 125 | set MOOSE "FIRST" | ||
| 126 | sectiondictionary "A" | ||
| 127 | set MOOSE "VERY VERY LONG STRING THAT WILL BE CROPPED." | ||
| 128 | sectiondictionary "A" | ||
| 129 | set MOOSE "MIDDLE" | ||
| 130 | sectiondictionary "A" | ||
| 131 | set MOOSE "S" | ||
| 132 | sectiondictionary "A" | ||
| 133 | set MOOSE "LAST" | ||
| 134 | ---- | ||
| 135 | Table of Values: | ||
| 136 | Left Justified | Right Justified$#A$ | ||
| 137 | $|MOOSE:20:right$ | $|MOOSE:20:left$$/A$ | ||
| 138 | ---- | ||
| 139 | |||
| 140 | template custom-arg-handler :utest | ||
| 141 | sectiondictionary "A" | ||
| 142 | set MOOSE "why" | ||
| 143 | ---- | ||
| 144 | OUTSIDE SECTION: $UTESTVAR1$ | ||
| 145 | INSIDE 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 | |||
| 22 | set mode "texinfo-mode" | ||
| 23 | |||
| 24 | set escape_start "$" | ||
| 25 | set escape_end "$" | ||
| 26 | set DOLLAR "$" | ||
| 27 | |||
| 28 | context file | ||
| 29 | |||
| 30 | prompt NAME "Name of manual: " | ||
| 31 | |||
| 32 | template 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 | ||
| 50 | START-INFO-DIR-ENTRY | ||
| 51 | * $FILE$: ($FILE$). $NAME$ | ||
| 52 | END-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 | ||
| 60 | Copyright @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 | |||
| 83 | prompt NAME "Name of item: " | ||
| 84 | |||
| 85 | context declaration | ||
| 86 | |||
| 87 | ;; Note to self: It would be cool to replace the junk in | ||
| 88 | ;; semantic/document.el with macros from here. | ||
| 89 | template 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 | ---- | ||
| 99 | bind "f" | ||
| 100 | |||
| 101 | template 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 | ---- | ||
| 111 | bind "f" | ||
| 112 | |||
| 113 | |||
| 114 | template 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 | ---- | ||
| 124 | bind "v" | ||
| 125 | |||
| 126 | prompt NAME "Name of node: " | ||
| 127 | |||
| 128 | template node :texi | ||
| 129 | "Insert a node right about here." | ||
| 130 | ---- | ||
| 131 | |||
| 132 | @node $?NAME$ | ||
| 133 | @$?LEVEL$ $NAME$ | ||
| 134 | |||
| 135 | $^$ | ||
| 136 | |||
| 137 | ---- | ||
| 138 | bind "n" | ||
| 139 | |||
| 140 | template subnode :texi | ||
| 141 | "Insert a node right about here." | ||
| 142 | ---- | ||
| 143 | |||
| 144 | @node $?NAME$ | ||
| 145 | @$?NEXTLEVEL$ $NAME$ | ||
| 146 | |||
| 147 | $^$ | ||
| 148 | |||
| 149 | ---- | ||
| 150 | bind "n" | ||
| 151 | |||
| 152 | |||
| 153 | template menu :blank | ||
| 154 | "Menu items for texinfo." | ||
| 155 | ---- | ||
| 156 | |||
| 157 | @menu | ||
| 158 | $^$ | ||
| 159 | @end menu | ||
| 160 | |||
| 161 | ---- | ||
| 162 | bind "m" | ||
| 163 | |||
| 164 | prompt NAME "Menu item: " | ||
| 165 | |||
| 166 | template 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 | |||
| 22 | set mode "wisent-grammar-mode" | ||
| 23 | set comment_start ";;" | ||
| 24 | set comment_prefix ";;" | ||
| 25 | set comment_end "" | ||
| 26 | |||
| 27 | context file | ||
| 28 | |||
| 29 | template 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 | |||
| 52 | goal | ||
| 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 | |||
| 70 | context declaration | ||
| 71 | |||
| 72 | template function | ||
| 73 | ---- | ||
| 74 | {{?NAME}} | ||
| 75 | : {{^}} | ||
| 76 | ; | ||
| 77 | ---- | ||
| 78 | bind "f" | ||
| 79 | |||
| 80 | template keyword | ||
| 81 | ---- | ||
| 82 | %keyword {{?NAME:upcase}} "{{NAME:downcase}}" | ||
| 83 | %put {{NAME:upcase}} summary "{{NAME}} {{^}}" | ||
| 84 | ---- | ||
| 85 | bind "k" | ||
| 86 | |||
| 87 | template token | ||
| 88 | ---- | ||
| 89 | %type <{{?LEXTOKEN}}> | ||
| 90 | %token <{{LEXTOKEN}}> {{LEXTOKEN}} | ||
| 91 | ---- | ||
| 92 | bind "t" | ||
| 93 | |||
| 94 | ;; end \ No newline at end of file | ||