Mercurial > emacs
comparison lisp/cedet/semantic/bovine/make-by.el @ 104452:688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
lisp/cedet/semantic/bovine/c.el
lisp/cedet/semantic/bovine/debug.el
lisp/cedet/semantic/bovine/el.el
lisp/cedet/semantic/bovine/gcc.el
lisp/cedet/semantic/bovine/java.el
lisp/cedet/semantic/bovine/make-by.el
lisp/cedet/semantic/bovine/make.el
lisp/cedet/semantic/bovine/scm-by.el
lisp/cedet/semantic/bovine/scm.el: New files.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 05 Sep 2009 20:47:41 +0000 |
parents | |
children | bbd7017a25d9 |
comparison
equal
deleted
inserted
replaced
104451:2858c6bcc446 | 104452:688cf3b99678 |
---|---|
1 ;;; semantic/bovine/make-by.el --- Generated parser support file | |
2 | |
3 ;;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2008 | |
4 ;;; Free Software Foundation, Inc. | |
5 | |
6 ;; This file is part of GNU Emacs. | |
7 | |
8 ;; GNU Emacs is free software: you can redistribute it and/or modify | |
9 ;; it under the terms of the GNU General Public License as published by | |
10 ;; the Free Software Foundation, either version 3 of the License, or | |
11 ;; (at your option) any later version. | |
12 | |
13 ;; GNU Emacs is distributed in the hope that it will be useful, | |
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 ;; GNU General Public License for more details. | |
17 | |
18 ;; You should have received a copy of the GNU General Public License | |
19 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | |
20 | |
21 ;;; Commentary: | |
22 ;; | |
23 ;; This file was generated from the grammar file | |
24 ;; semantic/bovine/make.by in the CEDET repository. | |
25 | |
26 ;;; Code: | |
27 | |
28 (eval-when-compile (require 'semantic/bovine)) | |
29 | |
30 ;;; Prologue | |
31 ;; | |
32 | |
33 ;;; Declarations | |
34 ;; | |
35 (defconst semantic-make-by--keyword-table | |
36 (semantic-lex-make-keyword-table | |
37 '(("if" . IF) | |
38 ("ifdef" . IFDEF) | |
39 ("ifndef" . IFNDEF) | |
40 ("ifeq" . IFEQ) | |
41 ("ifneq" . IFNEQ) | |
42 ("else" . ELSE) | |
43 ("endif" . ENDIF) | |
44 ("include" . INCLUDE)) | |
45 '(("include" summary "Macro: include filename1 filename2 ...") | |
46 ("ifneq" summary "Conditional: ifneq (expression) ... else ... endif") | |
47 ("ifeq" summary "Conditional: ifeq (expression) ... else ... endif") | |
48 ("ifndef" summary "Conditional: ifndef (expression) ... else ... endif") | |
49 ("ifdef" summary "Conditional: ifdef (expression) ... else ... endif") | |
50 ("endif" summary "Conditional: if (expression) ... else ... endif") | |
51 ("else" summary "Conditional: if (expression) ... else ... endif") | |
52 ("if" summary "Conditional: if (expression) ... else ... endif"))) | |
53 "Table of language keywords.") | |
54 | |
55 (defconst semantic-make-by--token-table | |
56 (semantic-lex-make-type-table | |
57 '(("punctuation" | |
58 (BACKSLASH . "\\`[\\]\\'") | |
59 (DOLLAR . "\\`[$]\\'") | |
60 (EQUAL . "\\`[=]\\'") | |
61 (PLUS . "\\`[+]\\'") | |
62 (COLON . "\\`[:]\\'"))) | |
63 'nil) | |
64 "Table of lexical tokens.") | |
65 | |
66 (defconst semantic-make-by--parse-table | |
67 `( | |
68 (bovine-toplevel | |
69 (Makefile) | |
70 ) ;; end bovine-toplevel | |
71 | |
72 (Makefile | |
73 (bol | |
74 newline | |
75 ,(semantic-lambda | |
76 (list nil)) | |
77 ) | |
78 (bol | |
79 variable | |
80 ,(semantic-lambda | |
81 (nth 1 vals)) | |
82 ) | |
83 (bol | |
84 rule | |
85 ,(semantic-lambda | |
86 (nth 1 vals)) | |
87 ) | |
88 (bol | |
89 conditional | |
90 ,(semantic-lambda | |
91 (nth 1 vals)) | |
92 ) | |
93 (bol | |
94 include | |
95 ,(semantic-lambda | |
96 (nth 1 vals)) | |
97 ) | |
98 (whitespace | |
99 ,(semantic-lambda | |
100 (list nil)) | |
101 ) | |
102 (newline | |
103 ,(semantic-lambda | |
104 (list nil)) | |
105 ) | |
106 ) ;; end Makefile | |
107 | |
108 (variable | |
109 (symbol | |
110 opt-whitespace | |
111 equals | |
112 opt-whitespace | |
113 element-list | |
114 ,(semantic-lambda | |
115 (semantic-tag-new-variable | |
116 (nth 0 vals) nil | |
117 (nth 4 vals))) | |
118 ) | |
119 ) ;; end variable | |
120 | |
121 (rule | |
122 (targets | |
123 opt-whitespace | |
124 colons | |
125 opt-whitespace | |
126 element-list | |
127 commands | |
128 ,(semantic-lambda | |
129 (semantic-tag-new-function | |
130 (nth 0 vals) nil | |
131 (nth 4 vals))) | |
132 ) | |
133 ) ;; end rule | |
134 | |
135 (targets | |
136 (target | |
137 opt-whitespace | |
138 targets | |
139 ,(semantic-lambda | |
140 (list | |
141 (car | |
142 (nth 0 vals)) | |
143 (car | |
144 (nth 2 vals)))) | |
145 ) | |
146 (target | |
147 ,(semantic-lambda | |
148 (list | |
149 (car | |
150 (nth 0 vals)))) | |
151 ) | |
152 ) ;; end targets | |
153 | |
154 (target | |
155 (sub-target | |
156 target | |
157 ,(semantic-lambda | |
158 (list | |
159 (concat | |
160 (car | |
161 (nth 0 vals)) | |
162 (car | |
163 (nth 2 vals))))) | |
164 ) | |
165 (sub-target | |
166 ,(semantic-lambda | |
167 (list | |
168 (car | |
169 (nth 0 vals)))) | |
170 ) | |
171 ) ;; end target | |
172 | |
173 (sub-target | |
174 (symbol) | |
175 (string) | |
176 (varref) | |
177 ) ;; end sub-target | |
178 | |
179 (conditional | |
180 (IF | |
181 some-whitespace | |
182 symbol | |
183 newline | |
184 ,(semantic-lambda | |
185 (list nil)) | |
186 ) | |
187 (IFDEF | |
188 some-whitespace | |
189 symbol | |
190 newline | |
191 ,(semantic-lambda | |
192 (list nil)) | |
193 ) | |
194 (IFNDEF | |
195 some-whitespace | |
196 symbol | |
197 newline | |
198 ,(semantic-lambda | |
199 (list nil)) | |
200 ) | |
201 (IFEQ | |
202 some-whitespace | |
203 expression | |
204 newline | |
205 ,(semantic-lambda | |
206 (list nil)) | |
207 ) | |
208 (IFNEQ | |
209 some-whitespace | |
210 expression | |
211 newline | |
212 ,(semantic-lambda | |
213 (list nil)) | |
214 ) | |
215 (ELSE | |
216 newline | |
217 ,(semantic-lambda | |
218 (list nil)) | |
219 ) | |
220 (ENDIF | |
221 newline | |
222 ,(semantic-lambda | |
223 (list nil)) | |
224 ) | |
225 ) ;; end conditional | |
226 | |
227 (expression | |
228 (semantic-list) | |
229 ) ;; end expression | |
230 | |
231 (include | |
232 (INCLUDE | |
233 some-whitespace | |
234 element-list | |
235 ,(semantic-lambda | |
236 (semantic-tag-new-include | |
237 (nth 2 vals) nil)) | |
238 ) | |
239 ) ;; end include | |
240 | |
241 (equals | |
242 (punctuation | |
243 "\\`[:]\\'" | |
244 punctuation | |
245 "\\`[=]\\'" | |
246 ,(semantic-lambda) | |
247 ) | |
248 (punctuation | |
249 "\\`[+]\\'" | |
250 punctuation | |
251 "\\`[=]\\'" | |
252 ,(semantic-lambda) | |
253 ) | |
254 (punctuation | |
255 "\\`[=]\\'" | |
256 ,(semantic-lambda) | |
257 ) | |
258 ) ;; end equals | |
259 | |
260 (colons | |
261 (punctuation | |
262 "\\`[:]\\'" | |
263 punctuation | |
264 "\\`[:]\\'" | |
265 ,(semantic-lambda) | |
266 ) | |
267 (punctuation | |
268 "\\`[:]\\'" | |
269 ,(semantic-lambda) | |
270 ) | |
271 ) ;; end colons | |
272 | |
273 (element-list | |
274 (elements | |
275 newline | |
276 ,(semantic-lambda | |
277 (nth 0 vals)) | |
278 ) | |
279 ) ;; end element-list | |
280 | |
281 (elements | |
282 (element | |
283 some-whitespace | |
284 elements | |
285 ,(semantic-lambda | |
286 (nth 0 vals) | |
287 (nth 2 vals)) | |
288 ) | |
289 (element | |
290 ,(semantic-lambda | |
291 (nth 0 vals)) | |
292 ) | |
293 ( ;;EMPTY | |
294 ) | |
295 ) ;; end elements | |
296 | |
297 (element | |
298 (sub-element | |
299 element | |
300 ,(semantic-lambda | |
301 (list | |
302 (concat | |
303 (car | |
304 (nth 0 vals)) | |
305 (car | |
306 (nth 1 vals))))) | |
307 ) | |
308 ( ;;EMPTY | |
309 ) | |
310 ) ;; end element | |
311 | |
312 (sub-element | |
313 (symbol) | |
314 (string) | |
315 (punctuation) | |
316 (semantic-list | |
317 ,(semantic-lambda | |
318 (list | |
319 (buffer-substring-no-properties | |
320 (identity start) | |
321 (identity end)))) | |
322 ) | |
323 ) ;; end sub-element | |
324 | |
325 (varref | |
326 (punctuation | |
327 "\\`[$]\\'" | |
328 semantic-list | |
329 ,(semantic-lambda | |
330 (list | |
331 (buffer-substring-no-properties | |
332 (identity start) | |
333 (identity end)))) | |
334 ) | |
335 ) ;; end varref | |
336 | |
337 (commands | |
338 (bol | |
339 shell-command | |
340 newline | |
341 commands | |
342 ,(semantic-lambda | |
343 (list | |
344 (nth 0 vals)) | |
345 (nth 1 vals)) | |
346 ) | |
347 ( ;;EMPTY | |
348 ,(semantic-lambda) | |
349 ) | |
350 ) ;; end commands | |
351 | |
352 (opt-whitespace | |
353 (some-whitespace | |
354 ,(semantic-lambda | |
355 (list nil)) | |
356 ) | |
357 ( ;;EMPTY | |
358 ) | |
359 ) ;; end opt-whitespace | |
360 | |
361 (some-whitespace | |
362 (whitespace | |
363 some-whitespace | |
364 ,(semantic-lambda | |
365 (list nil)) | |
366 ) | |
367 (whitespace | |
368 ,(semantic-lambda | |
369 (list nil)) | |
370 ) | |
371 ) ;; end some-whitespace | |
372 ) | |
373 "Parser table.") | |
374 | |
375 (defun semantic-make-by--install-parser () | |
376 "Setup the Semantic Parser." | |
377 (setq semantic--parse-table semantic-make-by--parse-table | |
378 semantic-debug-parser-source "make.by" | |
379 semantic-debug-parser-class 'semantic-bovine-debug-parser | |
380 semantic-flex-keywords-obarray semantic-make-by--keyword-table | |
381 )) | |
382 | |
383 | |
384 ;;; Analyzers | |
385 ;; | |
386 (require 'semantic/lex) | |
387 | |
388 | |
389 ;;; Epilogue | |
390 ;; | |
391 | |
392 (provide 'semantic/bovine/make-by) | |
393 | |
394 ;;; semantic/bovine/make-by.el ends here |