Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 21 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
# JsonParser

C++言語のためのJSONパーサーライブラリです。
std::istreamでJSONデータを受け取り、対応する抽象構文木を生成します。
is a JSON parser library for C++.
Get json data as std::istream and return the corresponding AST.
This is a header only library.

## CI

|状態|環境|
|Status|Environment|
|:--:|:--:|
|[![CMake](https://github.com/PANFACTORY/jsonparser/actions/workflows/cmake.yml/badge.svg)](https://github.com/PANFACTORY/jsonparser/actions/workflows/cmake.yml)|ubuntu-latest(g++)|

## 生成規則
## Generative Grammar

このライブラリではJSONフォーマットが以下の生成規則に従うものと想定します。
This library interprets sentences defined as follows as JSON.

```
<Value> -> String | Number | Boolean | Null | <Object> | <Array>
<Object> -> "{" "}" | "{" String : <Value> {, String : <Value> } "}"
<Array> -> [ ] | [ <Value> {, <Value>} ]
```

## サンプル
## Example

`main.cpp`を作成して以下のコードを入力します。
Create `main.cpp` and type the following code.

```
#include <iostream>
Expand All @@ -40,33 +41,36 @@ int main() {
}
```

例えばWindowsでClangを用いる場合、以下のコマンドでビルド、実行します。
なお、`<Your Include Path>`は使用される環境に合わせて設定してください。
Build and run with the following commands(, for example, use clang++).
Of course, set `<Your Include Path>` based on your environment.

```
clang++ -I <Your Include Path> ./main.cpp
./a.exe
```

標準入力で以下を入力し、続けて⏎、Ctrl+z、⏎を入力します。
Enter the following in the standard input.

```
{ "user_info": { "user_id": "A1234567", "user_name": "Yamada Taro" } }
{ "user_info": { "user_id": "A1234567", "user_name": "Yamada Taro" } } ⏎ Ctrl+z ⏎
```

すると、以下の結果が返されます。
Then you can get the response as below.

```
{"user_info":{"user_id":"A1234567","user_name":"Yamada Taro"}}
A1234567
```

## ドキュメント
- [ドキュメント](https://panfactory.github.io/jsonparser/)
## Document
- [Document](https://panfactory.github.io/jsonparser/)

## 参考URL
- [JSON形式](https://www.tohoho-web.com/ex/json.html)
## Reference
- [JSON format](https://www.tohoho-web.com/ex/json.html)

## 依存
## Dependency
- Google Test
- Doxygen

## License
- [MIT](https://github.com/PANFACTORY/jsonparser/blob/main/LICENSE)