Crates.io | ferric_parser |
lib.rs | ferric_parser |
version | 0.2.0 |
source | src |
created_at | 2023-09-22 19:17:08.481109 |
updated_at | 2023-09-22 21:10:09.669207 |
description | The Parser and currently the code gen for the ferric group of languages |
homepage | https://gitlab.com/ferric1/ferric_parser |
repository | https://gitlab.com/ferric1/ferric_parser |
max_upload_size | |
id | 980787 |
size | 58,606 |
ferric_parser
is a Rust library designed to parse and optimize abstract syntax trees for the Ferric programming language.
Note that it requires you to use the ferric_lexer
to work properly as it assumes that the tokens it receives are from my lexer,
this is so that I may develop everything on my own and not rely on external crates.
Include ferric_parser
and ferric_lexer
in your Cargo.toml
:
[dependencies]
ferric_parser = "0.1.0"
ferric_lexer = "0.1.0"
Then run:
cargo build
use ferric_lexer::Lexer;
use ferric_parser::Parser;
let code = "your Ferric code here";
let tokens = Lexer::new(&code).lex();
let parser = Parser::new(code);
let ast = parser.parse().unwrap();
Currently, the project as a whole only compiles to bash, but it will be expanded in the future with support to compile to assembly.
The parser is responsible for the code gen at the moment but this will be moved to its own repo soon so that we can compile only what we need to.
This project is licensed under the MIT License.
For further details, refer to the LICENSE file.