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

Method orexpr

filters/private/expr/ConditionalParser.cpp:15–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15bool ConditionalParser::orexpr(Expression& expr)
16{
17 if (!andexpr(expr))
18 return false;
19
20 while (true)
21 {
22 if (!match(TokenType::Or))
23 return true;
24
25 if (!andexpr(expr))
26 {
27 setError("Expected expression following '||'.");
28 return false;
29 }
30
31 NodePtr right = expr.popNode();
32 NodePtr left = expr.popNode();
33
34 if (left->isValue() || right->isValue())
35 {
36 setError("Can't apply '||' to numeric expression.");
37 return false;
38 }
39 expr.pushNode(NodePtr(new BoolNode(NodeType::Or, std::move(left), std::move(right))));
40 }
41 return true;
42}
43
44bool ConditionalParser::andexpr(Expression& expr)
45{

Callers

nothing calls this directly

Calls 3

popNodeMethod · 0.80
isValueMethod · 0.80
pushNodeMethod · 0.80

Tested by

no test coverage detected