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