This project is a Kotlin implementation of a functional parser, mainly made for practicing with development techniques and learning about new things.
This small project is an idea from @jmdesprez: implementing in Kotlin a functional parser as presented in that Youtube video.
In the video, the presented parser is implemented in Haskell. Our goal with Jean-Marc was to implement a similar kind of parser in Kotlin.
The aim of the parser we're developing is actually fairly simple: it should allow to parse expressions such as (1+3*(2+4)*2+4-(2*4))
and be able to calculate the actual result. The parser computation should also validate the expression by parsing only things which are allowed.
If you'd like to discover what we did or play a bit with the source code as well, you can have a look at our test file located in src/test/kotlin
to understand how we built our parser.
The actual implementation is located in src/main/kotlin
.
Do not hesitate to have a look at each commit to understand the evolution of the parser. Each brick has been added in a dedicated commit.
We decided to stick with the basic Kotlin SDK, and KotlinTest for writing our unit tests.
This project retrieves its dependencies from Maven. We developed it using IntelliJ IDEA. There's basically nothing much needed for running the project or contributing to it.
Simply running mvn test
should be sufficient to execute the unit tests.
We do not recommend to use the functions we developed in a production project since they're completely dedicated to our practice exercise.
But you can use our functions or code to write your own parser or practice yourself.
The project won't be deployed anywhere, and we'll just share the source code here on GitHub.