ciere.com
 
 

X3 Workshop


Write a JSON Parser.

Writing a basic JSON parser with Spirit is a straightfoward task. Remember to start small and build on success.

You can find out more about JSON here: http://json.org/

Challenge:

  • Parse a simplified version of JSON
    • Treat all numerics as floating point
    • Ignore Unicode and control characters
  • Using a visitor, print out the resulting AST in JSON format
  • Add error reporting for bad parses

Documents

Docs: X3 Documentation

Slides: Using X3 Slides


Spirit X3 Source

GitHub: git@github.com:boostorg/spirit.git

Use the develop branch.

Zip of develop: develop.zip


X3 Fun

GitHub: git@github.com:cierelabs/x3_fun.git


Hints

You will find boilerplate (getting started) projects in: example/x3/rexpr
There are two directories.

  • rexpr_min - contains a single file to start things off.
  • rexpr_full - contains a structure similar to the one in the presentation complete with tests.

Remember to use a compile with c++14 capabilities:

  • clang 3.4 or greater
  • gcc 4.9 or greater