[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bnf-mode 6aa0bcf 09/43: Add sample EBNF syntax for futu
From: |
Stefan Monnier |
Subject: |
[elpa] externals/bnf-mode 6aa0bcf 09/43: Add sample EBNF syntax for future testing and references |
Date: |
Mon, 20 Jan 2020 13:39:00 -0500 (EST) |
branch: externals/bnf-mode
commit 6aa0bcfec690a5067e29f08d05175b0fc6129f92
Author: Serghei Iakovlev <address@hidden>
Commit: Serghei Iakovlev <address@hidden>
Add sample EBNF syntax for future testing and references
---
test/ebnf-grammar.ebnf | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)
diff --git a/test/ebnf-grammar.ebnf b/test/ebnf-grammar.ebnf
new file mode 100644
index 0000000..b8e8f20
--- /dev/null
+++ b/test/ebnf-grammar.ebnf
@@ -0,0 +1,68 @@
+(* 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 updated (a1f2a93 -> 3b2f66a), Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 79acaa0 03/43: Added installation note, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 68c0815 04/43: Added Customization documentation section, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode e6c2acb 01/43: Update installation documentation, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 16986ab 02/43: Simplified installation documentation, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 565dbad 05/43: Removed no longer needed license note, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode a3edaae 08/43: Cleaned up NEWS file, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode eb1a2ed 11/43: Fixed link to ABNF Wikipedia page, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 6aa0bcf 09/43: Add sample EBNF syntax for future testing and references,
Stefan Monnier <=
- [elpa] externals/bnf-mode dc8c013 10/43: Fixed link to EBNF Wikipedia page, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 178eafb 12/43: [WIP]: Initial GitHub workflow skeleton, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 285c533 06/43: Convert change log to recognized by ELPA format, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 97fd624 07/43: Cleaned up NEWS file, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 87ffd61 13/43: Fast Makefile Test, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 349ca9b 14/43: Check for Errors in the Documentation, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 0ab0ebd 16/43: Correct build workflow step, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 0bfead1 17/43: Fixed misspelling, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 87c7798 19/43: Updated copyright year, amended NEWS file, Stefan Monnier, 2020/01/20
- [elpa] externals/bnf-mode 9e401f7 24/43: Enable code coverage support, Stefan Monnier, 2020/01/20