| 1041 | const char Probabilities::comment_line_prefix = '#'; |
| 1042 | |
| 1043 | bool |
| 1044 | Probabilities::parse_line(std::string &error_msg, string &line) |
| 1045 | { |
| 1046 | char c = StringUtils::first_nonspace_char(line); |
| 1047 | bool rv = false; |
| 1048 | bool is_equal = false; |
| 1049 | if (c == '\0') { |
| 1050 | assert("parse empty line, cannot happen!\n" && 0); |
| 1051 | } |
| 1052 | else if (c == Probabilities::comment_line_prefix) { |
| 1053 | return true; |
| 1054 | } |
| 1055 | else if (c == GroupProbElem::group_open_delim) { |
| 1056 | is_equal = false; |
| 1057 | rv = parse_group_probabilities(is_equal, error_msg, line); |
| 1058 | } |
| 1059 | else if (c == GroupProbElem::equal_open_delim) { |
| 1060 | is_equal = true; |
| 1061 | rv = parse_group_probabilities(is_equal, error_msg, line); |
| 1062 | } |
| 1063 | else { |
| 1064 | rv = parse_single_probability(error_msg, line); |
| 1065 | } |
| 1066 | return rv; |
| 1067 | } |
| 1068 | |
| 1069 | void |
| 1070 | Probabilities::dump_default_probabilities(const string &fname) |
nothing calls this directly
no outgoing calls
no test coverage detected