/LL1-Calculator-Parser

:hotsprings: :twisted_rightwards_arrows: In this project I built an LL1 (leftmost derivation) recursive calculator as an intoduction to compilers.

Primary LanguageJavaMIT LicenseMIT

LL(1) Calculator Parser

✔️ To make this project I started by making an LL(1) grammar to be used by my calculator. After that I made the lookahead table and so I implemented the recursive calculator. More info about what an LL(1) grammar is you can find at: https://en.wikipedia.org/wiki/LL_parser.

Installation / Run

🔨 Download and install files locally. Then compile and run the programm as shown below:

javac Main.java
java Main

Then you can type your arithmetic expression and the result will be printed instantly.

Warning❗

The calculator only accepts addition, substraction, exponents (typed like **) and parenthesis. It doesn't support multiplication and substraction and that is a task for the future, but it is easily done.

Built with

Java