Finalize and display usage report
| 3212 | |
| 3213 | /// Finalize and display usage report |
| 3214 | void Reflex::write_final() |
| 3215 | { |
| 3216 | if (!options["verbose"].empty()) |
| 3217 | { |
| 3218 | std::cout << "reflex " REFLEX_VERSION " " << infile << " usage report:\n" << " options used:\n"; |
| 3219 | for (StringMap::const_iterator option = options.begin(); option != options.end(); ++option) |
| 3220 | if (!option->second.empty()) |
| 3221 | std::cout << " " << option->first << "=" << option->second << '\n'; |
| 3222 | if (!options["verbose"].empty()) |
| 3223 | std::cout << " inclusive (%s) and exclusive (%x) start conditions (with construction time):\n"; |
| 3224 | } |
| 3225 | if (!options["matcher"].empty()) |
| 3226 | { |
| 3227 | if (!options["verbose"].empty()) |
| 3228 | { |
| 3229 | for (Start start = 0; start < conditions.size(); ++start) |
| 3230 | { |
| 3231 | std::cout << " "; |
| 3232 | if (inclusive.find(start) != inclusive.end()) |
| 3233 | std::cout << "%s "; |
| 3234 | else |
| 3235 | std::cout << "%x "; |
| 3236 | std::cout << conditions[start] << ": " << rules[start].size() << " rules\n"; |
| 3237 | } |
| 3238 | std::cout << '\n'; |
| 3239 | } |
| 3240 | } |
| 3241 | else |
| 3242 | { |
| 3243 | for (Start start = 0; start < conditions.size(); ++start) |
| 3244 | { |
| 3245 | std::string name = options["prefix"]; |
| 3246 | if (name == "yy") |
| 3247 | name.clear(); |
| 3248 | name.append(conditions[start]); |
| 3249 | std::string option = "r"; |
| 3250 | option.append(";n=").append(name); |
| 3251 | if (!options["namespace"].empty()) |
| 3252 | option.append(";z=").append(options["namespace"]); |
| 3253 | if (options["graphs_file"] == "true") |
| 3254 | option.append(";f=reflex.").append(name).append(".gv"); |
| 3255 | else if (!options["graphs_file"].empty()) |
| 3256 | option.append(";f=").append(start > 0 ? "+" : "").append(options["graphs_file"]); |
| 3257 | if (!options["fast"].empty()) |
| 3258 | option.append(";o"); |
| 3259 | if (!options["find"].empty()) |
| 3260 | option.append(";p"); |
| 3261 | if (options["tables_file"] == "true") |
| 3262 | option.append(";f=reflex.").append(name).append(".cpp"); |
| 3263 | else if (!options["tables_file"].empty()) |
| 3264 | option.append(";f=").append(start > 0 ? "+" : "").append(options["tables_file"]); |
| 3265 | if ((!options["full"].empty() || !options["fast"].empty()) && options["tables_file"].empty()) |
| 3266 | { |
| 3267 | if (options["stdout"].empty()) |
| 3268 | option.append(";f=+").append(options["outfile"]); |
| 3269 | else |
| 3270 | option.append(";f=stdout.cpp"); |
| 3271 | } |
nothing calls this directly
no test coverage detected