2022-09-12 01:32:25 +02:00
< h3 align = "center" >
2022-11-27 03:44:57 +01:00
php-parser-rs
2022-09-12 01:32:25 +02:00
< / h3 >
2022-07-20 21:35:03 +02:00
2022-09-12 01:32:25 +02:00
< p align = "center" >
2022-11-27 03:45:45 +01:00
A handwritten recursive-descent parser for PHP written in Rust, for fun.
2022-09-12 01:32:25 +02:00
< / p >
2022-07-20 21:35:03 +02:00
2022-09-12 01:32:25 +02:00
---
2022-09-12 01:28:42 +02:00
2022-11-27 03:47:07 +01:00
#### Usage
```rust
use php_parser_rs::*;
let mut lexer = Lexer::new(None);
let tokens = lexer.tokenize(&source_code[..]).unwrap();
let mut parser = Parser::new(None);
let ast = parser.parse(tokens).unwrap();
```
2022-11-27 03:51:28 +01:00
> **Warning**: This crate is not ready for any form of production use _yet_. There are still a lot of things missing from the parser, so please use at your own risk.
2022-09-12 01:42:34 +02:00
#### Contributing
2022-11-27 03:44:57 +01:00
All contributions to this repository are welcome. It's the perfect project for Rust beginners since we don't use many of Rust's complex features and the core concepts in the parser are purposely simple.
2022-09-12 01:42:34 +02:00
If you do wish to contribute, we just ask you to follow a few simple rules.
1. Create a pull request from a **non-main** branch on your fork.
2. Provide a short, but clear, description of your changes.
3. Have fun and don't take it all too seriously!
#### Credits
* [Ryan Chandler ](https://github.com/ryangjchandler )
2022-11-27 03:44:57 +01:00
* [All contributors ](https://github.com/ryangjchandler/php-parser-rs/graphs/contributors )