Commit details:
- Update the title to better reflect the functionality of the program.
- Add a section outlining the features of the arithmetic expression evaluator.
- Expand the AST Node Hierarchy section to provide more detailed information about each node type.
- Include examples to demonstrate the usage of the program with simple expressions.
- Add a Concepts section to highlight the Object-Oriented Programming principles used in the implementation.
- Include a Memory Management section to explain the choices made regarding smart pointers, dynamic memory allocation, and virtual destructors.
- Expand the Testing section to provide a clearer structure of the test harness, including individual test functions and a test runner.
- Add a section on how to enable and disable tests using the ENABLE_TESTS macro.
- Provide instructions for building, running tests, and cleaning the project using make commands.
- Update the Contributing section to encourage contributions and provide guidance on coding style and test cases.
- Clarifie the license information in the License section.
Commit details:
- Removed the deprecated 'run' target from the Makefile, as it was redundant and not needed for the current project structure.
- Minor improvements and cleanup in the Makefile.
Commit details:
- Add unit tests for AST nodes, including Constant, Identifier, UnaryPlus, UnaryMinus, Add, Subtract, Multiply, Divide, and Power.
- Include test cases for evaluating expressions with various node types and operations.
- Introduce a test harness to ensure that each node's `evaluate` method produces the expected results.
- Update the `main` function to use the new `runTests` function when the `--run-tests` option is provided.
- Refactor the existing test function (`runTest`) into individual test functions for better organization and readability.
- Improve the help message to reflect the correct option name (`--run-tests`).
Commit details:
- Added a 'Dependencies' section listing GNU Make and Clang.
- Introduced a 'Running Tests' section with a test expression and corresponding C++ code.
- Demonstrated a complex expression and its expected result.
Commit details:
- Set optimization level to O3 and include pedantic warnings in CXXFLAGS.
- Introduce separate build and source directories for better project organization.
- Add a target to run tests with the ENABLE_TESTS macro.
- Improve the 'all' target to create the build directory before building the executable.
- Introduce a 'rebuild' target for cleaning and rebuilding the project.
Changes made in Makefile:
- Update CXXFLAGS with -O3 and -pedantic.
- Introduce BUILD_DIR and SRC_DIR variables for better organization.
- Modifie SOURCE to point to the source file within the source directory.
- Update EXECUTABLE to exclude the file extension.
- Update 'all' target to create the build directory.
- Add 'test' target to run tests with the ENABLE_TESTS macro.
- Add 'rebuild' target for cleaning and rebuilding the project.
Commit details:
- Add new file ast.cxx with ASTNode, Identifier, Divide, Multiply, Subtract, Power classes.
- Include necessary headers and static initialization of variableTable in Identifier class.
- Add a test function runTest() for evaluating a complex expression.
- Add printHelpMessage() function for displaying program usage.
- Update main function to handle "--run-test" argument.
Commit details:
- Rename main.cxx to src/ast.hxx to better reflect its content.
- Update include statements in the renamed file.
- Remove unnecessary include <cstring> statement from ast.hxx.
- Remove redundant implementation of Power::evaluate() in ast.hxx.
Commit details:
- Refactor the Abstract Syntax Tree (AST) node hierarchy in `main.cxx` for improved memory management and ownership semantics.
- Introduce smart pointers (`std::unique_ptr`) for managing ownership of AST nodes, eliminating manual memory management.
- Add getter functions to access operands in Unary and Binary nodes.
- Implemente functions to release ownership of operands in Unary and Binary nodes.
- Replace manual deletion of operands in the destructor with default virtual destructors for Unary and Binary nodes.
- Add a conditional compilation block (`#ifdef ENABLE_TESTS`) to enable testing functionality.
- Create a test expression in the `runTest` function to evaluate a complex mathematical expression.
- Enable test execution using the `--run-test` command-line option.
- Provide a help message for the main program, outlining available options.