]> code.delx.au - gnu-emacs/blob - lisp/cedet/semantic/bovine/make-by.el
Add 2012 to FSF copyright years for Emacs files (do not merge to trunk)
[gnu-emacs] / lisp / cedet / semantic / bovine / make-by.el
1 ;;; semantic/bovine/make-by.el --- Generated parser support file
2
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2008, 2009, 2010, 2011, 2012
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 etc/grammars/make.by.
24
25 ;;; Code:
26
27 (require 'semantic/lex)
28 (eval-when-compile (require 'semantic/bovine))
29
30 \f
31 ;;; Prologue
32 ;;
33 \f
34 ;;; Declarations
35 ;;
36 (defconst semantic-make-by--keyword-table
37 (semantic-lex-make-keyword-table
38 '(("if" . IF)
39 ("ifdef" . IFDEF)
40 ("ifndef" . IFNDEF)
41 ("ifeq" . IFEQ)
42 ("ifneq" . IFNEQ)
43 ("else" . ELSE)
44 ("endif" . ENDIF)
45 ("include" . INCLUDE))
46 '(("include" summary "Macro: include filename1 filename2 ...")
47 ("ifneq" summary "Conditional: ifneq (expression) ... else ... endif")
48 ("ifeq" summary "Conditional: ifeq (expression) ... else ... endif")
49 ("ifndef" summary "Conditional: ifndef (expression) ... else ... endif")
50 ("ifdef" summary "Conditional: ifdef (expression) ... else ... endif")
51 ("endif" summary "Conditional: if (expression) ... else ... endif")
52 ("else" summary "Conditional: if (expression) ... else ... endif")
53 ("if" summary "Conditional: if (expression) ... else ... endif")))
54 "Table of language keywords.")
55
56 (defconst semantic-make-by--token-table
57 (semantic-lex-make-type-table
58 '(("punctuation"
59 (BACKSLASH . "\\`[\\]\\'")
60 (DOLLAR . "\\`[$]\\'")
61 (EQUAL . "\\`[=]\\'")
62 (PLUS . "\\`[+]\\'")
63 (COLON . "\\`[:]\\'")))
64 'nil)
65 "Table of lexical tokens.")
66
67 (defconst semantic-make-by--parse-table
68 `(
69 (bovine-toplevel
70 (Makefile)
71 ) ;; end bovine-toplevel
72
73 (Makefile
74 (bol
75 newline
76 ,(semantic-lambda
77 (list nil))
78 )
79 (bol
80 variable
81 ,(semantic-lambda
82 (nth 1 vals))
83 )
84 (bol
85 rule
86 ,(semantic-lambda
87 (nth 1 vals))
88 )
89 (bol
90 conditional
91 ,(semantic-lambda
92 (nth 1 vals))
93 )
94 (bol
95 include
96 ,(semantic-lambda
97 (nth 1 vals))
98 )
99 (whitespace
100 ,(semantic-lambda
101 (list nil))
102 )
103 (newline
104 ,(semantic-lambda
105 (list nil))
106 )
107 ) ;; end Makefile
108
109 (variable
110 (symbol
111 opt-whitespace
112 equals
113 opt-whitespace
114 element-list
115 ,(semantic-lambda
116 (semantic-tag-new-variable
117 (nth 0 vals) nil
118 (nth 4 vals)))
119 )
120 ) ;; end variable
121
122 (rule
123 (targets
124 opt-whitespace
125 colons
126 opt-whitespace
127 element-list
128 commands
129 ,(semantic-lambda
130 (semantic-tag-new-function
131 (nth 0 vals) nil
132 (nth 4 vals)))
133 )
134 ) ;; end rule
135
136 (targets
137 (target
138 opt-whitespace
139 targets
140 ,(semantic-lambda
141 (list
142 (car
143 (nth 0 vals))
144 (car
145 (nth 2 vals))))
146 )
147 (target
148 ,(semantic-lambda
149 (list
150 (car
151 (nth 0 vals))))
152 )
153 ) ;; end targets
154
155 (target
156 (sub-target
157 target
158 ,(semantic-lambda
159 (list
160 (concat
161 (car
162 (nth 0 vals))
163 (car
164 (nth 2 vals)))))
165 )
166 (sub-target
167 ,(semantic-lambda
168 (list
169 (car
170 (nth 0 vals))))
171 )
172 ) ;; end target
173
174 (sub-target
175 (symbol)
176 (string)
177 (varref)
178 ) ;; end sub-target
179
180 (conditional
181 (IF
182 some-whitespace
183 symbol
184 newline
185 ,(semantic-lambda
186 (list nil))
187 )
188 (IFDEF
189 some-whitespace
190 symbol
191 newline
192 ,(semantic-lambda
193 (list nil))
194 )
195 (IFNDEF
196 some-whitespace
197 symbol
198 newline
199 ,(semantic-lambda
200 (list nil))
201 )
202 (IFEQ
203 some-whitespace
204 expression
205 newline
206 ,(semantic-lambda
207 (list nil))
208 )
209 (IFNEQ
210 some-whitespace
211 expression
212 newline
213 ,(semantic-lambda
214 (list nil))
215 )
216 (ELSE
217 newline
218 ,(semantic-lambda
219 (list nil))
220 )
221 (ENDIF
222 newline
223 ,(semantic-lambda
224 (list nil))
225 )
226 ) ;; end conditional
227
228 (expression
229 (semantic-list)
230 ) ;; end expression
231
232 (include
233 (INCLUDE
234 some-whitespace
235 element-list
236 ,(semantic-lambda
237 (semantic-tag-new-include
238 (nth 2 vals) nil))
239 )
240 ) ;; end include
241
242 (equals
243 (punctuation
244 "\\`[:]\\'"
245 punctuation
246 "\\`[=]\\'"
247 ,(semantic-lambda)
248 )
249 (punctuation
250 "\\`[+]\\'"
251 punctuation
252 "\\`[=]\\'"
253 ,(semantic-lambda)
254 )
255 (punctuation
256 "\\`[=]\\'"
257 ,(semantic-lambda)
258 )
259 ) ;; end equals
260
261 (colons
262 (punctuation
263 "\\`[:]\\'"
264 punctuation
265 "\\`[:]\\'"
266 ,(semantic-lambda)
267 )
268 (punctuation
269 "\\`[:]\\'"
270 ,(semantic-lambda)
271 )
272 ) ;; end colons
273
274 (element-list
275 (elements
276 newline
277 ,(semantic-lambda
278 (nth 0 vals))
279 )
280 ) ;; end element-list
281
282 (elements
283 (element
284 some-whitespace
285 elements
286 ,(semantic-lambda
287 (nth 0 vals)
288 (nth 2 vals))
289 )
290 (element
291 ,(semantic-lambda
292 (nth 0 vals))
293 )
294 ( ;;EMPTY
295 )
296 ) ;; end elements
297
298 (element
299 (sub-element
300 element
301 ,(semantic-lambda
302 (list
303 (concat
304 (car
305 (nth 0 vals))
306 (car
307 (nth 1 vals)))))
308 )
309 ( ;;EMPTY
310 )
311 ) ;; end element
312
313 (sub-element
314 (symbol)
315 (string)
316 (punctuation)
317 (semantic-list
318 ,(semantic-lambda
319 (list
320 (buffer-substring-no-properties
321 (identity start)
322 (identity end))))
323 )
324 ) ;; end sub-element
325
326 (varref
327 (punctuation
328 "\\`[$]\\'"
329 semantic-list
330 ,(semantic-lambda
331 (list
332 (buffer-substring-no-properties
333 (identity start)
334 (identity end))))
335 )
336 ) ;; end varref
337
338 (commands
339 (bol
340 shell-command
341 newline
342 commands
343 ,(semantic-lambda
344 (list
345 (nth 0 vals))
346 (nth 1 vals))
347 )
348 ( ;;EMPTY
349 ,(semantic-lambda)
350 )
351 ) ;; end commands
352
353 (opt-whitespace
354 (some-whitespace
355 ,(semantic-lambda
356 (list nil))
357 )
358 ( ;;EMPTY
359 )
360 ) ;; end opt-whitespace
361
362 (some-whitespace
363 (whitespace
364 some-whitespace
365 ,(semantic-lambda
366 (list nil))
367 )
368 (whitespace
369 ,(semantic-lambda
370 (list nil))
371 )
372 ) ;; end some-whitespace
373 )
374 "Parser table.")
375
376 (defun semantic-make-by--install-parser ()
377 "Setup the Semantic Parser."
378 (setq semantic--parse-table semantic-make-by--parse-table
379 semantic-debug-parser-source "make.by"
380 semantic-debug-parser-class 'semantic-bovine-debug-parser
381 semantic-flex-keywords-obarray semantic-make-by--keyword-table
382 ))
383
384 (provide 'semantic/bovine/make-by)
385
386 ;; arch-tag: 8c3749b8-7b19-46e0-af01-2a4d02fd0352
387 ;;; semantic/bovine/make-by.el ends here