项目作者: j-schwar

项目描述 :
An experimental JSON formatter built using Parabix technology
高级语言: C++
项目地址: git://github.com/j-schwar/parabix-json-fmt.git
创建时间: 2019-11-02T21:08:56Z
项目社区:https://github.com/j-schwar/parabix-json-fmt

开源协议:Open Software License 3.0

下载


Parabix JSON Formatter

An experimental JSON formatter built using Parabix technology developed at Simon Fraser University.

Usage

  1. json-fmt [options] [file]

The formatter can accept syntactically correct JSON input from either a file or from stdin. This is not a parser so trying to format invalid JSON won’t produce any errors, just some weird output.

Example

  1. $ echo '{"a":"b"}' | json-fmt
  2. {
  3. "a":"b"
  4. }

Build Instructions

The Parabix framework is required to build this program, it can be found here. Along with this, a relatively recent version of LLVM (anything 4.0.0 or greater should do) and Boost are also required.

Building Parabix

In order to ensure that the program works correctly, Parabix should be built with ARTIFACT_MODE=Single and ARTIFACT_TYPE=Static.

Example Parabix CMake configuration:

  1. cmake -DCMAKE_BUILD_TYPE=Release -DARTIFACT_MODE=Single -DARTIFACT_TYPE=Static ..

Once Parabix has been built and LLVM and Boost have been installed, the following commands can be used to build this project:

  1. # In parabix-json-fmt repository directory
  2. mkdir build
  3. cd build
  4. # Tell CMake where to find the Parabix include directory and libparabix.a library file
  5. cmake -DPARABIX_INCLUDE=<path to parabix include dir> -DPARABIX_LIB=<path to location of libparabix.a> ..
  6. # Build the project
  7. make
  • PARABIX_INCLUDE should be the path to wherever the parabix-devel/include directory is on your machine
  • PARABIX_LIB should be the path to the directory that contains the libparabix.a library (this would be the directory that you built Parbix in)