[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bnf-mode 5b223e8 34/36: Provide canonical BNF sytax
From: |
Stefan Monnier |
Subject: |
[elpa] externals/bnf-mode 5b223e8 34/36: Provide canonical BNF sytax |
Date: |
Wed, 17 Mar 2021 18:40:20 -0400 (EDT) |
branch: externals/bnf-mode
commit 5b223e89cb45bf256000b28bd6a6ab0a7c13c122
Author: Serghei Iakovlev <egrep@protonmail.ch>
Commit: Serghei Iakovlev <egrep@protonmail.ch>
Provide canonical BNF sytax
---
test/bnf.bnf | 33 ++++++++++++++++++++++++
test/ebnf-grammar.ebnf | 68 --------------------------------------------------
2 files changed, 33 insertions(+), 68 deletions(-)
diff --git a/test/bnf.bnf b/test/bnf.bnf
new file mode 100644
index 0000000..c539e0a
--- /dev/null
+++ b/test/bnf.bnf
@@ -0,0 +1,33 @@
+;; This is canonical BNF notation represented with a BNF.
+;;
+;; The syntax of the BNF has been carefully copied from Revised ALGOL 60 report
+;; <http://www.masswerk.at/algol60/report.htm>.
+
+ <syntax> ::= <rule> | <rule> <syntax>
+ <rule> ::= <opt-whitespace> < <rule-name> > <opt-whitespace>
+ ::= <opt-whitespace> <expression> <line-end>
+ <opt-whitespace> ::= <space> <opt-whitespace> | <empty>
+ <expression> ::= <list> | <list> <opt-whitespace> <or> <opt-whitespace>
+ <expression>
+ <line-end> ::= <opt-whitespace> <EOL> | <line-end> <line-end>
+ <list> ::= <term> | <term> <opt-whitespace> <list>
+ <term> ::= <literal> | < <rule-name> >
+ <literal> ::= <character> <text>
+ <character> ::= <letter> | <digit> | <symbol>
+ <letter> ::= A | B | C | D | E | F | G | H | I | J | K | L | M | N |
+ O | P | Q | R | S | T | U | V | W | X | Y | Z | a | b |
+ c | d | e | f | g | h | i | j | k | l | m | n | o | p |
+ q | r | s | t | u | v | w | x | y | z
+ <digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
+ <symbol> ::= <or> | <space> | ! | # | $ | % | & | ( | ) | * | + |
+ , | - | . | / | : | ~ | > | = | < | ? | @ | [ | \ | ] |
+ ^ | _ | ` | ' | ‘ | ’ | " | “ | ” | { | } | ;
+ <rule-name> ::= <letter> | <rule-name> <rule-char>
+ <rule-char> ::= <letter> | <digit> | -
+ <space> ::= <any whitespace character including \t and \n>
+ <or> ::= |
+ <empty> ::=
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
diff --git a/test/ebnf-grammar.ebnf b/test/ebnf-grammar.ebnf
deleted file mode 100644
index b8e8f20..0000000
--- a/test/ebnf-grammar.ebnf
+++ /dev/null
@@ -1,68 +0,0 @@
-(* This example defines Extended BNF informally. Many of the syntax
-rules include a comment to explain their meaning; inside a comment a
-meta identifier is enclosed in angle brackets < and > to avoid
-confusion with similar English words. The non-terminal symbols
-<letter>, <decimal_digit> and <character> are NOT defined. The position
-of <comments> is stated in a comment but not formally defined. *)
-
-(* A <syntax_rule> defines the sequences of symbols represented by a
-<meta_identifier> *)
-syntax = syntax_rule, { syntax_rule } ;
-syntax_rule = meta_identifier, '=', definitions_list, ';' ;
-
-(* | separates alternative <single_definitions> *)
-definitions_list = single_definition, { '|', single_definition } ;
-
-(* , separates successive <terms> *)
-single_definition = term, { ',', term } ;
-
-(* A <term> represents any sequence of symbols that is defined by the
-<factor> but not defined by the <exception> *)
-term = factor, ['-', exception] ;
-
-(* A <factor> may be used as an <exception> if it could be replaced by
-a <factor> containing no <meta_identifiers> *)
-exception = factor;
-
-(* The <integer> specifies the number of repetitions of the
-<primary> *)
-factor = [ integer, '*' ], primary ;
-
-primary = optional_sequence | repeated_sequence | special_sequence
- | grouped_sequence | meta_identifier | terminal_string
- | empty ;
-
-empty = ;
-
-(* The brackets [ and ] enclose symbols which are optional *)
-optional_sequence = '[', definitions_list, ']' ;
-
-(* The brackets { and } enclose symbols which may be repeated any
-number of times *)
-repeated_sequence = '{', definitions_list, '}' ;
-
-(* The brackets ( and ) allow any <definitions_list> to be a
-<primary> *)
-grouped_sequence = '(', definitions_list, ')' ;
-
-(* A <terminal_string> represents the <characters> between the quote
-symbols '_' or "_" *)
-terminal_string = "'", character - "'", { character - "'" }, "'"
- | '"', character - '"', { character - '"' }, '"' ;
-
-(* A <meta_identifier> is the name of a syntactic element of the
-language being defined *)
-meta_identifier = letter, { letter | decimal_digit } ;
-
-integer = decimal_digit, { decimal_digit } ;
-
-(* The meaning of a <special_sequence> is not defined in the standard
-metalanguage. *)
-special_sequence = '?', { character - '?' }, '?' ;
-
-(* A comment is allowed anywhere outside a <terminal_string>,
-<meta_identifier>, <integer> or <special_sequence> *)
-comment = '(*', { comment_symbol }, '*)' ;
-
-comment_symbol = comment | terminal_string | special_sequence
- | character ;
- [elpa] externals/bnf-mode 05287d9 11/36: Merge pull request #12 from sergeyklay/feature/buttercup, (continued)
- [elpa] externals/bnf-mode 05287d9 11/36: Merge pull request #12 from sergeyklay/feature/buttercup, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 99a45b6 12/36: Code cleanup, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 164101e 13/36: Merge pull request #13 from sergeyklay/feature/buttercup, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode e744d8a 15/36: HTTPS everywhere, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 9d89e81 07/36: Rephrase docs, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 7e6c3c0 08/36: Amended development dependencies, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 8e69700 18/36: Merge pull request #14 from sergeyklay/minor-fixes, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 0bbd059 19/36: Added abbreviation table used in bnf-mode buffers, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode dd6fae4 23/36: Added mised define-abbrev-table call, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 3d5c4fd 30/36: Cleaned up comments syntax propertize for ALGOL 60 style, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 5b223e8 34/36: Provide canonical BNF sytax,
Stefan Monnier <=
- [elpa] externals/bnf-mode 1b4f75f 06/36: Add field containing commit SHA expanded during archive creation, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 8799c4a 09/36: Add a workaround for ert-runner to work with Emacs > 26, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode d697e0a 10/36: Migrate tests to use buttercup, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 4ba8d28 14/36: Load undercover first to improve coverage report, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 62238ee 16/36: Cleaned up Makefile, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode a3b6d86 21/36: Update change log, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 8948987 20/36: Rename bnf-test-face-at => bnf-get-face-at, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 2756c7c 26/36: Use default abbrev table provided by define-derived-mode, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode b9a8446 25/36: Refactor test to use shorten font lock helpers, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode d8cb802 27/36: Amended tests, Stefan Monnier, 2021/03/17