{ "name": "Backus-Naur Form", "scopeName": "source.bnf", "patterns": [ { "include": "#main" } ], "repository": { "comment": { "name": "comment.line.semicolon.bnf", "begin": ";", "end": "$", "beginCaptures": { "0": { "name": "punctuation.definition.comment.bnf" } } }, "main": { "patterns": [ { "include": "#rule" }, { "include": "#comment" } ] }, "rhs": { "patterns": [ { "name": "keyword.operator.logical.or.alternation.pipe.bnf", "match": "\\|" }, { "name": "keyword.operator.logical.repetition.asterisk.star.bnf", "match": "\\*" }, { "name": "keyword.operator.logical.repetition.plus.bnf", "match": "\\+" }, { "name": "meta.optional.bnf", "begin": "\\[", "end": "\\]", "patterns": [ { "include": "#rhs" } ], "beginCaptures": { "0": { "name": "punctuation.definition.square.bracket.begin.bnf" } }, "endCaptures": { "0": { "name": "punctuation.definition.square.bracket.end.bnf" } } }, { "name": "meta.repetition.bnf", "begin": "{", "end": "}", "patterns": [ { "include": "#rhs" } ], "beginCaptures": { "0": { "name": "punctuation.definition.curly.bracket.begin.bnf" } }, "endCaptures": { "0": { "name": "punctuation.definition.curly.bracket.end.bnf" } } }, { "name": "meta.group.bnf", "begin": "\\(", "end": "\\)", "patterns": [ { "include": "#rhs" } ], "beginCaptures": { "0": { "name": "punctuation.definition.round.bracket.begin.bnf" } }, "endCaptures": { "0": { "name": "punctuation.definition.round.bracket.end.bnf" } } }, { "name": "meta.lhs.bnf", "contentName": "constant.language.term.bnf", "begin": "\u003c", "end": "\u003e|(?=$)", "beginCaptures": { "0": { "name": "punctuation.definition.angle.bracket.begin.bnf" } }, "endCaptures": { "0": { "name": "punctuation.definition.angle.bracket.end.bnf" } } }, { "name": "string.quoted.double.bnf", "begin": "\"", "end": "\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.bnf" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.bnf" } } }, { "name": "string.quoted.single.bnf", "begin": "'", "end": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.bnf" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.bnf" } } } ] }, "rule": { "name": "meta.rule.bnf", "begin": "(?=\u003c)", "end": "$|(?=;)", "patterns": [ { "name": "meta.lhs.bnf", "contentName": "entity.name.rule.identifier.bnf", "begin": "\\G\u003c", "end": "\u003e|(?=$|;)", "beginCaptures": { "0": { "name": "punctuation.definition.angle.bracket.begin.bnf" } }, "endCaptures": { "0": { "name": "punctuation.definition.angle.bracket.end.bnf" } } }, { "name": "meta.rhs.bnf", "begin": "::=", "end": "(?=$|;)", "patterns": [ { "include": "#rhs" } ], "beginCaptures": { "0": { "name": "keyword.operator.assignment.bnf" } } } ] } } }