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