Skip to content

Helyosis/rust-parser-combinator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust-parser-combinator

Cargo Build & Test

This is a toy project that I made to learn Rust. The code is not perfect, nor is it efficient but it's mostly readable and easy to understand. This implement a type of parsers called Parser Combinator, it is an alternative approach to parsing that combines small, simple parsers to form more complex parsers. Compared to other knowns (to me) approaches, it does not require the lexing step of parsing, doing both the lexing and the parsing in one go. There is also the added benefit of forming a tree structure on-the-go, enabling developpers to form the AST naturally, just by following the specifications.

Example

You can see an example project in the test/ folder at the root. Because it is also used as integration testing, there are test cases that you can refer to.

Documentation

There is currently no documentation but the functions (and their tests) should be (hopefully) self-explanatory.

Credit

My code is largely inspired by the very-well written tutorial on parser combinator for rust written on godit.lol. The idea to build such a project was inspired by a Youtube series by LowLevelJavascript building a parser combinator in javascript.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages