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

21 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_schema_to_cpp ---
root ::= "{" ws "\"tool\"" ws ":" ws "\"whetstone_schema_to_cpp\"" ws "," ws "\"arguments\"" ws ":" ws whetstone-schema-to-cpp-args-obj-7 ws "}"
whetstone-schema-to-cpp-args-header_name-pair-2 ::= "\"header_name\"" ws ":" ws string
whetstone-schema-to-cpp-args-obj-7 ::= "{" ws whetstone-schema-to-cpp-args-header_name-pair-2 ws "," ws whetstone-schema-to-cpp-args-schema-pair-4 ws "," ws whetstone-schema-to-cpp-args-target_name-pair-6 ws "}"
whetstone-schema-to-cpp-args-schema-pair-4 ::= "\"schema\"" ws ":" ws any-object
whetstone-schema-to-cpp-args-target_name-pair-6 ::= "\"target_name\"" ws ":" ws string