Close search
Hoa

Hack book of Hoa\Json

Unfortunately, the documentation of this library has not been written yet. However, the README.md file may contain enough information to help you. This document is an extract of the README.md file.
Sorry for this inconvenience. Be ensured we are working hard to fix this.

Help on IRC Help on Gitter Documentation Board

This library provides only the grammar of JSON in the PP format (see the Hoa\Compiler library).

Learn more.

Quick usage

As a quick overview, we will see how to use the grammar to parse JSON strings.

Parse JSON strings

All we have to do is to use the Hoa\Compiler library. For instance, in CLI:

$ echo '{"foo": 42, "bar": [1, [2, [3, 5], 8], 13]}' | hoa compiler:pp hoa://Library/Json/Grammar.pp 0 -v dump
>  #object
>  >  #pair
>  >  >  token(string:string, foo)
>  >  >  token(number, 42)
>  >  #pair
>  >  >  token(string:string, bar)
>  >  >  #array
>  >  >  >  token(number, 1)
>  >  >  >  #array
>  >  >  >  >  token(number, 2)
>  >  >  >  >  #array
>  >  >  >  >  >  token(number, 3)
>  >  >  >  >  >  token(number, 5)
>  >  >  >  >  token(number, 8)
>  >  >  >  token(number, 13)

An error or a suggestion about the documentation? Contributions are welcome!

Comments

menu