Current Version: 1.0.33
Project Name: csspp
expression.h
Go to the documentation of this file.
1// Copyright (c) 2015-2025 Made to Order Software Corp. All Rights Reserved
2//
3// This program is free software; you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation; either version 2 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License along
14// with this program; if not, write to the Free Software Foundation, Inc.,
15// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16#pragma once
17
18// self
19//
20#include "csspp/node.h"
21
22
23namespace csspp
24{
25
27{
28public:
30
31 virtual node::pointer_t get_variable(std::string const & variable_name, bool global_only = false) const = 0;
33};
34
35// bare pointer problem
36#pragma GCC diagnostic push
37#pragma GCC diagnostic ignored "-Weffc++"
39{
40public:
42
44
47
48 static bool boolean(node::pointer_t n);
49 static void set_unique_id_counter(int counter);
50 static int get_unique_id_counter();
51
52private:
53 typedef std::map<std::string, node::pointer_t> variable_vector_t;
54 typedef std::vector<std::string> dimension_vector_t;
55
56 bool end_of_nodes();
57 void mark_start();
59 void next();
60
62
64
65 bool is_label() const;
67
69
71
73
77
80
82
84 std::string multiplicative_dimension(position const & pos, std::string const & dim1, node_type_t const op, std::string const & dim2);
88
91
93
95
96 // in internal_functions.cpp
103
149
151
153 size_t f_pos = 0;
154 size_t f_start = static_cast<size_t>(-1);
159};
160#pragma GCC diagnostic pop
161
162} // namespace csspp
163// vim: ts=4 sw=4 et
virtual node::pointer_t get_variable(std::string const &variable_name, bool global_only=false) const =0
virtual node::pointer_t execute_user_function(node::pointer_t func)=0
node::pointer_t conditional()
node::pointer_t equality()
node::pointer_t internal_function__atan(node::pointer_t func)
node::pointer_t internal_function__log(node::pointer_t func)
void compile_args(bool divide_font_metrics)
bool is_label() const
Definition expr_list.cpp:39
node::pointer_t internal_function__acos(node::pointer_t func)
node::pointer_t internal_function__floor(node::pointer_t func)
node::pointer_t logical_and()
node::pointer_t internal_function__adjust_hue(node::pointer_t func)
node::pointer_t internal_function__get_string_or_identifier(node::pointer_t func, size_t argn, std::string &str)
node::pointer_t internal_function__min(node::pointer_t func)
node::pointer_t internal_function__integer(node::pointer_t func)
node::pointer_t excecute_function(node::pointer_t func)
node::pointer_t f_current
Definition expression.h:155
node::pointer_t internal_function__max(node::pointer_t func)
node::pointer_t internal_function__type_of(node::pointer_t func)
node::pointer_t internal_function__variable_exists(node::pointer_t func)
std::string multiplicative_dimension(position const &pos, std::string const &dim1, node_type_t const op, std::string const &dim2)
bool is_less_than(node::pointer_t lhs, node::pointer_t rhs)
node::pointer_t internal_function__blue(node::pointer_t func)
node::pointer_t internal_function__unique_id(node::pointer_t funct)
node::pointer_t internal_function__get_color(node::pointer_t func, size_t argn, color &col)
node::pointer_t internal_function__tan(node::pointer_t func)
node::pointer_t internal_function__if(node::pointer_t func)
node::pointer_t internal_function__hsla(node::pointer_t func)
node::pointer_t logical_or()
node::pointer_t internal_function__asin(node::pointer_t func)
static void set_unique_id_counter(int counter)
node::pointer_t internal_function__identifier(node::pointer_t func)
node::pointer_t internal_function__rgb(node::pointer_t func)
node::pointer_t multiplicative()
node::pointer_t apply_power(node::pointer_t lhs, node::pointer_t rhs)
node::pointer_t internal_function__get_number_or_percent(node::pointer_t func, size_t argn, decimal_number_t &number)
node::pointer_t additive()
std::vector< std::string > dimension_vector_t
Definition expression.h:54
node::pointer_t expression_list()
Definition expr_list.cpp:52
node::pointer_t internal_function__round(node::pointer_t func)
node::pointer_t compile_list(node::pointer_t parent)
node::pointer_t internal_function__percentage(node::pointer_t func)
node::pointer_t compile()
node::pointer_t internal_function__lightness(node::pointer_t func)
node::pointer_t internal_function__saturation(node::pointer_t func)
node::pointer_t internal_function__str_length(node::pointer_t func)
expression_variables_interface * f_variable_handler
Definition expression.h:158
node::pointer_t internal_function__abs(node::pointer_t func)
node::pointer_t internal_function__red(node::pointer_t func)
node::pointer_t internal_function__green(node::pointer_t func)
node::pointer_t internal_function__sin(node::pointer_t func)
node::pointer_t internal_function__frgb(node::pointer_t func)
node::pointer_t internal_function__inspect(node::pointer_t func)
node::pointer_t internal_function__decimal_number(node::pointer_t func)
node::pointer_t internal_function__random(node::pointer_t func)
node::pointer_t internal_function__global_variable_exists(node::pointer_t func)
node::pointer_t power()
std::string rebuild_dimension(dimension_vector_t const &dividend, dimension_vector_t const &divisor)
node::pointer_t internal_function__get_number(node::pointer_t func, size_t argn, decimal_number_t &number)
void set_variable_handler(expression_variables_interface *handler)
node::pointer_t replace_with_result(node::pointer_t result)
node::pointer_t internal_function__not(node::pointer_t func)
node::pointer_t internal_function__hsl(node::pointer_t func)
node::pointer_t internal_function__rgba(node::pointer_t func)
node::pointer_t assignment()
node::pointer_t unary()
static int get_unique_id_counter()
node::pointer_t post()
void dimensions_to_vectors(position const &pos, std::string const &dimension, dimension_vector_t &dividend, dimension_vector_t &divisor)
node::pointer_t relational()
node::pointer_t internal_function__function_exists(node::pointer_t func)
variable_vector_t f_variables
Definition expression.h:156
node::pointer_t internal_function__hue(node::pointer_t func)
bool is_comparable(node::pointer_t lhs, node::pointer_t rhs)
node::pointer_t f_node
Definition expression.h:152
node::pointer_t internal_function__frgba(node::pointer_t func)
node::pointer_t internal_function__get_string(node::pointer_t func, size_t argn, std::string &str)
node::pointer_t multiply(node_type_t op, node::pointer_t lhs, node::pointer_t rhs)
node::pointer_t internal_function__string(node::pointer_t func)
static bool boolean(node::pointer_t n)
Check whether a node represents true or false.
node::pointer_t internal_function__sign(node::pointer_t func)
node::pointer_t internal_function__unit(node::pointer_t func)
node::pointer_t internal_function__sqrt(node::pointer_t func)
node::pointer_t internal_function__cos(node::pointer_t func)
node::pointer_t internal_function__get_any(node::pointer_t func, size_t argn)
node::pointer_t internal_function__ceil(node::pointer_t func)
std::map< std::string, node::pointer_t > variable_vector_t
Definition expression.h:53
node::pointer_t internal_function__alpha(node::pointer_t func)
bool is_equal(node::pointer_t lhs, node::pointer_t rhs)
std::shared_ptr< node > pointer_t
Definition node.h:132
The namespace of all the classes in the CSS Preprocessor.
Definition csspp.h:48
node_type_t
Definition node.h:41
double decimal_number_t
Definition csspp.h:59

Documentation of CSS Preprocessor.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.