Home AMX General Discussion

JSON Parser

PhreaKPhreaK Senior MemberPosts: 966
For those looking for a JSON parser, here's a C -> NetLinx port of the fantastic jsmn parser.

https://github.com/ciasia/jsmn

The readme has the full rundown on what it does, however the brief version is it will token any valid JSON you can fit into a character array, letting you then parse in a way that suits your application. Some sample of building state machines around it's output can be found here. Rudimentary parsers where you iterate over tokens of more simplistic structures will work equally as well.

Comments

  • vincenvincen Junior Member Posts: 526
    Thanks for the share, really appreciated ;)
  • travistravis Junior Member Posts: 180
    whoa.
    I like that it's slamming those structs around between functions. I did that once and felt kind of dirty about it. Validation.
  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,177
    travis wrote: »
    whoa.
    I like that it's slamming those structs around between functions. I did that once and felt kind of dirty about it. Validation.

    HAHAHAHAHAHA!
  • Hi I am getting compilation error saying Unreceognized node type [431]

  • HARMAN_icraigieHARMAN_icraigie Technical Trainer II, Harman Professional University Posts: 548

    @fathrudeen said:
    Hi I am getting compilation error saying Unreceognized node type [431]

    That usually means that stack_var or local_var is not the first line in a scope

Sign In or Register to comment.