Skip to content

Commit

Permalink
Included auto-generated bnf.json
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Dec 14, 2024
1 parent dae8bd8 commit 25f9fb6
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 44 deletions.
44 changes: 0 additions & 44 deletions src/bnf.backup.json

This file was deleted.

138 changes: 138 additions & 0 deletions src/bnf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"definitions": [
{
"name": "parenthesized",
"type": "sequence",
"pattern": [
{ "kind": "left_param", "type": "required" },
{ "kind": "expression", "type": "required" },
{ "kind": "right_param", "type": "required" }
]
},
{
"name": "optional",
"type": "sequence",
"pattern": [
{ "kind": "left_bracket", "type": "required" },
{ "kind": "expression", "type": "required" },
{ "kind": "right_bracket", "type": "required" }
]
},
{
"name": "repetition",
"type": "sequence",
"pattern": [
{ "kind": "left_brace", "type": "required" },
{ "kind": "expression", "type": "required" },
{ "kind": "right_brace", "type": "required" }
]
},
{
"name": "group",
"type": "oneof",
"pattern": [
{ "kind": "parenthesized", "type": "required" },
{ "kind": "optional", "type": "required" },
{ "kind": "repetition", "type": "required" }
]
},
{
"name": "factor",
"type": "oneof",
"pattern": [
{ "kind": "string", "type": "required" },
{ "kind": "identifier", "type": "required" },
{ "kind": "group", "type": "required" }
]
},
{
"name": "term#0",
"type": "sequence",
"pattern": [
{ "kind": "pipe", "type": "required" },
{ "kind": "factor", "type": "required" }
]
},
{
"name": "term",
"type": "sequence",
"pattern": [
{ "kind": "factor", "type": "required" },
{ "kind": "term#0", "type": "repeated" }
]
},
{
"name": "expression#0",
"type": "sequence",
"pattern": [
{ "kind": ",", "type": "required" },
{ "kind": "term", "type": "required" }
]
},
{
"name": "expression",
"type": "sequence",
"pattern": [
{ "kind": "term", "type": "required" },
{ "kind": "expression#0", "type": "repeated" }
]
},
{
"name": "rule",
"type": "sequence",
"pattern": [
{ "kind": "identifier", "type": "required" },
{ "kind": "=", "type": "required" },
{ "kind": "expression", "type": "required" },
{ "kind": ";", "type": "required" }
]
},
{
"name": "rule_list#0",
"type": "oneof",
"pattern": [
{ "kind": "rule", "type": "required" },
{ "kind": "comment", "type": "required" },
{ "kind": "directive", "type": "required" }
]
},
{
"name": "rule_list#1",
"type": "oneof",
"pattern": [
{ "kind": "line_terminator", "type": "required" },
{ "kind": "rule", "type": "required" },
{ "kind": "comment", "type": "required" },
{ "kind": "directive", "type": "required" }
]
},
{
"name": "rule_list",
"type": "oneof",
"pattern": [
{ "kind": "rule_list#0", "type": "required" },
{ "kind": "rule_list#1", "type": "repeated" }
]
}
],
"literals": [
{ "name": "string", "pattern": "\"(?:\\\\.|[^\"\\\\])*\"|'(?:\\\\.|[^'\\\\])*'" },
{ "name": "identifier", "pattern": "[a-zA-Z_]\\w*" },
{ "name": "whitespace", "pattern": "[ \\t]+" },
{ "name": "line_terminator", "pattern": "[\\n;]+" },
{ "name": "comment", "pattern": "#[^\\n]*" },
{ "name": "directive", "pattern": "##\\w+ [^\\n]*" },
{ "name": "pipe", "pattern": "\\|" },
{ "name": "left_param", "pattern": "\\(" },
{ "name": "right_param", "pattern": "\\)" },
{ "name": "left_bracket", "pattern": "\\[" },
{ "name": "right_bracket", "pattern": "\\]" },
{ "name": "left_brace", "pattern": "\\{" },
{ "name": "right_brace", "pattern": "\\}" },
{ "name": ",", "pattern": "," },
{ "name": "=", "pattern": "=" },
{ "name": ";", "pattern": ";" }
],
"rootNode": "rule_list",
"ignoreLiterals": ["whitespace", "comment"]
}

0 comments on commit 25f9fb6

Please sign in to comment.