Files
whetstone_DSL/tools/mcp/grammars/whetstone_open_file.gbnf

22 lines
1.3 KiB
Plaintext

# ---------------------------------------------------------------------------
# JSON primitives
# ---------------------------------------------------------------------------
ws ::= [ \t\n\r]*
string ::= "\"" ([^"\\\x7F\x00-\x1F] | "\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]))* "\""
number ::= "-"? ([0-9] | [1-9] [0-9]*) ("." [0-9]+)? ([eE] [-+]? [0-9]+)?
integer ::= "-"? ([0-9] | [1-9] [0-9]*)
boolean ::= "true" | "false"
null ::= "null"
any-value ::= string | number | boolean | null | any-object | any-array
any-object ::= "{" ws (string ws ":" ws any-value (ws "," ws string ws ":" ws any-value)*)? ws "}"
any-array ::= "[" ws (any-value (ws "," ws any-value)*)? ws "]"
# --- whetstone_open_file ---
root ::= "{" ws "\"tool\"" ws ":" ws "\"whetstone_open_file\"" ws "," ws "\"arguments\"" ws ":" ws whetstone-open-file-args-obj-7 ws "}"
whetstone-open-file-args-content-pair-2 ::= "\"content\"" ws ":" ws string
whetstone-open-file-args-language-pair-4 ::= "\"language\"" ws ":" ws string
whetstone-open-file-args-obj-7 ::= "{" ws whetstone-open-file-args-path-pair-6 (ws "," ws whetstone-open-file-args-opt-8)* ws "}"
whetstone-open-file-args-opt-8 ::= whetstone-open-file-args-content-pair-2 | whetstone-open-file-args-language-pair-4
whetstone-open-file-args-path-pair-6 ::= "\"path\"" ws ":" ws string