The TSLCompiler is a remake of the original TSLgenerator, a tool used to generate test cases for reference when writing test code. The reasons behind making this edition comes from the limitations of the TSLgenerator, specifically:
- There are situations when certain keywords are ignored due to precedence in the TSL grammar implemented by the TSLgenerator, with no error messages stating this occured.
- While the source code is available, there are four different codebases depending on the Operating System implementing very identical behavior, making it non-trivial to contribute changes.
- Even if the code base was consolidated into one, most of the code is hard to test automatically due to the over-reliance of static variables, and functions that do not return their results by default.
The TSLCompiler is designed to be a drop-in replacement for the TSLgenerator, honoring all of the original command-line options. However, this will reject TSL files containing syntax that would generally be accepted, albeit ignored by the TSLgenerator. This is achieved by implementing the grammar explicitly through a Lexer and Parser library.
In addition, the TSLCompiler is developed using the principles behind Test Driven Development/Behavior Driven Development to provide confidence in any proposed changes.
Finally, to remain fairly close to the original C implementation of the TSLgenerator, and to reduce memory leaks, this project utilizes C++.
- A C++ Compiler supporting the C++20 standard (Tested and built with Clang++ on GitHub).
- The Lexer library Flex.
- The Parser library Bison version >= 3.2.
- The fmt library, which can be installed via
meson wrap install fmt
. - The Meson Build System.
- Clone this repository.
- Make a build directory called
build
for meson. - Run
meson setup build
, wherebuild
is the name of the build directory.
- Open the
build
directory from theBuilding
step. - Run
meson test
. - Confirm that all tests are passing as intended.
- Open the
build
directory from theBuilding
step. - Run
meson compile
. - Verify that there is now an executable in there called
tslcompiler
if you're on Linux or macOS,tslcompiler.exe
if you're on Windows. - Run
./tslcompiler path/to/input/file
.
- For more information on available arguments, consult the Manual.
- Open the
build
directory from theBuilding
step. - Run
meson compile
. - Verify that there is now an executable in there called
tslchecker
if you're on Linux or macOS,tslchecker.exe
if you're on Windows. - Run
./tslchecker path/to/input/file
.