Revert "re factor expression grammar/parser stuff"
This reverts commit c58b8c4f71813a2490cf135573009c92be1a90c4.
This commit is contained in:
parent
0f8deb5e73
commit
83b20c3036
9 changed files with 29 additions and 66 deletions
|
@ -23,11 +23,10 @@
|
|||
|
||||
#include <boost/python.hpp>
|
||||
// mapnik
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/filter_factory.hpp>
|
||||
#include <mapnik/expression_string.hpp>
|
||||
#include <mapnik/expression_evaluator.hpp>
|
||||
#include <mapnik/path_expr_parser.hpp>
|
||||
#include <mapnik/path_expression_grammar.hpp>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
|
||||
|
@ -35,7 +34,6 @@ using mapnik::expression_ptr;
|
|||
using mapnik::parse_expression;
|
||||
using mapnik::to_expression_string;
|
||||
using mapnik::path_expression_ptr;
|
||||
using mapnik::path_processor_type;
|
||||
|
||||
// expression
|
||||
expression_ptr parse_expression_(std::string const& wkt)
|
||||
|
@ -52,17 +50,17 @@ std::string expression_evaluate_(mapnik::expr_node const& expr, mapnik::Feature
|
|||
// path expression
|
||||
path_expression_ptr parse_path_(std::string const& path)
|
||||
{
|
||||
return parse_path(path);
|
||||
return mapnik::parse_path(path);
|
||||
}
|
||||
|
||||
std::string path_to_string_(mapnik::path_expression const& expr)
|
||||
{
|
||||
return path_processor_type::to_string(expr);
|
||||
return mapnik::path_processor_type::to_string(expr);
|
||||
}
|
||||
|
||||
std::string path_evaluate_(mapnik::path_expression const& expr, mapnik::Feature const& f)
|
||||
{
|
||||
return path_processor_type::evaluate(expr, f);
|
||||
return mapnik::path_processor_type::evaluate(expr, f);
|
||||
}
|
||||
|
||||
void export_expression()
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
/*****************************************************************************
|
||||
*
|
||||
* This file is part of Mapnik (c++ mapping toolkit)
|
||||
*
|
||||
* Copyright (C) 2010 Artem Pavlenko
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
//$Id$
|
||||
|
||||
#ifndef MAPNIK_ATTRIBUTE_HPP
|
||||
#define MAPNIK_ATTRIBUTE_HPP
|
||||
|
||||
namespace mapnik {
|
||||
|
||||
struct attribute
|
||||
{
|
||||
std::string name_;
|
||||
explicit attribute(std::string const& name)
|
||||
: name_(name) {}
|
||||
|
||||
template <typename V ,typename F>
|
||||
V value(F const& f) const
|
||||
{
|
||||
return f[name_];
|
||||
}
|
||||
std::string const& name() const { return name_;}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // MAPNIK_ATTRIBUTE_HPP
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
// mapnik
|
||||
#include <mapnik/value.hpp>
|
||||
#include <mapnik/attribute.hpp>
|
||||
// boost
|
||||
#include <boost/variant.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
@ -36,6 +35,21 @@
|
|||
namespace mapnik
|
||||
{
|
||||
|
||||
struct attribute
|
||||
{
|
||||
std::string name_;
|
||||
explicit attribute(std::string const& name)
|
||||
: name_(name) {}
|
||||
|
||||
template <typename V ,typename F>
|
||||
V value(F const& f) const
|
||||
{
|
||||
return f[name_];
|
||||
}
|
||||
std::string const& name() const { return name_;}
|
||||
};
|
||||
|
||||
|
||||
namespace tags {
|
||||
struct plus
|
||||
{
|
||||
|
@ -181,6 +195,8 @@ boost::recursive_wrapper<regex_match_node>,
|
|||
boost::recursive_wrapper<regex_replace_node>
|
||||
> expr_node;
|
||||
|
||||
typedef boost::shared_ptr<expr_node> expression_ptr;
|
||||
|
||||
template <typename Tag> struct make_op;
|
||||
template <> struct make_op<tags::plus> { typedef std::plus<value_type> type;};
|
||||
template <> struct make_op<tags::minus> { typedef std::minus<value_type> type;};
|
||||
|
|
|
@ -25,17 +25,12 @@
|
|||
#ifndef MAPNIK_FILTER_FACTORY_HPP
|
||||
#define MAPNIK_FILTER_FACTORY_HPP
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/config.hpp>
|
||||
#include <mapnik/expression_node.hpp>
|
||||
// stl
|
||||
#include <string>
|
||||
#include <mapnik/expression_grammar.hpp>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
||||
typedef boost::shared_ptr<expr_node> expression_ptr;
|
||||
|
||||
MAPNIK_DECL expression_ptr parse_expression (std::string const& wkt, std::string const& encoding);
|
||||
MAPNIK_DECL expression_ptr parse_expression (std::string const& wkt);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <mapnik/text_symbolizer.hpp>
|
||||
#include <mapnik/markers_symbolizer.hpp>
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/filter_factory.hpp>
|
||||
#include <mapnik/expression_grammar.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
#include <mapnik/color.hpp>
|
||||
#include <mapnik/font_set.hpp>
|
||||
#include <mapnik/graphics.hpp>
|
||||
#include <mapnik/filter_factory.hpp>
|
||||
#include <mapnik/expression_node.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
|
|
@ -90,7 +90,6 @@ source = Split(
|
|||
load_map.cpp
|
||||
memory.cpp
|
||||
params.cpp
|
||||
path_expr_parser.cpp
|
||||
placement_finder.cpp
|
||||
plugin.cpp
|
||||
png_reader.cpp
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
//$Id$
|
||||
|
||||
#include <mapnik/filter_factory.hpp>
|
||||
#include <mapnik/expression_grammar.hpp>
|
||||
#include <mapnik/config_error.hpp>
|
||||
#include <mapnik/unicode.hpp>
|
||||
|
||||
|
|
Loading…
Reference in a new issue