3 #include <boost/regex.hpp>
7 std::string indent(indentwidth,
' ');
8 std::string indent2(indentwidth + 8,
' ');
9 std::string indent3(indentwidth + 16,
' ');
10 std::cout << indent <<
"union, " <<
std::endl;
11 std::cout << indent2 <<
"funcs: {\n";
12 funcs_m.front()->print(indentwidth + 16);
13 for (
unsigned int i = 1; i <
funcs_m.size(); ++ i) {
16 funcs_m[i]->print(indentwidth + 16);
23 for (
unsigned int i = 0; i <
funcs_m.size(); ++ i) {
24 std::vector<std::shared_ptr<Base> > children;
26 func->
apply(children);
27 bfuncs.insert(bfuncs.end(), children.begin(), children.end());
36 boost::regex argumentList(
"(,[a-z]+\\(.*)");
37 boost::regex endParenthesis(
"\\)(.*)");
40 std::string str(it,
end);
41 while (boost::regex_match(str, what, argumentList)) {
48 str = std::string(it,
end);
51 str = std::string(it,
end);
52 if (!boost::regex_match(str, what, endParenthesis))
return false;
54 std::string fullMatch = what[0];
55 std::string rest = what[1];
57 it += (fullMatch.size() - rest.size());
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
Inform & endl(Inform &inf)
std::string::iterator iterator
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)
virtual void apply(std::vector< std::shared_ptr< Base >> &bfuncs)=0
static bool parse(iterator &it, const iterator &end, Function *&fun)