Home AMX User Forum AMX General Discussion

JSON Parser

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 Posts: 526
    Thanks for the share, really appreciated ;)
  • travistravis 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 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]

  • @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.