MCPcopy Create free account
hub / github.com/PDAL/PDAL / andexpr

Method andexpr

filters/private/expr/ConditionalParser.cpp:44–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44bool ConditionalParser::andexpr(Expression& expr)
45{
46 if (!notexpr(expr))
47 return false;
48
49 while (true)
50 {
51 if (!match(TokenType::And))
52 return true;
53
54 if (!notexpr(expr))
55 {
56 setError("Expected expression following '&&'.");
57 return false;
58 }
59
60 NodePtr right = expr.popNode();
61 NodePtr left = expr.popNode();
62
63 if (left->isValue())
64 {
65 setError("Can't apply '&&' to numeric expression '" + left->print() + "'.");
66 return false;
67 }
68 if (right->isValue())
69 {
70 setError("Can't apply '&&' to numeric expression '" + right->print() + "'.");
71 return false;
72 }
73 expr.pushNode(NodePtr(new BoolNode(NodeType::And, std::move(left), std::move(right))));
74 }
75 return true;
76}
77
78bool ConditionalParser::notexpr(Expression& expr)
79{

Callers

nothing calls this directly

Calls 4

popNodeMethod · 0.80
isValueMethod · 0.80
pushNodeMethod · 0.80
printMethod · 0.45

Tested by

no test coverage detected