You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

json.gbnf 701 B

123456789101112131415161718192021222324252627
  1. # https://github.com/ggerganov/llama.cpp/blob/8183159cf3def112f6d1fe94815fce70e1bffa12/grammars/json.gbnf
  2. root ::= object
  3. value ::= object | array | string | number | ("true" | "false" | "null") ws
  4. object ::=
  5. "{" ws (
  6. string ":" ws value
  7. ("," ws string ":" ws value)*
  8. )? "}" ws
  9. array ::=
  10. "[" ws (
  11. value
  12. ("," ws value)*
  13. )? "]" ws
  14. string ::=
  15. "\"" (
  16. [^"\\] |
  17. "\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes
  18. )* "\"" ws
  19. number ::= ("-"? ([0-9] | [1-9] [0-9]*)) ("." [0-9]+)? ([eE] [-+]? [0-9]+)? ws
  20. # Optional space: by convention, applied in this grammar after literal chars when allowed
  21. ws ::= ([ \t\n] ws)?