MCPcopy Create free account
hub / github.com/MITK/MITK / ParseExpr

Method ParseExpr

Modules/CppMicroServices/src/usLDAPExpr.cpp:555–594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553}
554
555LDAPExpr LDAPExpr::ParseExpr( ParseState& ps )
556{
557 ps.skipWhite();
558 if (!ps.prefix("("))
559 ps.error(LDAPExprConstants::MALFORMED());
560
561 int op;
562 ps.skipWhite();
563 Byte c = ps.peek();
564 if ( c == '&')
565 {
566 op = AND;
567 }
568 else if ( c == '|' )
569 {
570 op = OR;
571 }
572 else if ( c == '!' )
573 {
574 op = NOT;
575 }
576 else
577 {
578 return ParseSimple(ps);
579 }
580 ps.skip(1); // Ignore the d->m_operator
581
582 std::vector<LDAPExpr> v;
583 do
584 {
585 v.push_back(ParseExpr(ps));
586 ps.skipWhite();
587 } while (ps.peek() == '(');
588
589 std::size_t n = v.size();
590 if (!ps.prefix(")") || n == 0 || (op == NOT && n > 1))
591 ps.error(LDAPExprConstants::MALFORMED());
592
593 return LDAPExpr(op, v);
594}
595
596LDAPExpr LDAPExpr::ParseSimple( ParseState &ps )
597{

Callers

nothing calls this directly

Calls 7

LDAPExprClass · 0.85
skipWhiteMethod · 0.80
peekMethod · 0.80
skipMethod · 0.80
prefixMethod · 0.45
errorMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected