Add 2012 to FSF copyright years for Emacs files (do not merge to trunk)
[emacs.git] / lisp / cedet / semantic / bovine / scm-by.el
blobcdf8a9b41c9026c2f070c27ab2565031858b2d11
1 ;;; semantic-scm-by.el --- Generated parser support file
3 ;; Copyright (C) 2001, 2003, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
5 ;; This file is part of GNU Emacs.
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.
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.
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/>.
20 ;;; Commentary:
22 ;; This file was generated from etc/grammars/scm.by.
24 ;;; Code:
26 (require 'semantic/lex)
28 (eval-when-compile (require 'semantic/bovine))
30 ;;; Prologue
33 ;;; Declarations
35 (defconst semantic-scm-by--keyword-table
36 (semantic-lex-make-keyword-table
37 '(("define" . DEFINE)
38 ("define-module" . DEFINE-MODULE)
39 ("load" . LOAD))
40 '(("load" summary "Function: (load \"filename\")")
41 ("define-module" summary "Function: (define-module (name arg1 ...)) ")
42 ("define" summary "Function: (define symbol expression)")))
43 "Table of language keywords.")
45 (defconst semantic-scm-by--token-table
46 (semantic-lex-make-type-table
47 '(("close-paren"
48 (CLOSEPAREN . ")"))
49 ("open-paren"
50 (OPENPAREN . "(")))
51 'nil)
52 "Table of lexical tokens.")
54 (defconst semantic-scm-by--parse-table
56 (bovine-toplevel
57 (scheme)
58 ) ;; end bovine-toplevel
60 (scheme
61 (semantic-list
62 ,(lambda (vals start end)
63 (semantic-bovinate-from-nonterminal
64 (car
65 (nth 0 vals))
66 (cdr
67 (nth 0 vals))
68 'scheme-list))
70 ) ;; end scheme
72 (scheme-list
73 (open-paren
74 "("
75 scheme-in-list
76 close-paren
77 ")"
78 ,(semantic-lambda
79 (nth 1 vals))
81 ) ;; end scheme-list
83 (scheme-in-list
84 (DEFINE
85 symbol
86 expression
87 ,(semantic-lambda
88 (semantic-tag-new-variable
89 (nth 1 vals) nil
90 (nth 2 vals)))
92 (DEFINE
93 name-args
94 opt-doc
95 sequence
96 ,(semantic-lambda
97 (semantic-tag-new-function
98 (car
99 (nth 1 vals)) nil
100 (cdr
101 (nth 1 vals))))
103 (DEFINE-MODULE
104 name-args
105 ,(semantic-lambda
106 (semantic-tag-new-package
107 (nth
108 (length
109 (nth 1 vals))
110 (nth 1 vals)) nil))
112 (LOAD
113 string
114 ,(semantic-lambda
115 (semantic-tag-new-include
116 (file-name-nondirectory
117 (read
118 (nth 1 vals)))
119 (read
120 (nth 1 vals))))
122 (symbol
123 ,(semantic-lambda
124 (semantic-tag-new-code
125 (nth 0 vals) nil))
127 ) ;; end scheme-in-list
129 (name-args
130 (semantic-list
131 ,(lambda (vals start end)
132 (semantic-bovinate-from-nonterminal
133 (car
134 (nth 0 vals))
135 (cdr
136 (nth 0 vals))
137 'name-arg-expand))
139 ) ;; end name-args
141 (name-arg-expand
142 (open-paren
143 name-arg-expand
144 ,(semantic-lambda
145 (nth 1 vals))
147 (symbol
148 name-arg-expand
149 ,(semantic-lambda
150 (cons
151 (nth 0 vals)
152 (nth 1 vals)))
154 ( ;;EMPTY
155 ,(semantic-lambda)
157 ) ;; end name-arg-expand
159 (opt-doc
160 (string)
161 ( ;;EMPTY
163 ) ;; end opt-doc
165 (sequence
166 (expression
167 sequence)
168 (expression)
169 ) ;; end sequence
171 (expression
172 (symbol)
173 (semantic-list)
174 (string)
175 (number)
176 ) ;; end expression
178 "Parser table.")
180 (defun semantic-scm-by--install-parser ()
181 "Setup the Semantic Parser."
182 (setq semantic--parse-table semantic-scm-by--parse-table
183 semantic-debug-parser-source "scheme.by"
184 semantic-debug-parser-class 'semantic-bovine-debug-parser
185 semantic-flex-keywords-obarray semantic-scm-by--keyword-table
188 (provide 'semantic/bovine/scm-by)
190 ;; arch-tag: 945749cc-a039-434f-bf95-bf2480a506c3
191 ;;; semantic/bovine/scm-by.el ends here