https://github.com/grahms/slang-rust-lexical-analyzer
The SamoraLang Rust Lexical Analyzer is a lexer implemented in Rust for the SamoraLang programming language. This lexer is designed to tokenize SamoraLang source code, providing a foundation for further stages in the language processing pipeline.
https://github.com/grahms/slang-rust-lexical-analyzer
lexer lexical-analysis lexical-analyzer rust-lang samora-lang
Last synced: 5 months ago
JSON representation
The SamoraLang Rust Lexical Analyzer is a lexer implemented in Rust for the SamoraLang programming language. This lexer is designed to tokenize SamoraLang source code, providing a foundation for further stages in the language processing pipeline.
- Host: GitHub
- URL: https://github.com/grahms/slang-rust-lexical-analyzer
- Owner: GraHms
- Created: 2023-11-23T08:33:29.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-23T08:41:58.000Z (almost 2 years ago)
- Last Synced: 2025-05-07T01:12:17.996Z (5 months ago)
- Topics: lexer, lexical-analysis, lexical-analyzer, rust-lang, samora-lang
- Language: Rust
- Homepage:
- Size: 3.91 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SamoraLang Rust Lexical Analyzer
The SamoraLang Rust Lexical Analyzer is a lexer implemented in Rust for the SamoraLang programming language.
This lexer is designed to tokenize SamoraLang source code,
providing a foundation for further stages in the language processing pipeline.## Features
- Tokenizes SamoraLang source code into a stream of tokens.
- Supports a variety of token types, including identifiers, keywords, operators, and literals.
- Handles whitespace and comments gracefully.
- Written in Rust for efficiency and reliability.## Getting Started
### Prerequisites
To use the SamoraLang Rust Lexical Analyzer, you need to have Rust and Cargo installed on your system. If you haven't installed Rust, you can do so by following the instructions on the [official Rust website](https://www.rust-lang.org/).
### Installation
Clone the repository to your local machine:
```bash
git clone https://github.com/GraHms/SLang-Rust-Lexical-Analyzer.git
cd SLang-Rust-Lexical-Analyzer.
```Build the project using Cargo:
```bash
cargo build --release
```### Usage
Once the project is built, you can use the lexer in your Rust projects. Import the lexer module and create an instance of the `Lexer` struct:
```rust
use samoralang_lexer_rust::lexer::Lexer;fn main() {
let input = "let x = 5;";
let mut lexer = Lexer::new(input.to_string());loop {
let token = lexer.next_token();
// Process or display the token as needed
println!("{:?}", token);if token.r#type == TokenType::EOF {
break;
}
}
}
```## Contributing
If you find issues or want to contribute to the development of the SamoraLang Rust Lexical Analyzer, please open an issue or submit a pull request on the [GitHub repository](https://github.com/GraHms/SLang-Rust-Lexical-Analyzer.git).
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
Feel free to customize this template based on your specific project details. Include any additional sections that might be relevant for your users, such as a roadmap, known issues, or examples of SamoraLang code.