https://github.com/nanomq/hocon
hocon parser
https://github.com/nanomq/hocon
bison flex hocon
Last synced: 5 months ago
JSON representation
hocon parser
- Host: GitHub
- URL: https://github.com/nanomq/hocon
- Owner: nanomq
- License: mit
- Created: 2022-11-07T03:03:23.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-12T15:31:35.000Z (over 1 year ago)
- Last Synced: 2025-05-09T01:40:14.016Z (5 months ago)
- Topics: bison, flex, hocon
- Language: C
- Homepage:
- Size: 64.5 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hocon
Hocon data parser for c.
## Overview
This project is a Hocon data parser for c. We use flex && bison to scan and parse files or strings, and stored the parsed results in cJSON Object.## Features
- [x] Json parse.
- [x] Path expression parse.
- [x] Value merging.
- [x] Comment.
- [x] Includes
- [x] Multiline string.
- [ ] Reference.
- [ ] Value joint.
- [ ] Whitespace.## Building
- Get the code from github
```shell
git clone https://github.com/nanomq/hocon.git
```
- Build project
```shell
cd hocon && mkdir build
cd build && cmake ..
make
```## Usage
- Parse from file
```shell
char *hocon_file_path = "your/hconf/file/path";
cJSON *ret = hocon_parse_file(hocon_file_path);```
- parse from string
```shell
char str[] = "abc=1";
cJSON *ret = hocon_parse_str(str, strlen(str));```
Then you can use cJSON interface to read data from cJSON object.