| Crates.io | tiny_lang_parser |
| lib.rs | tiny_lang_parser |
| version | 0.1.0 |
| created_at | 2025-11-12 03:59:22.110825+00 |
| updated_at | 2025-11-12 03:59:22.110825+00 |
| description | A tiny language parser and interpreter for simple math expressions |
| homepage | |
| repository | https://github.com/stotel/tiny_lang_parser_rust |
| max_upload_size | |
| id | 1928784 |
| size | 38,713 |
A parser and interpreter for a tiny programming language implemented in Rust using Pest.
This project implements a complete parser and interpreter for a simple language that supports variable assignments and basic arithmetic operations. The parser generates AST which can then be executed by the interpreter.
The parsing process follows these stages:
The language supports four main grammar rules:
identifier = expression)program = { statement* } statement = { (assignment | expression) ";" } assignment = { identifier "=" expression } expression = { term (add_op term)* } term = { factor (mul_op factor)* } factor = { number | identifier | "(" expression ")" } add_op = { "+" | "-" } mul_op = { "*" | "/" } number = { ASCII_DIGIT+ } identifier = { (ASCII_ALPHA_LOWER | "_")+ }