Initial Commit
[packages] / xemacs-packages / semantic / skeleton.bnf
1 # Skeleton for creating BNF files.
2 #
3 # Copyright (C) 2001 Eric M. Ludlam
4 #
5 # Author: 
6 # X-RCS: $Id: skeleton.bnf,v 1.1 2001/10/08 20:34:56 zappo Exp $
7 #
8 # .bnf 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
24
25 # Replace occurance of "skeleton" with the name of your language.
26
27 # Replace start, and scopestart names with something apropriate for
28 # your language.
29
30 %start         starting_rule
31 %scopestart    start_scope_rule
32 %outputfile    semantic-skel.el
33 %parsetable    semantic-toplevel-skeleton-bovine-table
34 %keywordtable  semantic-skeleton-keyword-table
35 %languagemode  skeleton-mode
36 %setupfunction semantic-default-skeleton-setup
37
38 # Commented out lines below are generally considered optional
39 # See the Emacs Doc for the symbols used below
40 %(setq semantic-symbol->name-assoc-list '( (variable . "Variables")
41                                            (type     . "Types")
42                                            (function . "Functions")
43                                            (include  . "Includes")
44                                            (package  . "Exports"))
45        #semantic-expand-nonterminal 'semantic-expand-skeleton-nonterminal
46        #semantic-flex-extensions semantic-flex-skeleton-extensions
47        #semantic-dependency-include-path semantic-default-skeleton-path
48        imenu-create-index-function 'semantic-create-imenu-index
49        semantic-type-relation-separator-character '(".")
50        semantic-command-separation-character ";"
51        document-comment-start "/*"
52        document-comment-line-prefix " *"
53        document-comment-end " */"
54        ;; Semantic navigation inside 'type children
55        senator-step-at-token-ids '(function variable)
56        )%
57
58 # Make common keywords into tokens returned by the lexer.
59 # This improves accuracy, makes this file more readable.
60 # Use SOMETHING in your rules as a terminal
61 %token SOMETHING "something"
62 # Adding a summary help's `eldoc' mode display useful information
63 # in your language.
64 %put SOMETHING summary "Describe something"
65
66 # Turn common punctuation elements into tokens.
67 # This does not effect lexical analysis or accuracy,
68 # but does make your file more readable.
69 %token PERIOD punctuation "."
70
71 starting_rule : something
72               ;
73
74 start_scope_rule : something_else
75                  ;
76
77
78 something : SOMETHING
79           ;
80
81 # Examples from c.bnf:
82
83 opt-expression : expression
84                | EMPTY ( nil )
85                ;
86
87 # This expression parses over expressions, but doesn't return
88 # anything
89 expression : number
90              ( )
91            | symbol
92              ( )
93            | string
94              ( )
95            | semantic-list
96              ( )
97            | punctuation "[-+*/%^|&]" expression
98            # ( nil )
99            ;