This project implements an expression parser using C++23. It includes a Lexer, Parser, and manual test executables for testing expressions.
-
Open a terminal at the project root.
-
Create and navigate to a build directory:
mkdir build cd build cmake .. cmake --build .
This will create the test executables testLexer
and testParser
in the build directory.
The test executables require a file path as an argument.Please, note that not all expressions will work with the lexer, since it's testing is more limited. To run the tests using the provided example file, execute the following commands from the build directory:
./testLexer ../tests/data/examples.js
./testParser ../tests/data/examples.js
The file tests/data/examples.js
contains several expressions. To test a specific expression:
- Open
tests/data/examples.js
in a text editor. - Comment out or uncomment lines so that only the expression you want to test remains active.
- Save your changes.
- Run the test executables again using the commands above.