1 # Scheme BNF language specification
3 # Copyright (C) 2001 Eric M. Ludlam
5 # Author: Eric M. Ludlam <zappo@gnu.org>
6 # X-RCS: $Id: scheme.bnf,v 1.4 2001/10/03 00:30:01 zappo Exp $
8 # This 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 2, or (at your option)
13 # This software 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; see the file COPYING. If not, write to the
20 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 # Boston, MA 02111-1307, USA.
24 %outputfile semantic-scm.el
25 %parsetable semantic-toplevel-scheme-bovine-table
26 %keywordtable semantic-scheme-keyword-table
27 %languagemode scheme-mode
28 %setupfunction semantic-default-scheme-setup
30 %(setq semantic-symbol->name-assoc-list '( (variable . "Variables")
32 (function . "Functions")
34 (package . "DefinModule"))
35 semantic-number-expression nil
36 imenu-create-index-function 'semantic-create-imenu-index
37 semantic-dependency-include-path semantic-default-scheme-path
38 imenu-create-index-function 'semantic-create-imenu-index
39 document-comment-start ";;"
40 document-comment-line-prefix ";;"
41 document-comment-end "\n"
44 %token DEFINE "define"
45 %put DEFINE summary "Function: (define symbol expression)"
46 %token DEFINE-MODULE "define-module"
47 %put DEFINE-MODULE summary "Function: (define-module (name arg1 ...)) "
49 %put LOAD summary "Function: (load \"filename\")"
51 scheme : semantic-list
52 (EXPAND $1 scheme-list 4)
55 scheme-list : open-paren "(" scheme-in-list
59 scheme-in-list: DEFINE symbol expression
60 ( $2 variable nil $3 nil )
61 | DEFINE name-args opt-doc
62 ( (car ,$2) function (cdr ,$2) nil ,$3 )
63 | DEFINE-MODULE name-args
64 ( (nth (length $2) $2 ) provide nil)
66 ( (file-name-nondirectory (read $2)) require (read $2) )
71 name-args: semantic-list
72 (EXPAND $1 name-arg-expand)
75 name-arg-expand : open-paren name-arg-expand
77 | symbol name-arg-expand