EBNF Language SupportThis extension adds support for an EBNF-like syntax (Extended Backus-Naur Form) to Visual Studio Code. Table of ContentsFeatures
Roadmap
EBNF SyntaxThis extension implements a simple and strict-ish version of EBNF. The syntax is defined in itself in ebnf.ebnf. RulesRules are defined using the assignment operator Rule NamesRule 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. ExpressionsExpressions 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. LiteralsLiterals 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 CasesSpecial cases are used to describe content that cannot be easily expressed using the other terms. They are enclosed in question marks
GroupsThere are three different types of groups:
RangesRanges 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 OperatorsConcatenationThe concatenation operator is the comma
AlternationThe alternation operator is the pipe
ExclusionThe exclusion operator is the caret
|