| 4963 | |
| 4964 | #ifndef WITH_NO_CODEGEN |
| 4965 | void Pattern::write_namespace_open(FILE *file) const |
| 4966 | { |
| 4967 | if (opt_.z.empty()) |
| 4968 | return; |
| 4969 | |
| 4970 | const std::string& s = opt_.z; |
| 4971 | size_t i = 0, j; |
| 4972 | while ((j = s.find("::", i)) != std::string::npos) |
| 4973 | { |
| 4974 | ::fprintf(file, "namespace %s {\n", s.substr(i, j - i).c_str()); |
| 4975 | i = j + 2; |
| 4976 | } |
| 4977 | ::fprintf(file, "namespace %s {\n\n", s.substr(i).c_str()); |
| 4978 | } |
| 4979 | #endif |
| 4980 | |
| 4981 | #ifndef WITH_NO_CODEGEN |