2012-05-27 23:50:09 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* This file is part of Mapnik (c++ mapping toolkit)
|
|
|
|
*
|
2015-06-16 12:49:16 +02:00
|
|
|
* Copyright (C) 2015 Artem Pavlenko
|
2012-05-27 23:50:09 +02:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef MAPNIK_TRANSFORM_EXPRESSION_GRAMMAR_HPP
|
|
|
|
#define MAPNIK_TRANSFORM_EXPRESSION_GRAMMAR_HPP
|
|
|
|
|
|
|
|
// mapnik
|
|
|
|
#include <mapnik/expression_grammar.hpp>
|
2014-07-24 23:31:59 +02:00
|
|
|
#include <mapnik/expression_node_types.hpp>
|
2012-05-27 23:50:09 +02:00
|
|
|
#include <mapnik/transform_expression.hpp>
|
|
|
|
|
|
|
|
// spirit
|
2013-01-08 23:17:31 +01:00
|
|
|
#include <boost/spirit/include/qi.hpp>
|
2012-05-27 23:50:09 +02:00
|
|
|
|
|
|
|
namespace mapnik {
|
|
|
|
|
|
|
|
namespace qi = boost::spirit::qi;
|
|
|
|
|
|
|
|
template <typename Iterator>
|
|
|
|
struct transform_expression_grammar
|
|
|
|
: qi::grammar<Iterator, transform_list(), space_type>
|
|
|
|
{
|
2014-04-30 09:11:27 +02:00
|
|
|
explicit transform_expression_grammar();
|
2012-08-19 16:20:08 +02:00
|
|
|
|
2014-07-07 19:23:15 +02:00
|
|
|
using node_rule = qi::rule<Iterator, transform_node(), space_type>;
|
|
|
|
using list_rule = qi::rule<Iterator, transform_list(), space_type>;
|
2012-05-27 23:50:09 +02:00
|
|
|
|
|
|
|
// rules
|
2012-08-19 16:20:08 +02:00
|
|
|
qi::rule<Iterator, std::string(), space_type> attr;
|
|
|
|
qi::rule<Iterator, expr_node(), space_type> atom;
|
|
|
|
qi::rule<Iterator, expr_node(), space_type> expr;
|
|
|
|
qi::rule<Iterator, expr_node(), space_type> sep_atom;
|
|
|
|
qi::rule<Iterator, expr_node(), space_type> sep_expr;
|
2012-05-27 23:50:09 +02:00
|
|
|
qi::rule<Iterator, transform_list(), space_type> start;
|
|
|
|
qi::rule<Iterator, transform_node(), space_type> transform_;
|
|
|
|
qi::rule<Iterator, transform_node(), space_type> matrix;
|
|
|
|
qi::rule<Iterator, transform_node(), space_type> translate;
|
|
|
|
qi::rule<Iterator, transform_node(), space_type> scale;
|
2012-08-19 16:20:08 +02:00
|
|
|
qi::rule<Iterator, transform_node(), space_type> rotate;
|
2012-05-27 23:50:09 +02:00
|
|
|
qi::rule<Iterator, transform_node(), space_type> skewX;
|
|
|
|
qi::rule<Iterator, transform_node(), space_type> skewY;
|
2014-04-30 09:11:27 +02:00
|
|
|
mapnik::expression_grammar<Iterator> g_;
|
2012-05-27 23:50:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mapnik
|
|
|
|
|
|
|
|
#endif // MAPNIK_TRANSFORM_EXPRESSION_GRAMMAR_HPP
|