6#include "mapcssexpression_p.h"
7#include "mapcssparser_impl.h"
8#include "mapcssparsercontext_p.h"
9#include "mapcssscanner.h"
10#include "mapcssterm_p.h"
14class MapCSSExpressionParserContext :
public MapCSSParserContext {
16 MapCSSExpressionParserContext() : MapCSSParserContext(ParseEvalExpression) {};
22MapCSSExpression::MapCSSExpression() =
default;
23MapCSSExpression::MapCSSExpression(MapCSSExpression&&) noexcept = default;
25MapCSSExpression::MapCSSExpression(MapCSSTerm *term)
30MapCSSExpression::~MapCSSExpression() =
default;
32MapCSSExpression& MapCSSExpression::operator=(MapCSSExpression&&) noexcept = default;
34bool MapCSSExpression::isValid()
const
39void MapCSSExpression::compile(
const OSM::DataSet &dataSet)
41 m_term->compile(dataSet);
44MapCSSValue MapCSSExpression::evaluate(
const MapCSSExpressionContext &context)
const
46 return m_term->evaluate(context);
49void MapCSSExpression::write(
QIODevice *out)
const
54MapCSSExpression MapCSSExpression::fromString(
const char *str)
56 MapCSSExpressionParserContext context;
59 if (yylex_init_extra(&context, &scanner)) {
62 const auto lexerCleanup = qScopeGuard([&scanner]{ yylex_destroy(scanner); });
64 YY_BUFFER_STATE state;
65 state = yy_scan_string(str, scanner);
66 if (yyparse(&context, scanner)) {
71 yy_delete_buffer(state, scanner);
73 return MapCSSExpression(context.m_term);
A set of nodes, ways and relations.
OSM-based multi-floor indoor maps for buildings.