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