Category : abstract-syntax-tree

Given the following test.cpp- #include <vector> using namespace std; class MyData {}; class MoreData {}; class MyClass { public: void Method2(vector<int> vec){} void Method3(const vector<int>& vec){} void Method4(vector<MoreData> vec){} void Method5(const vector<MoreData>& vec){} void Method7(vector<MyData> vec){} // Match works for this void Method8(const vector<MyData>& vec){} // How to match by reference? }; I can create ..

Read more

I have a mathematical expression such as: expression = function123(v1, v2) and I want to transform it to: expression = (function1(v1, v2) + function2(v1, v2) + function3(v1, v2)) In order to solve this problem, I tried to utilize regular expressions, such as: "function123(([^)]+),([^)]+))" and replace using the interior tokens to get what I want. Regular ..

Read more

I have a mathematical expression such as: expression = function123(v1, v2) and I want to transform it to: expression = (function1(v1, v2) + function2(v1, v2) + function3(v1, v2)) In order to solve this problem, I tried to utilize regular expressions, such as: "function123(([^)]+),([^)]+))" and replace using the interior tokens to get what I want. Regular ..

Read more