11 std::string indent(indentwidth,
' ');
12 std::string indent2(indentwidth + 8,
' ');
13 std::string indent3(indentwidth + 16,
' ');
14 std::cout << indent <<
"union, " << std::endl;
15 std::cout << indent2 <<
"funcs: {\n";
16 funcs_m.front()->print(indentwidth + 16);
17 for (
unsigned int i = 1; i <
funcs_m.size(); ++ i) {
19 << indent3 <<
"," << std::endl;
20 funcs_m[i]->print(indentwidth + 16);
27 for (
unsigned int i = 0; i <
funcs_m.size(); ++ i) {
28 std::vector<std::shared_ptr<Base> > children;
30 func->
apply(children);
31 bfuncs.insert(bfuncs.end(), children.begin(), children.end());
37 unin->
funcs_m.push_back(
nullptr);
40 std::regex argumentList(
"(,[a-z]+\\(.*)");
41 std::regex endParenthesis(
"\\)(.*)");
44 std::string str(it,
end);
45 while (std::regex_match(str, what, argumentList)) {
47 unin->
funcs_m.push_back(
nullptr);
52 str = std::string(it,
end);
55 str = std::string(it,
end);
56 if (!std::regex_match(str, what, endParenthesis))
return false;
58 std::string fullMatch = what[0];
59 std::string rest = what[1];
61 it += (fullMatch.size() - rest.size());
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
std::string::iterator iterator
virtual void apply(std::vector< std::shared_ptr< Base > > &bfuncs)=0
static bool parse(iterator &it, const iterator &end, Function *&fun)
static bool parse_detail(iterator &it, const iterator &end, Function *&fun)
std::vector< Function * > funcs_m
virtual void print(int indentwidth)
virtual void apply(std::vector< std::shared_ptr< Base > > &bfuncs)