MCPcopy Create free account
hub / github.com/NeuralNetworkVerification/Marabou / parseVnnlib

Method parseVnnlib

src/input_parsers/VnnLibParser.cpp:80–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void 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
101int VnnLibParser::parseScript( const Vector<String> &tokens, InputQuery &inputQuery )
102{

Callers

nothing calls this directly

Calls 4

asciiMethod · 0.80
lengthMethod · 0.80
StringClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected