1 ;;; scheme.by -- Scheme BNF language specification
3 ;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
4 ;; 2010, 2011, 2012 Free Software Foundation, Inc.
6 ;; This file is part of GNU Emacs.
8 ;; GNU Emacs is free software: you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
13 ;; GNU Emacs is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21 %package semantic-scm-by
23 %languagemode scheme-mode
26 %token DEFINE "define"
27 %token DEFINE-MODULE "define-module"
30 %put DEFINE summary "Function: (define symbol expression)"
31 %put DEFINE-MODULE summary "Function: (define-module (name arg1 ...)) "
32 %put LOAD summary "Function: (load \"filename\")"
34 %token <open-paren> OPENPAREN "("
35 %token <close-paren> CLOSEPAREN ")"
39 scheme : semantic-list
40 (EXPAND $1 scheme-list)
43 scheme-list : OPENPAREN scheme-in-list CLOSEPAREN
47 scheme-in-list: DEFINE symbol expression
48 (VARIABLE-TAG $2 nil $3 )
49 | DEFINE name-args opt-doc sequence
50 (FUNCTION-TAG (car ,$2) nil (cdr ,$2) )
51 | DEFINE-MODULE name-args
52 (PACKAGE-TAG (nth (length $2) $2 ) nil)
54 (INCLUDE-TAG (file-name-nondirectory (read $2)) (read $2) )
59 name-args: semantic-list
60 (EXPAND $1 name-arg-expand)
63 name-arg-expand : open-paren name-arg-expand
65 | symbol name-arg-expand
75 sequence : expression sequence
85 ;;; scheme.by ends here