#lang abnf

@require abnf/rfc5234/core-rules
@biased-choice

JSON-text = ws value ws

begin-array     = ws %x5B ws  ; [ left square bracket

begin-object    = ws %x7B ws  ; { left curly bracket

end-array       = ws %x5D ws  ; ] right square bracket

end-object      = ws %x7D ws  ; } right curly bracket

name-separator  = ws %x3A ws  ; : colon

value-separator = ws %x2C ws  ; , comma

ws = *(
        %x20 /              ; Space
  Horizontal tab
        %x0A /              ; Line feed or New line
        %x0D )              ; Carriage return

value = false / null / true / object / array / number / string

false = %x66.61.6c.73.65   ; false

null  = %x6e.75.6c.6c      ; null

true  = %x74.72.75.65      ; true

object = begin-object [ member *( value-separator member ) ]
         end-object

member = string name-separator value

array = begin-array [ value *( value-separator value ) ] end-array

number = [ minus ] int [ frac ] [ exp ]

decimal-point = %x2E       ; .

  1 - 9

e = %x65 / %x45            ; e E

exp = e [ minus / plus ] 1*DIGIT

frac = decimal-point 1*DIGIT

int = zero / ( digit1-9 *DIGIT )

minus = %x2D               ; -

plus = %x2B                ; +

  0

string = quotation-mark *char quotation-mark

char = unescaped /
    escape (
  "     quotation mark   U+0022
        %x5C /          ; \    reverse solidus U+005C
        %x2F /          ; /    solidus         U+002F
        %x62 /          ; b    backspace       U+0008
        %x66 /          ; f    form feed       U+000C
        %x6E /          ; n    line feed       U+000A
        %x72 /          ; r    carriage return U+000D
        %x74 /          ; t    tab             U+0009
  uXXXX                 U+XXXX

escape = %x5C              ; \

quotation-mark = %x22      ; "

unescaped = %x20-21 / %x23-5B / %x5D-10FFFF

 [ left square bracket
 { left curly bracket
 ] right square bracket
 } right curly bracket
 : colon
 , comma
 Space
 Line feed or New line
 Carriage return
 false
 null
 true
 .
 e E
 -
 +
 \    reverse solidus U+005C
 /    solidus         U+002F
 b    backspace       U+0008
 f    form feed       U+000C
 n    line feed       U+000A
 r    carriage return U+000D
 t    tab             U+0009
 \
 "
#lang abnf

@require abnf/rfc5234/core-rules
@biased-choice

JSON-text = ws value ws







ws = *(
  Horizontal tab

value = false / null / true / object / array / number / string




object = begin-object [ member *( value-separator member ) ]
         end-object

member = string name-separator value

array = begin-array [ value *( value-separator value ) ] end-array

number = [ minus ] int [ frac ] [ exp ]


  1 - 9


exp = e [ minus / plus ] 1*DIGIT

frac = decimal-point 1*DIGIT

int = zero / ( digit1-9 *DIGIT )



  0

string = quotation-mark *char quotation-mark

char = unescaped /
    escape (
  "     quotation mark   U+0022
  uXXXX                 U+XXXX



unescaped = %x20-21 / %x23-5B / %x5D-10FFFF
