Skip to content

Instantly share code, notes, and snippets.

@aisk
Last active December 15, 2015 13:39
Show Gist options
  • Save aisk/5268640 to your computer and use it in GitHub Desktop.
Save aisk/5268640 to your computer and use it in GitHub Desktop.
json parser rules for bnfc
VObject. Value ::= "{" [Item] "}" ;
ObjItem. Item ::= String ":" Value ;
separator Item "," ;
terminator Item "" ;
VArray. Value ::= "[" [Value] "]" ;
separator Value "," ;
terminator Value "" ;
VInt. Value ::= Integer ;
VDouble. Value ::= Double ;
VString. Value ::= String ;
VTrue. Value ::= "true" ;
VFalse. Value ::= "false" ;
VNull. Value ::= "null" ;
{
"Name": "aisk",
"Age": 17,
"hack": true,
"bug": null,
"word": {"Hello": "World"}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment