| 78 | } |
| 79 | |
| 80 | void VnnLibParser::parseVnnlib( const String &vnnlibContent, InputQuery &inputQuery ) |
| 81 | { |
| 82 | std::regex re( R"(\(|\)|[\w\-\\.]+|<=|>=|\+|-|\*)" ); |
| 83 | |
| 84 | auto tokens_begin = std::cregex_token_iterator( |
| 85 | vnnlibContent.ascii(), vnnlibContent.ascii() + vnnlibContent.length(), re ); |
| 86 | auto tokens_end = std::cregex_token_iterator(); |
| 87 | |
| 88 | Vector<String> all_tokens; |
| 89 | |
| 90 | for ( std::cregex_token_iterator it = tokens_begin; it != tokens_end; ++it ) |
| 91 | { |
| 92 | auto match = *it; |
| 93 | auto match_str = String( match.str().c_str() ); |
| 94 | |
| 95 | all_tokens.append( match_str ); |
| 96 | } |
| 97 | |
| 98 | parseScript( all_tokens, inputQuery ); |
| 99 | } |
| 100 | |
| 101 | int VnnLibParser::parseScript( const Vector<String> &tokens, InputQuery &inputQuery ) |
| 102 | { |