Initial Commit
[packages] / xemacs-packages / semantic / bovine / skeleton.by
1 ;;; skeleton.by -- Skeleton for creating BY files.
2 ;;
3 ;; Copyright (C) 2001, 2003 Eric M. Ludlam
4 ;;
5 ;; Author: 
6 ;; X-RCS: $Id: skeleton.by,v 1.1 2007-11-26 15:11:59 michaels 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., 51 Franklin Street, Fifth Floor,
21 ;; Boston, MA 02110-1301, USA.
22 ;;
23
24 ;; Replace occurance of "skeleton" with the name of your language.
25
26 ;; Replace start, and scopestart names with something apropriate for
27 ;; your language.
28
29 %package semantic-skeleton-by
30
31 %languagemode  skeleton-mode
32 %start         starting_rule
33 %scopestart    start_scope_rule
34
35 ;; Make common keywords into tokens returned by the lexer.
36 ;; This improves accuracy, makes this file more readable.
37 ;; Use SOMETHING in your rules as a terminal
38 %token SOMETHING "something"
39 ;; Adding a summary help's `eldoc' mode display useful information
40 ;; in your language.
41 %put SOMETHING summary "Describe something"
42
43 ;; Turn common punctuation elements into tokens.
44 ;; This does not effect lexical analysis or accuracy,
45 ;; but does make your file more readable.
46 %token <punctuation> PERIOD "\\`[.]\\'"
47 %token <punctuation> OPERATORS "[-+*/%^|&]"
48
49 %%
50
51 starting_rule : something
52               ;
53
54 start_scope_rule : something_else
55                  ;
56
57
58 something : SOMETHING
59           ;
60
61 ;; Examples from c.by:
62
63 opt-expression : expression
64                | ;; EMPTY
65                ;
66
67 ;; This expression parses over expressions, but doesn't return
68 ;; anything
69 expression : number
70              ( )
71            | symbol
72              ( )
73            | string
74              ( )
75            | semantic-list
76              ( )
77            | OPERATORS expression
78            ;; ( nil )
79            ;
80
81 ;;; skeleton.by ends here