Go to file
Ryan Chandler 807c9e73cd chore: fmt
2022-11-28 13:18:26 +00:00
.github wip 2022-11-25 18:41:18 +00:00
meta chore: move all code into a single library 2022-11-27 02:49:28 +00:00
src chore: fmt 2022-11-28 13:18:26 +00:00
.gitignore rs: experiment with a PHP to Rust to binary compiler 2022-07-29 16:32:25 +01:00
Cargo.toml chore: rename to php-parser-rs 2022-11-27 02:49:28 +00:00
README.md chore: add jffnr badge 2022-11-27 16:48:59 +00:00

php-parser-rs

A handwritten recursive-descent parser for PHP written in Rust, for fun.


Usage

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();

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.

Contributing

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.

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