Commit Graph

2 Commits

Author SHA1 Message Date
Arkaprabha Chakraborty
6c313ae3dd Refactor AST Node Hierarchy and Enable Test Execution
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.
2024-01-22 07:00:48 +05:30
Arkaprabha Chakraborty
49617b7822 Initial commit 2024-01-20 07:34:29 +05:30