# Scheme BNF language specification # # Copyright (C) 2001 Eric M. Ludlam # # Author: Eric M. Ludlam # X-RCS: $Id: scheme.bnf,v 1.4 2001/10/03 00:30:01 zappo Exp $ # # This is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This software is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Emacs; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. %start scheme %outputfile semantic-scm.el %parsetable semantic-toplevel-scheme-bovine-table %keywordtable semantic-scheme-keyword-table %languagemode scheme-mode %setupfunction semantic-default-scheme-setup %(setq semantic-symbol->name-assoc-list '( (variable . "Variables") ;;(type . "Types") (function . "Functions") (include . "Loads") (package . "DefinModule")) semantic-number-expression nil imenu-create-index-function 'semantic-create-imenu-index semantic-dependency-include-path semantic-default-scheme-path imenu-create-index-function 'semantic-create-imenu-index document-comment-start ";;" document-comment-line-prefix ";;" document-comment-end "\n" )% %token DEFINE "define" %put DEFINE summary "Function: (define symbol expression)" %token DEFINE-MODULE "define-module" %put DEFINE-MODULE summary "Function: (define-module (name arg1 ...)) " %token LOAD "load" %put LOAD summary "Function: (load \"filename\")" scheme : semantic-list (EXPAND $1 scheme-list 4) ; scheme-list : open-paren "(" scheme-in-list ( ,$2 ) ; scheme-in-list: DEFINE symbol expression ( $2 variable nil $3 nil ) | DEFINE name-args opt-doc ( (car ,$2) function (cdr ,$2) nil ,$3 ) | DEFINE-MODULE name-args ( (nth (length $2) $2 ) provide nil) | LOAD string ( (file-name-nondirectory (read $2)) require (read $2) ) | symbol ( $1 code ) ; name-args: semantic-list (EXPAND $1 name-arg-expand) ; name-arg-expand : open-paren name-arg-expand ( ,$2 ) | symbol name-arg-expand ( ,(cons $1 ,$2) ) | EMPTY ( ) ; opt-doc : string | EMPTY ; expression : symbol | semantic-list | string ;