SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
expressionevaluator.h File Reference

Minimal SQL-flavoured expression evaluator for the RuleBasedRenderer. Slice X.25. More...

#include <QString>
#include <QVariantMap>
Include dependency graph for expressionevaluator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OpenSWMM::Render::ExpressionEvaluator
 

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 

Detailed Description

Minimal SQL-flavoured expression evaluator for the RuleBasedRenderer. Slice X.25.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

Goal: cover the QGIS / SQL-WHERE common cases so styles authored externally evaluate correctly, without rebuilding a full expression language.

Grammar (informal): expr ::= or or ::= and ( "OR" and )* and ::= not ( "AND" not )* not ::= "NOT" not | comparison comp ::= primary [ ("=" | "!=" | "<>" | "<" | "<=" | ">" | ">=") primary | "IS" ["NOT"] "NULL" | "LIKE" string ] primary ::= number | string | identifier | "(" expr ")"

Strings: single-quoted, with "''" as embedded quote. Numbers: integer or decimal, no exponent. Identifiers: bare attribute names — read out of the QVariantMap by the same key.

The eval function returns true on match, false otherwise; malformed expressions return false and a non-empty error string in lastError().