372 token t(f_lexer.next_token());
373 if(t.
tok() == token_t::TOK_EOF)
386 case token_t::TOK_REGEX:
390 f_validators.push_back(v);
392 t = f_lexer.next_token();
396 case token_t::TOK_IDENTIFIER:
400 t = f_lexer.next_token();
401 if(t.
tok() == token_t::TOK_OPEN_PARENTHESIS)
403 t = f_lexer.next_token();
404 if(t.
tok() != token_t::TOK_CLOSE_PARENTHESIS)
408 if(t.
tok() == token_t::TOK_INVALID)
412 if(t.
tok() != token_t::TOK_IDENTIFIER
413 && t.
tok() != token_t::TOK_STRING
414 && t.
tok() != token_t::TOK_REGEX)
416 cppthread::log << cppthread::log_level_t::error
417 <<
"validator(): expected a regex, an identifier or a string inside the () of a parameter. Remaining input: \""
425 t = f_lexer.next_token();
426 if(t.
tok() == token_t::TOK_CLOSE_PARENTHESIS)
431 if(t.
tok() == token_t::TOK_EOF)
433 cppthread::log << cppthread::log_level_t::error
434 <<
"validator(): parameter list must end with ')'. Remaining input: \""
441 if(t.
tok() != token_t::TOK_COMMA)
443 if(t.
tok() == token_t::TOK_INVALID)
447 cppthread::log << cppthread::log_level_t::error
448 <<
"validator(): parameters must be separated by ','. Remaining input: \""
456 t = f_lexer.next_token();
458 while(t.
tok() == token_t::TOK_COMMA);
461 t = f_lexer.next_token();
464 f_validators.push_back(v);
469 if(t.
tok() != token_t::TOK_INVALID)
471 cppthread::log << cppthread::log_level_t::error
472 <<
"validator(): unexpected token in validator definition;"
473 " expected an identifier. Remaining input: \""
482 if(t.
tok() == token_t::TOK_EOF)
487 if(t.
tok() != token_t::TOK_OR)
489 if(t.
tok() != token_t::TOK_INVALID)
491 cppthread::log << cppthread::log_level_t::error
492 <<
"validator(): validator definitions must be separated by '|'. Remaining input: \""
500 t = f_lexer.next_token();
502 snapdev::NOT_REACHED();