Add KINETIC block rewriter (issue #63) (#95)
Adds a new KineticRewriter visitor that transforms (after semantic analysis) a parsed KINETIC procedure into an equivalent DERIVATIVE procedure. The visitor takes a ProcedureExpression and composes the equivalent procedure, available via the as_procedure() method on the visitor object. Move common functinality for 'local' variable insertion during transformation phase to new files astmanip.?pp. Add Expression method for directly setting scope. Use scope_ptr type alias widely. Implement correct clone() behaviour for DerivativeExpression Implement KineticRewriter transforming visitor class. Add equivalence test for KineticRewriter: the test incorporates a simple ad-hoc algebraic expression simplifier. Add unit test to Parser.parse_binop to exercise bug #94
Showing
- modcc/CMakeLists.txt 10 additions, 9 deletionsmodcc/CMakeLists.txt
- modcc/astmanip.cpp 30 additions, 0 deletionsmodcc/astmanip.cpp
- modcc/astmanip.hpp 38 additions, 0 deletionsmodcc/astmanip.hpp
- modcc/expression.cpp 24 additions, 16 deletionsmodcc/expression.cpp
- modcc/expression.hpp 29 additions, 24 deletionsmodcc/expression.hpp
- modcc/functionexpander.cpp 10 additions, 36 deletionsmodcc/functionexpander.cpp
- modcc/functionexpander.hpp 8 additions, 43 deletionsmodcc/functionexpander.hpp
- modcc/kinrewriter.hpp 196 additions, 0 deletionsmodcc/kinrewriter.hpp
- modcc/module.hpp 0 additions, 1 deletionmodcc/module.hpp
- modcc/parser.cpp 2 additions, 2 deletionsmodcc/parser.cpp
- modcc/visitor.hpp 5 additions, 0 deletionsmodcc/visitor.hpp
- tests/modcc/CMakeLists.txt 4 additions, 0 deletionstests/modcc/CMakeLists.txt
- tests/modcc/alg_collect.hpp 313 additions, 0 deletionstests/modcc/alg_collect.hpp
- tests/modcc/expr_expand.cpp 77 additions, 0 deletionstests/modcc/expr_expand.cpp
- tests/modcc/expr_expand.hpp 51 additions, 0 deletionstests/modcc/expr_expand.hpp
- tests/modcc/test_kinetic_rewriter.cpp 98 additions, 0 deletionstests/modcc/test_kinetic_rewriter.cpp
- tests/modcc/test_parser.cpp 1 addition, 0 deletionstests/modcc/test_parser.cpp
Please register or sign in to comment