kamadorueda / santiago

Santiago is a lexing and parsing toolkit for Rust
91 stars 7 forks source link
bison bison-flex bison-grammar bison-yacc flex lexer lexical-analysis parser parser-combinators parser-generator parsing rust

🐆 Santiago

A lexing and parsing toolkit for Rust

CI/CD Documentation Version License

Santiago provides you: - A library for defining any [context-free grammar](https://en.wikipedia.org/wiki/Context-free_grammar). - A [Lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) module. - And facilities for building interpreters or compilers of the language. With Santiago you have everything that is needed to build your own programming language! ## Features - ✔️ **Fast** 🦀 It's written in [Rust](https://www.rust-lang.org/), with zero dependencies and maximum portability in mind. - ✔️ **Easy to use** Defining a grammar is closely the same to its [Backus–Naur form](https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form). Creating a lexer is a matter of mapping some strings. Error messages contain useful information. - ✔️ **Powerful** Santiago can parse all [context-free languages](https://en.wikipedia.org/wiki/Context-free_grammar) without exceptions. - ✔️ **Reliable** High coverage, battle tested. - ✔️ **Compatible** Santiago is inspired and aims to be an alternative to [GNU Bison](https://en.wikipedia.org/wiki/GNU_Bison), [Yacc](https://en.wikipedia.org/wiki/Yacc) and [Flex](), which are amazing tools, but not compatible with rust. ## Getting started Just read the [docs](https://docs.rs/santiago), we have plenty of examples over there, plus detailed explanation of each component. Alternatively, you can checkout more examples in the [tests](https://github.com/kamadorueda/santiago/tree/main/tests) folder. We hope you find Santiago useful! And don’t forget to give us a star ⭐