Fix copyright headers for grammar files
[bpt/emacs.git] / lisp / cedet / semantic / bovine / scm-by.el
CommitLineData
4feec2f5
CY
1;;; semantic-scm-by.el --- Generated parser support file
2
73b0cd50 3;; Copyright (C) 2001, 2003, 2009-2011 Free Software Foundation, Inc.
4feec2f5
CY
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 the grammar file
23;; semantic/bovine/scm.by in the CEDET repository.
24
25;;; Code:
26
b90caf50
CY
27(require 'semantic/lex)
28
4feec2f5
CY
29(eval-when-compile (require 'semantic/bovine))
30\f
31;;; Prologue
32;;
33\f
34;;; Declarations
35;;
36(defconst semantic-scm-by--keyword-table
37 (semantic-lex-make-keyword-table
38 '(("define" . DEFINE)
39 ("define-module" . DEFINE-MODULE)
40 ("load" . LOAD))
41 '(("load" summary "Function: (load \"filename\")")
42 ("define-module" summary "Function: (define-module (name arg1 ...)) ")
43 ("define" summary "Function: (define symbol expression)")))
44 "Table of language keywords.")
45
46(defconst semantic-scm-by--token-table
47 (semantic-lex-make-type-table
48 '(("close-paren"
49 (CLOSEPAREN . ")"))
50 ("open-paren"
51 (OPENPAREN . "(")))
52 'nil)
53 "Table of lexical tokens.")
54
55(defconst semantic-scm-by--parse-table
56 `(
57 (bovine-toplevel
58 (scheme)
59 ) ;; end bovine-toplevel
60
61 (scheme
62 (semantic-list
63 ,(lambda (vals start end)
64 (semantic-bovinate-from-nonterminal
65 (car
66 (nth 0 vals))
67 (cdr
68 (nth 0 vals))
69 'scheme-list))
70 )
71 ) ;; end scheme
72
73 (scheme-list
74 (open-paren
75 "("
76 scheme-in-list
77 close-paren
78 ")"
79 ,(semantic-lambda
80 (nth 1 vals))
81 )
82 ) ;; end scheme-list
83
84 (scheme-in-list
85 (DEFINE
86 symbol
87 expression
88 ,(semantic-lambda
89 (semantic-tag-new-variable
90 (nth 1 vals) nil
91 (nth 2 vals)))
92 )
93 (DEFINE
94 name-args
95 opt-doc
96 sequence
97 ,(semantic-lambda
98 (semantic-tag-new-function
99 (car
100 (nth 1 vals)) nil
101 (cdr
102 (nth 1 vals))))
103 )
104 (DEFINE-MODULE
105 name-args
106 ,(semantic-lambda
107 (semantic-tag-new-package
108 (nth
109 (length
110 (nth 1 vals))
111 (nth 1 vals)) nil))
112 )
113 (LOAD
114 string
115 ,(semantic-lambda
116 (semantic-tag-new-include
117 (file-name-nondirectory
118 (read
119 (nth 1 vals)))
120 (read
121 (nth 1 vals))))
122 )
123 (symbol
124 ,(semantic-lambda
125 (semantic-tag-new-code
126 (nth 0 vals) nil))
127 )
128 ) ;; end scheme-in-list
129
130 (name-args
131 (semantic-list
132 ,(lambda (vals start end)
133 (semantic-bovinate-from-nonterminal
134 (car
135 (nth 0 vals))
136 (cdr
137 (nth 0 vals))
138 'name-arg-expand))
139 )
140 ) ;; end name-args
141
142 (name-arg-expand
143 (open-paren
144 name-arg-expand
145 ,(semantic-lambda
146 (nth 1 vals))
147 )
148 (symbol
149 name-arg-expand
150 ,(semantic-lambda
151 (cons
152 (nth 0 vals)
153 (nth 1 vals)))
154 )
155 ( ;;EMPTY
156 ,(semantic-lambda)
157 )
158 ) ;; end name-arg-expand
159
160 (opt-doc
161 (string)
162 ( ;;EMPTY
163 )
164 ) ;; end opt-doc
165
166 (sequence
167 (expression
168 sequence)
169 (expression)
170 ) ;; end sequence
171
172 (expression
173 (symbol)
174 (semantic-list)
175 (string)
176 (number)
177 ) ;; end expression
178 )
179 "Parser table.")
180
181(defun semantic-scm-by--install-parser ()
182 "Setup the Semantic Parser."
183 (setq semantic--parse-table semantic-scm-by--parse-table
184 semantic-debug-parser-source "scheme.by"
185 semantic-debug-parser-class 'semantic-bovine-debug-parser
186 semantic-flex-keywords-obarray semantic-scm-by--keyword-table
187 ))
188
4feec2f5
CY
189(provide 'semantic/bovine/scm-by)
190
191;;; semantic/bovine/scm-by.el ends here