| 155 | trace_format* parse_item_from_format_string(agent* thisAgent); |
| 156 | |
| 157 | trace_format* parse_format_string(agent* thisAgent, const char* string) |
| 158 | { |
| 159 | trace_format* first, *prev, *New; |
| 160 | |
| 161 | format = string; |
| 162 | format_string_error_message = NIL; |
| 163 | |
| 164 | prev = NIL; |
| 165 | first = NIL; /* unnecessary, but gcc -Wall warns without it */ |
| 166 | while (*format != 0) |
| 167 | { |
| 168 | New = parse_item_from_format_string(thisAgent); |
| 169 | if (!New) |
| 170 | { |
| 171 | if (prev) |
| 172 | { |
| 173 | prev->next = NIL; |
| 174 | } |
| 175 | else |
| 176 | { |
| 177 | first = NIL; |
| 178 | } |
| 179 | deallocate_trace_format_list(thisAgent, first); |
| 180 | print(thisAgent, "Error: bad trace format string: %s\n", string); |
| 181 | if (format_string_error_message) |
| 182 | { |
| 183 | print(thisAgent, " %s\n", format_string_error_message); |
| 184 | print(thisAgent, " Error found at: %s\n", format); |
| 185 | } |
| 186 | return NIL; |
| 187 | } |
| 188 | if (prev) |
| 189 | { |
| 190 | prev->next = New; |
| 191 | } |
| 192 | else |
| 193 | { |
| 194 | first = New; |
| 195 | } |
| 196 | prev = New; |
| 197 | } |
| 198 | if (prev) |
| 199 | { |
| 200 | prev->next = NIL; |
| 201 | } |
| 202 | else |
| 203 | { |
| 204 | first = NIL; |
| 205 | } |
| 206 | |
| 207 | return first; |
| 208 | } |
| 209 | |
| 210 | list* parse_attribute_path_in_brackets(agent* thisAgent) |
| 211 | { |
no test coverage detected