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