-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,57 @@ | ||
# noodlec | ||
The noodle data language parser implemented in C99 | ||
|
||
# Noodle C99 Parser | ||
![CMake Workflow](https://github.com/cadenmiller/noodlec/actions/workflows/cmake-single-platform.yml/badge.svg) | ||
|
||
Welcome to the Noodle C99 Parser project! This repository contains a C99 parser designed for the Noodle data language. Noodle is a lightweight language for data representation. This parser lets you seamlessly integrate Noodle data structures into C applications. | ||
|
||
## Features | ||
|
||
- Parse Noodle data files into C99 data structures. | ||
- Intuitive API for navigating and manipulating parsed Noodle data. | ||
- Lightweight and minimal dependencies. | ||
|
||
## Getting Started | ||
|
||
1. Clone this repository: `git clone https://github.com/cadenmiller/noodlec.git` | ||
2. Navigate to the project directory: `cd noodlec` | ||
3. Build the parser library using CMake. | ||
4. Link with your C project. | ||
|
||
## Usage | ||
|
||
1. Include `"noodle.h"` in your code. | ||
2. Initialize by creating a root `Noodle_t` using noodleParse(). | ||
4. Work with the parsed data using the functions noodleFrom() and noodleAt(). | ||
5. Free resources with `noodleFree()`. | ||
|
||
## Example | ||
|
||
```c | ||
#include <stdio.h> | ||
#include "noodle.h" | ||
|
||
int main() { | ||
NoodleGroup_t* settings = noodleParseFromFile("settings.noodle"); | ||
if (!parser) return EXIT_FAILURE; | ||
|
||
bool valid = false; | ||
float volume = noodleFloatFrom(settings, "volume", &valid); | ||
int vulkanDeviceId = noodleIntFrom(settings, "vulkanDeviceId", &valid); | ||
|
||
if (!valid) return EXIT_FAILURE; | ||
|
||
// And it's just that easy, use the parsed data here! | ||
// ... | ||
|
||
noodleFree(settings); | ||
return 0; | ||
} | ||
``` | ||
|
||
## Contributing | ||
|
||
Feel free to contribute and stick to continuing the current code styling. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License. |