To build the Erlang code, run the following command:

erlc -o ./ebin ./src/*.erl

To build the C code using gcc, run the following:

gcc -o ./priv/jp_nifs.so -fpic -shared -I${OTPROOT}/erts-5.7.5/include -I${YAJLROOT}/include -L${YAJLROOT}/lib ./c_src/jp_nifs_R14.c -lyajl

NOTE: Use the source file jp_nifs_R13.c instead if you're running
Erlang/OTP version R13.

OTPROOT is typically /usr/lib/erlang. Check what your versions of erts and
erl_interface are and that the include and lib directories exist and contain
the expected header files and library files - not all Erlang distributions
ship these development files in the basic installation package. YAJLROOT is
wherever your YAJL installation is. If you built YAJL but did not do 'make
install', this will be something like lloyd-yajl-1.0.9-0/build/yajl-1.0.9/.

For the YAJL shared library to be loaded at runtime, you may need to set the
environment variable LD_LIBRARY_PATH to ${YAJLROOT}/lib if you did not
install YAJL it in a standard location.

To run the program, first start Erlang like this:

erl -pa ../json_parser/ebin

Then, run the following in the Erlang shell:

1> json_parser:parse_document(<<"[null,true,{\"int\":42,\"float\":3.14}]">>).
{ok,{undefined,true,[{<<"int">>,42},{<<"float">>,3.14}]}}
2> 
