MCPcopy Create free account
hub / github.com/csmith-project/csmith / parse_line

Method parse_line

src/Probabilities.cpp:1043–1067  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1041const char Probabilities::comment_line_prefix = '#';
1042
1043bool
1044Probabilities::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
1069void
1070Probabilities::dump_default_probabilities(const string &fname)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected