Remove non-free old and crusty clearcase pkg
[packages] / xemacs-packages / semantic / scheme.bnf
1 # Scheme BNF language specification
2 #
3 # Copyright (C) 2001 Eric M. Ludlam
4 #
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 $
7 #
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)
11 # any later version.
12 #
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.
17 #
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.
22
23 %start         scheme
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
29
30 %(setq semantic-symbol->name-assoc-list '( (variable . "Variables")
31                                            ;;(type     . "Types")
32                                            (function . "Functions")
33                                            (include  . "Loads")
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"
42        )%
43
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 ...)) "
48 %token LOAD "load"
49 %put LOAD summary "Function: (load \"filename\")"
50
51 scheme : semantic-list
52          (EXPAND $1 scheme-list 4)
53        ;
54
55 scheme-list : open-paren "(" scheme-in-list
56               ( ,$2 )
57             ;
58
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)
65               | LOAD string
66                 ( (file-name-nondirectory (read $2)) require (read $2) )
67               | symbol
68                 ( $1 code )
69               ;
70
71 name-args: semantic-list
72            (EXPAND $1 name-arg-expand)
73          ;
74
75 name-arg-expand : open-paren name-arg-expand
76                   ( ,$2 )
77                 | symbol name-arg-expand
78                   ( ,(cons $1 ,$2) )
79                 | EMPTY
80                   (  )
81                 ;
82
83 opt-doc : string
84         | EMPTY
85         ;
86
87 expression : symbol
88            | semantic-list
89            | string
90            ;