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