EBNF Language Support
This extension adds support for an EBNF-like syntax (Extended Backus-Naur Form) to Visual Studio Code.
Table of Contents
This extension implements a simple and strict-ish version of EBNF. The syntax is defined in itself in ebnf.ebnf.
Rules are defined using the assignment operator
Rule names can start with any letter, number, or an underscore. They can also contain a hyphen, but not at the beginning. Rule names are case-sensitive.
Expressions are made up of terms and operators. Terms are either literals, references to other rules (by name), special cases, groups, or ranges. Operators are used to combine terms into more complex expressions.
Literals are enclosed in single quotes or double quotes. They can contain any character except for the quote character used to enclose them. No escaping is considered, so you can't use a single quote inside a single-quoted literal, or a double quote inside a double-quoted literal. How to interpret sequences like
Special cases are used to describe content that cannot be easily expressed using the other terms. They are enclosed in question marks
There are three different types of groups:
Ranges are used to define a set a contiguous characters. They are composed of two strings joined by two dots
Ranges have no specific definition of what a range "is". It should be obvious what the range should represent. For example, a range of
The concatenation operator is the comma
The alternation operator is the pipe
The exclusion operator is the caret