https://github.com/zikiflicky/bonzo
A regex programming language
https://github.com/zikiflicky/bonzo
programming-language regex
Last synced: 4 months ago
JSON representation
A regex programming language
- Host: GitHub
- URL: https://github.com/zikiflicky/bonzo
- Owner: ZikiFlicky
- License: mit
- Created: 2022-07-29T19:22:59.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-31T06:11:08.000Z (about 3 years ago)
- Last Synced: 2025-03-05T06:18:13.222Z (11 months ago)
- Topics: programming-language, regex
- Language: C++
- Homepage:
- Size: 162 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bonzo
A small language that allows you to define rules for creating regular expressions and for searching
for patterns in text.
The language persists only of rules, functions and builtin-functions and allows you
to match text or generate regexes in an easy and readable way.
## Setup
This was tested only on my Ubuntu 20.04 machine.
### Prerequisites
* *nix machine
* CMake >=3.16
* GNU Make
* C++20 compiler
### Downloading
To download prerequisites on Ubuntu:
```
sudo apt install build-essential cmake gcc-11
```
Clone this repository.
### Compiling
Enter the created directory and run:
```
cmake . && make
```
The executable, called `bonzo`, will be set in the base directory.
### Running
There are some example files in the `examples/` directory.
To run the hello-world example file:
```
./bonzo examples/hello_world.bz
```
## Todo
- [x] Generate regex
- [X] Our own matching engine
- [X] Better argument handling
- [X] Tests
- [~] Better errors (show position in runtime errors)
- [ ] More tests
- [ ] Fix some UB
- [ ] Refactor
- [ ] Different make rule to build the `runtests` executable
- [ ] Show matches in an interactive way (like `less`)
- [ ] More regex syntaxes