djowel

Untitled

Nov 7th, 2011
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. "Name" = JSON Grammar
  2. "Author" = Arsène von Wyss
  3. "Version" = 1.0
  4. "About" = 'Grammar for JSON data, following http://www.json.org/'
  5. ! and compliant with http://www.ietf.org/rfc/rfc4627
  6.  
  7. "Start Symbol" = <Json>
  8. "Case Sensitive" = True
  9. "Character Mapping" = 'Unicode'
  10.  
  11. ! ------------------------------------------------- Sets
  12.  
  13. {Unescaped} = {All Valid} - {&1 .. &19} - ["\]
  14. {Hex} = {Digit} + [ABCDEFabcdef]
  15. {Digit9} = {Digit} - [0]
  16.  
  17. ! ------------------------------------------------- Terminals
  18.  
  19. Number = '-'?('0'|{Digit9}{Digit}*)('.'{Digit}+)?([Ee][+-]?{Digit}+)?
  20. String = '"'({Unescaped}|'\'(["\/bfnrt]|'u'{Hex}{Hex}{Hex}{Hex}))*'"'
  21.  
  22. ! ------------------------------------------------- Rules
  23.  
  24. <Json> ::= <Object>
  25. | <Array>
  26.  
  27. <Object> ::= '{' '}'
  28. | '{' <Members> '}'
  29.  
  30. <Members> ::= <Pair>
  31. | <Pair> ',' <Members>
  32.  
  33. <Pair> ::= String ':' <Value>
  34.  
  35. <Array> ::= '[' ']'
  36. | '[' <Elements> ']'
  37.  
  38. <Elements> ::= <Value>
  39. | <Value> ',' <Elements>
  40.  
  41. <Value> ::= String
  42. | Number
  43. | <Object>
  44. | <Array>
  45. | true
  46. | false
  47. | null
  48.  
Advertisement
Add Comment
Please, Sign In to add comment