Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::client::macro_processor Struct Reference
+ Inheritance diagram for Slic3r::client::macro_processor:
+ Collaboration diagram for Slic3r::client::macro_processor:

Public Types

typedef qi::rule< Iterator, expr(const MyContext *), skipperRuleExpression
 

Public Member Functions

 macro_processor ()
 

Public Attributes

qi::rule< Iterator, std::string(const MyContext *), qi::locals< bool >, skipperstart
 
qi::rule< Iterator, std::string(), skippertext
 
qi::rule< Iterator, std::string(const MyContext *), skippertext_block
 
qi::rule< Iterator, std::string(const MyContext *), skipperblock
 
qi::rule< Iterator, std::string(const MyContext *), skipperstatement
 
qi::rule< Iterator, std::string(const MyContext *), skippermacros
 
qi::rule< Iterator, std::string(const MyContext *), skipperif_text_block
 
qi::rule< Iterator, std::string(const MyContext *), skipperif_macros
 
qi::rule< Iterator, std::string(const MyContext *), skipperelse_macros
 
qi::rule< Iterator, std::string(const MyContext *), skipperlegacy_variable_expansion
 
qi::rule< Iterator, IteratorRange(), skipperidentifier
 
qi::rule< Iterator, expr(const MyContext *), qi::locals< bool >, skipperconditional_expression
 
RuleExpression logical_or_expression
 
RuleExpression logical_and_expression
 
RuleExpression relational_expression
 
RuleExpression additive_expression
 
RuleExpression equality_expression
 
RuleExpression multiplicative_expression
 
RuleExpression unary_expression
 
RuleExpression optional_parameter
 
qi::rule< Iterator, IteratorRange(), skipperregular_expression
 
qi::rule< Iterator, bool(const MyContext *), skipperbool_expr_eval
 
qi::rule< Iterator, OptWithPos(const MyContext *), qi::locals< OptWithPos, int >, skippervariable_reference
 
qi::rule< Iterator, OptWithPos(const MyContext *), skippervariable
 
qi::rule< Iterator, expr(const MyContext *), skipperis_nil_test
 
qi::rule< Iterator, expr(const MyContext *), qi::locals< expr >, skipperone_of
 
qi::rule< Iterator, expr(const MyContext *, const expr &param), skipperone_of_list
 
qi::rule< Iterator, expr(const MyContext *), qi::locals< expr >, skipperinterpolate_table
 
qi::rule< Iterator, InterpolateTableContext(const MyContext *, const expr &param), skipperinterpolate_table_list
 
qi::rule< Iterator, std::string(const MyContext *), qi::locals< bool >, skipperif_else_output
 
qi::rule< Iterator, std::string(const MyContext *), qi::locals< OptWithPos >, skipperassignment_statement
 
qi::rule< Iterator, std::string(const MyContext *), qi::locals< bool, MyContext::NewOldVariable >, skippernew_variable_statement
 
qi::rule< Iterator, std::vector< expr >(const MyContext *), skipperinitializer_list
 
qi::symbols< char > keywords
 

Detailed Description

Member Typedef Documentation

◆ RuleExpression

Constructor & Destructor Documentation

◆ macro_processor()

Slic3r::client::macro_processor::macro_processor ( )
inline
1919 : macro_processor::base_type(start)
1920 {
1921 using namespace qi::labels;
1922 qi::alpha_type alpha;
1923 qi::alnum_type alnum;
1924 qi::eps_type eps;
1925 qi::raw_type raw;
1926 qi::lit_type lit;
1927 qi::lexeme_type lexeme;
1928 qi::no_skip_type no_skip;
1929 qi::real_parser<double, strict_real_policies_without_nan_inf> strict_double;
1930 spirit_encoding::char_type char_;
1931 utf8_char_parser utf8char;
1932 spirit::bool_type bool_;
1933 spirit::int_type int_;
1934 spirit::double_type double_;
1935 spirit_encoding::string_type string;
1936 spirit::eoi_type eoi;
1937 spirit::repository::qi::iter_pos_type iter_pos;
1938 auto kw = spirit::repository::qi::distinct(qi::copy(alnum | '_'));
1939
1940 qi::_val_type _val;
1941 qi::_1_type _1;
1942 qi::_2_type _2;
1943 qi::_3_type _3;
1944 qi::_4_type _4;
1945 qi::_a_type _a;
1946 qi::_b_type _b;
1947 qi::_r1_type _r1;
1948 qi::_r2_type _r2;
1949
1950 // Starting symbol of the grammer.
1951 // The leading eps is required by the "expectation point" operator ">".
1952 // Without it, some of the errors would not trigger the error handler.
1953 // Also the start symbol switches between the "full macro syntax" and a "boolean expression only",
1954 // depending on the context->just_boolean_expression flag. This way a single static expression parser
1955 // could serve both purposes.
1956 start =
1957 ( (eps(px::bind(&MyContext::evaluate_full_macro, _r1)) > text_block(_r1) [_val=_1])
1958 | conditional_expression(_r1) [ px::bind(&expr::evaluate_boolean_to_string, _1, _val) ]
1959 ) > eoi;
1960 start.name("start");
1961 qi::on_error<qi::fail>(start, px::bind(&MyContext::process_error_message, _r1, _4, _1, _2, _3));
1962
1963 text_block = *(
1964 text [_val+=_1]
1965 // Allow back tracking after '{' in case of a text_block embedded inside a condition.
1966 // In that case the inner-most {else} wins and the {if}/{elsif}/{else} shall be paired.
1967 // {elsif}/{else} without an {if} will be allowed to back track from the embedded text_block.
1968 | (lit('{') >> (macros(_r1)[_val += _1] > '}') | '}')
1969 | (lit('[') > legacy_variable_expansion(_r1) [_val+=_1] > ']')
1970 );
1971 text_block.name("text_block");
1972
1973 // Free-form text up to a first brace, including spaces and newlines.
1974 // The free-form text will be inserted into the processed text without a modification.
1975 text = no_skip[raw[+(utf8char - char_('[') - char_('{'))]];
1976 text.name("text");
1977
1978 // New style of macro expansion.
1979 // The macro expansion may contain numeric or string expressions, ifs and cases.
1980 macros =
1981 +(block(_r1)[_val += _1] | (statement(_r1) > (+lit(';') | &lit('}')))[_val += _1] | +lit(';'));
1982 macros.name("macro");
1983 // if_macros and else_macros only differ by the look-ahead ending condition, which is to not have to repeat the last semicolon
1984 // at the end of the block.
1985 if_macros = kw["then"] > *(block(_r1)[_val += _1] | (statement(_r1) > (+lit(';') | &(kw["elsif"] | kw["else"] | kw["endif"])))[_val += _1] | +lit(';'));
1986 if_macros.name("if_macros");
1987 else_macros = *(block(_r1)[_val += _1] | (statement(_r1) > (+lit(';') | &kw["endif"]))[_val += _1] | +lit(';'));
1988 else_macros.name("else_macros");
1989
1990 // Blocks do not require a separating semicolon.
1991 block =
1992 (kw["if"] > if_else_output(_r1)[_val = _1])
1993 // (kw["switch"] ...
1994 ;
1995 block.name("block");
1996
1997 // Statements require a separating semicolon.
1998 statement =
1999 (assignment_statement(_r1) [_val = _1])
2000 | (new_variable_statement(_r1)[_val = _1])
2001 | (conditional_expression(_r1)[px::bind(&expr::to_string2, _1, _val)])
2002 ;
2003
2004 // An if expression enclosed in {} (the outmost {} are already parsed by the caller).
2005 // Also }{ could be replaced with ; to simplify writing of pure code.
2007 eps[_a=true] >
2008 (bool_expr_eval(_r1)[px::bind(&MyContext::block_enter, _r1, _1)] > (if_text_block(_r1) | if_macros(_r1)))
2009 [px::bind(&MyContext::block_exit, _r1, _1, _a, _2, _val)] >
2010 *((kw["elsif"] > bool_expr_eval(_r1)[px::bind(&MyContext::block_enter, _r1, _1 && _a)] > (if_text_block(_r1) | if_macros(_r1)))
2011 [px::bind(&MyContext::block_exit, _r1, _1, _a, _2, _val)]) >
2012 -(kw["else"] > eps[px::bind(&MyContext::block_enter, _r1, _a)] > (if_text_block(_r1) | else_macros(_r1)))
2013 [px::bind(&MyContext::block_exit, _r1, _a, _a, _1, _val)] >
2014 kw["endif"];
2015 if_else_output.name("if_else_output");
2016 if_text_block = (lit('}') > text_block(_r1) > '{');
2017 if_text_block.name("if_text_block");
2018
2019 // A switch expression enclosed in {} (the outmost {} are already parsed by the caller).
2020/*
2021 switch_output =
2022 eps[_b=true] >
2023 omit[expr(_r1)[_a=_1]] > '}' > text_block(_r1)[px::bind(&expr::set_if_equal, _a, _b, _1, _val)] > '{' >
2024 *("elsif" > omit[bool_expr_eval(_r1)[_a=_1]] > '}' > text_block(_r1)[px::bind(&expr::set_if, _a, _b, _1, _val)]) >>
2025 -("else" > '}' >> text_block(_r1)[px::bind(&expr::set_if, _b, _b, _1, _val)]) >
2026 "endif";
2027*/
2028
2029 // Legacy variable expansion of the original Slic3r, in the form of [scalar_variable] or [vector_variable_index].
2031 (identifier >> &lit(']'))
2032 [ px::bind(&MyContext::legacy_variable_expansion, _r1, _1, _val) ]
2033 | (identifier > lit('[') > identifier > ']')
2034 [ px::bind(&MyContext::legacy_variable_expansion2, _r1, _1, _2, _val) ]
2035 ;
2036 legacy_variable_expansion.name("legacy_variable_expansion");
2037
2038 identifier =
2039 ! kw[keywords] >>
2040 raw[lexeme[(alpha | '_') >> *(alnum | '_')]];
2041 identifier.name("identifier");
2042
2044 logical_or_expression(_r1) [_val = _1]
2045 >> -('?' > eps[px::bind(&expr::evaluate_boolean, _val, _a)] >
2046 eps[px::bind(&MyContext::block_enter, _r1, _a)] > conditional_expression(_r1)[px::bind(&MyContext::block_exit_ternary, _r1, _a, _1, _val)]
2047 > ':' >
2048 eps[px::bind(&MyContext::block_enter, _r1, ! _a)] > conditional_expression(_r1)[px::bind(&MyContext::block_exit_ternary, _r1, ! _a, _1, _val)]);
2049 conditional_expression.name("conditional_expression");
2050
2052 logical_and_expression(_r1) [_val = _1]
2053 >> *( ((kw["or"] | "||") > logical_and_expression(_r1) ) [px::bind(&expr::logical_or, _val, _1)] );
2054 logical_or_expression.name("logical_or_expression");
2055
2057 equality_expression(_r1) [_val = _1]
2058 >> *( ((kw["and"] | "&&") > equality_expression(_r1) ) [px::bind(&expr::logical_and, _val, _1)] );
2059 logical_and_expression.name("logical_and_expression");
2060
2062 relational_expression(_r1) [_val = _1]
2063 >> *( ("==" > relational_expression(_r1) ) [px::bind(&expr::equal, _val, _1)]
2064 | ("!=" > relational_expression(_r1) ) [px::bind(&expr::not_equal, _val, _1)]
2065 | ("<>" > relational_expression(_r1) ) [px::bind(&expr::not_equal, _val, _1)]
2066 | ("=~" > regular_expression ) [px::bind(&expr::regex_matches, _val, _1)]
2067 | ("!~" > regular_expression ) [px::bind(&expr::regex_doesnt_match, _val, _1)]
2068 );
2069 equality_expression.name("bool expression");
2070
2071 // Evaluate a boolean expression stored as expr into a boolean value.
2072 // Throw if the equality_expression does not produce a expr of boolean type.
2073 bool_expr_eval = conditional_expression(_r1) [ px::bind(&expr::evaluate_boolean, _1, _val) ];
2074 bool_expr_eval.name("bool_expr_eval");
2075
2077 additive_expression(_r1) [_val = _1]
2078 >> *( ("<=" > additive_expression(_r1) ) [px::bind(&expr::leq, _val, _1)]
2079 | (">=" > additive_expression(_r1) ) [px::bind(&expr::geq, _val, _1)]
2080 | (lit('<') > additive_expression(_r1) ) [px::bind(&expr::lower, _val, _1)]
2081 | (lit('>') > additive_expression(_r1) ) [px::bind(&expr::greater, _val, _1)]
2082 );
2083 relational_expression.name("relational_expression");
2084
2086 multiplicative_expression(_r1) [_val = _1]
2087 >> *( (lit('+') > multiplicative_expression(_r1) ) [_val += _1]
2088 | (lit('-') > multiplicative_expression(_r1) ) [_val -= _1]
2089 );
2090 additive_expression.name("additive_expression");
2091
2093 unary_expression(_r1) [_val = _1]
2094 >> *( (lit('*') > unary_expression(_r1) ) [_val *= _1]
2095 | (lit('/') > unary_expression(_r1) ) [_val /= _1]
2096 | (lit('%') > unary_expression(_r1) ) [_val %= _1]
2097 );
2098 multiplicative_expression.name("multiplicative_expression");
2099
2101 variable_reference(_r1)[_a = _1] >> '=' >
2102 ( // Consumes also '(' conditional_expression ')', that means enclosing an expression into braces makes it a single value vector initializer.
2104 // Process it before conditional_expression, as conditional_expression requires a vector reference to be augmented with an index.
2105 // Only process such variable references, which return a naked vector variable.
2106 | eps(px::bind(&MyContext::is_vector_variable_reference, _a)) >>
2108 // Would NOT consume '(' conditional_expression ')' because such value was consumed with the expression above.
2111 | (kw["repeat"] > "(" > additive_expression(_r1) > "," > conditional_expression(_r1) > ")")
2112 [px::bind(&MyContext::vector_variable_assign_array, _r1, _a, _1, _2)]
2113 );
2114
2116 (kw["local"][_a = false] | kw["global"][_a = true]) > identifier[px::bind(&MyContext::new_old_variable, _r1, _a, _1, _b)] > lit('=') >
2117 ( // Consumes also '(' conditional_expression ')', that means enclosing an expression into braces makes it a single value vector initializer.
2119 // Process it before conditional_expression, as conditional_expression requires a vector reference to be augmented with an index.
2120 // Only process such variable references, which return a naked vector variable.
2121 | eps(px::bind(&MyContext::could_be_vector_variable_reference, _b)) >>
2122 variable_reference(_r1)[px::ref(qi::_pass) = px::bind(&MyContext::vector_variable_new_from_copy, _r1, _a, _b, _1)]
2123 // Would NOT consume '(' conditional_expression ')' because such value was consumed with the expression above.
2125 [px::bind(&MyContext::scalar_variable_new_from_scalar_expression, _r1, _a, _b, _1)]
2126 | (kw["repeat"] > "(" > additive_expression(_r1) > "," > conditional_expression(_r1) > ")")
2127 [px::bind(&MyContext::vector_variable_new_from_array, _r1, _a, _b, _1, _2)]
2128 );
2129 initializer_list = lit('(') >
2130 ( lit(')') |
2131 ( conditional_expression(_r1)[px::bind(&MyContext::initializer_list_append, _val, _1)] >
2132 *(lit(',') > conditional_expression(_r1)[px::bind(&MyContext::initializer_list_append, _val, _1)]) >
2133 lit(')')
2134 )
2135 );
2136
2137 unary_expression = iter_pos[px::bind(&FactorActions::set_start_pos, _1, _val)] >> (
2138 variable_reference(_r1) [px::bind(&MyContext::variable_value, _r1, _1, _val)]
2139 | (lit('(') > conditional_expression(_r1) > ')' > iter_pos) [ px::bind(&FactorActions::expr_, _1, _2, _val) ]
2140 | (lit('-') > unary_expression(_r1) ) [ px::bind(&FactorActions::minus_, _1, _val) ]
2141 | (lit('+') > unary_expression(_r1) > iter_pos) [ px::bind(&FactorActions::expr_, _1, _2, _val) ]
2142 | ((kw["not"] | '!') > unary_expression(_r1) > iter_pos) [ px::bind(&FactorActions::not_, _1, _val) ]
2143 | (kw["min"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > ')')
2144 [ px::bind(&expr::min, _val, _2) ]
2145 | (kw["max"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > ')')
2146 [ px::bind(&expr::max, _val, _2) ]
2147 | (kw["random"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > ')')
2148 [ px::bind(&MyContext::random, _r1, _val, _2) ]
2149 | (kw["digits"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > optional_parameter(_r1))
2150 [ px::bind(&expr::digits<false>, _val, _2, _3) ]
2151 | (kw["zdigits"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > optional_parameter(_r1))
2152 [ px::bind(&expr::digits<true>, _val, _2, _3) ]
2153 | (kw["int"] > '(' > conditional_expression(_r1) > ')') [ px::bind(&FactorActions::to_int, _1, _val) ]
2154 | (kw["round"] > '(' > conditional_expression(_r1) > ')') [ px::bind(&FactorActions::round, _1, _val) ]
2155 | (kw["is_nil"] > '(' > variable_reference(_r1) > ')') [px::bind(&MyContext::is_nil_test, _r1, _1, _val)]
2156 | (kw["one_of"] > '(' > one_of(_r1) > ')') [ _val = _1 ]
2157 | (kw["empty"] > '(' > variable_reference(_r1) > ')') [px::bind(&MyContext::is_vector_empty, _r1, _1, _val)]
2158 | (kw["size"] > '(' > variable_reference(_r1) > ')') [px::bind(&MyContext::vector_size, _r1, _1, _val)]
2159 | (kw["interpolate_table"] > '(' > interpolate_table(_r1) > ')') [ _val = _1 ]
2160 | (strict_double > iter_pos) [ px::bind(&FactorActions::double_, _r1, _1, _2, _val) ]
2161 | (int_ > iter_pos) [ px::bind(&FactorActions::int_, _r1, _1, _2, _val) ]
2162 | (kw[bool_] > iter_pos) [ px::bind(&FactorActions::bool_, _r1, _1, _2, _val) ]
2163 | raw[lexeme['"' > *((utf8char - char_('\\') - char_('"')) | ('\\' > char_)) > '"']]
2164 [ px::bind(&FactorActions::string_, _r1, _1, _val) ]
2165 );
2166 unary_expression.name("unary_expression");
2167
2168 one_of = (unary_expression(_r1)[_a = _1] > one_of_list(_r1, _a))[_val = _2];
2169 one_of.name("one_of");
2170 one_of_list =
2171 eps[px::bind(&expr::one_of_test_init, _val)] >
2172 ( ( ',' > *(
2173 (
2174 unary_expression(_r1)[px::bind(&expr::one_of_test<false>, _r2, _1, _val)]
2175 | (lit('~') > unary_expression(_r1))[px::bind(&expr::one_of_test<true>, _r2, _1, _val)]
2176 | regular_expression[px::bind(&expr::one_of_test_regex, _r2, _1, _val)]
2177 ) >> -lit(','))
2178 )
2179 | eps
2180 );
2181 one_of_list.name("one_of_list");
2182
2183 interpolate_table = (unary_expression(_r1)[_a = _1] > ',' > interpolate_table_list(_r1, _a))
2184 [px::bind(&InterpolateTableContext::evaluate, _a, _2, _val)];
2185 interpolate_table.name("interpolate_table");
2187 eps[px::bind(&InterpolateTableContext::init, _r2)] >
2188 ( *(( lit('(') > unary_expression(_r1) > ',' > unary_expression(_r1) > ')' )
2189 [px::bind(&InterpolateTableContext::add_pair, _1, _2, _val)] >> -lit(',')) );
2190 interpolate_table.name("interpolate_table_list");
2191
2192 optional_parameter = iter_pos[px::bind(&FactorActions::set_start_pos, _1, _val)] >> (
2193 lit(')') [ px::bind(&FactorActions::noexpr, _val) ]
2194 | (lit(',') > conditional_expression(_r1) > ')') [ _val = _1 ]
2195 );
2196 optional_parameter.name("optional_parameter");
2197
2199 variable(_r1)[_a=_1] >>
2200 (
2201 ('[' > additive_expression(_r1)[px::bind(&MyContext::evaluate_index, _1, _b)] > ']' > iter_pos)
2202 [px::bind(&MyContext::store_variable_index, _r1, _a, _b, _2, _val)]
2203 | eps[_val=_a]
2204 );
2205 variable_reference.name("variable reference");
2206
2207 variable = identifier[ px::bind(&MyContext::resolve_variable, _r1, _1, _val) ];
2208 variable.name("variable name");
2209
2210 regular_expression = raw[lexeme['/' > *((utf8char - char_('\\') - char_('/')) | ('\\' > char_)) > '/']];
2211 regular_expression.name("regular_expression");
2212
2213 keywords.add
2214 ("and")
2215 ("digits")
2216 ("zdigits")
2217 ("empty")
2218 ("if")
2219 ("int")
2220 ("is_nil")
2221 ("local")
2222 //("inf")
2223 ("else")
2224 ("elsif")
2225 ("endif")
2226 ("false")
2227 ("global")
2228 ("interpolate_table")
2229 ("min")
2230 ("max")
2231 ("random")
2232 ("repeat")
2233 ("round")
2234 ("not")
2235 ("one_of")
2236 ("or")
2237 ("size")
2238 ("true");
2239
2240 if (0) {
2241 debug(start);
2242 debug(text);
2243 debug(text_block);
2244 debug(macros);
2245 debug(if_else_output);
2246 debug(interpolate_table);
2247// debug(switch_output);
2249 debug(identifier);
2250 debug(interpolate_table);
2253 debug(logical_or_expression);
2255 debug(equality_expression);
2256 debug(bool_expr_eval);
2257 debug(relational_expression);
2258 debug(additive_expression);
2260 debug(unary_expression);
2261 debug(one_of);
2262 debug(one_of_list);
2263 debug(optional_parameter);
2264 debug(variable_reference);
2265 debug(variable);
2266 debug(regular_expression);
2267 }
2268 }
TOKEN * string(char *text)
Definition config.c:233
static void noexpr(expr &out)
Definition PlaceholderParser.cpp:1908
static void round(expr &value, expr &out)
Definition PlaceholderParser.cpp:1905
static void not_(expr &value, expr &out)
Definition PlaceholderParser.cpp:1901
static void minus_(expr &value, expr &out)
Definition PlaceholderParser.cpp:1899
static void double_(const MyContext *ctx, double &value, Iterator &end_pos, expr &out)
Definition PlaceholderParser.cpp:1835
static void int_(const MyContext *ctx, int &value, Iterator &end_pos, expr &out)
Definition PlaceholderParser.cpp:1828
static void set_start_pos(Iterator &start_pos, expr &out)
Definition PlaceholderParser.cpp:1826
static void to_int(expr &value, expr &out)
Definition PlaceholderParser.cpp:1903
static void bool_(const MyContext *ctx, bool &value, Iterator &end_pos, expr &out)
Definition PlaceholderParser.cpp:1842
static void string_(const MyContext *ctx, IteratorRange &it_range, expr &out)
Definition PlaceholderParser.cpp:1849
static void expr_(expr &value, Iterator &end_pos, expr &out)
Definition PlaceholderParser.cpp:1897
static void evaluate(const expr &expr_x, const InterpolateTableContext &table, expr &out)
Definition PlaceholderParser.cpp:1640
static void init(const expr &x)
Definition PlaceholderParser.cpp:1625
static void add_pair(const expr &x, const expr &y, InterpolateTableContext &table)
Definition PlaceholderParser.cpp:1631
static void evaluate_index(expr &expr_index, int &output)
Definition PlaceholderParser.cpp:1538
static void process_error_message(const MyContext *context, const boost::spirit::info &info, const Iterator &it_begin, const Iterator &it_end, const Iterator &it_error)
Definition PlaceholderParser.cpp:1565
static bool could_be_vector_variable_reference(const NewOldVariable &var)
Definition PlaceholderParser.cpp:1442
static void block_enter(const MyContext *ctx, const bool condition)
Definition PlaceholderParser.cpp:804
static void legacy_variable_expansion(const MyContext *ctx, IteratorRange &opt_key, std::string &output)
Definition PlaceholderParser.cpp:861
static bool evaluate_full_macro(const MyContext *ctx)
Definition PlaceholderParser.cpp:801
static void random(const MyContext *ctx, expr &param1, expr &param2)
Definition PlaceholderParser.cpp:1547
static void vector_variable_assign_initializer_list(const MyContext *ctx, OptWithPos &lhs, const std::vector< expr > &il)
Definition PlaceholderParser.cpp:1339
static bool vector_variable_new_from_copy(const MyContext *ctx, bool global_variable, NewOldVariable &lhs, const OptWithPos &rhs)
Definition PlaceholderParser.cpp:1475
static void vector_variable_new_from_initializer_list(const MyContext *ctx, bool global_variable, NewOldVariable &lhs, const std::vector< expr > &il)
Definition PlaceholderParser.cpp:1386
static void vector_variable_assign_array(const MyContext *ctx, OptWithPos &lhs, const expr &rhs_count, const expr &rhs_value)
Definition PlaceholderParser.cpp:1316
static void new_old_variable(const MyContext *ctx, bool global_variable, const IteratorRange &it_range, NewOldVariable &out)
Definition PlaceholderParser.cpp:1223
static void copy_vector_variable_to_vector_variable(const MyContext *ctx, OptWithPos &lhs, const OptWithPos &rhs)
Definition PlaceholderParser.cpp:1446
static void legacy_variable_expansion2(const MyContext *ctx, IteratorRange &opt_key, IteratorRange &opt_vector_index, std::string &output)
Definition PlaceholderParser.cpp:902
static void variable_value(const MyContext *ctx, OptWithPos &opt, expr &output)
Definition PlaceholderParser.cpp:1187
static void block_exit(const MyContext *ctx, const bool condition, bool &not_yet_consumed, std::string &data_in, std::string &data_out)
Definition PlaceholderParser.cpp:810
static void vector_variable_new_from_array(const MyContext *ctx, bool global_variable, NewOldVariable &lhs, const expr &rhs_count, const expr &rhs_value)
Definition PlaceholderParser.cpp:1289
static void is_vector_empty(const MyContext *ctx, OptWithPos &opt, expr &out)
Definition PlaceholderParser.cpp:1516
static void scalar_variable_assign_scalar_expression(const MyContext *ctx, OptWithPos &opt, const expr &param)
Definition PlaceholderParser.cpp:1253
static bool is_vector_variable_reference(const OptWithPos &var)
Definition PlaceholderParser.cpp:1437
static void is_nil_test(const MyContext *ctx, OptWithPos &opt, expr &output)
Definition PlaceholderParser.cpp:1200
static void resolve_variable(const MyContext *ctx, IteratorRange &opt_key, OptWithPos &output)
Definition PlaceholderParser.cpp:942
static void initializer_list_append(std::vector< expr > &list, expr &param)
Definition PlaceholderParser.cpp:1509
static void block_exit_ternary(const MyContext *ctx, const bool condition, expr &data_in, expr &data_out)
Definition PlaceholderParser.cpp:819
static void store_variable_index(const MyContext *ctx, OptWithPos &opt, int index, Iterator it_end, OptWithPos &output)
Definition PlaceholderParser.cpp:961
static void vector_size(const MyContext *ctx, OptWithPos &opt, expr &out)
Definition PlaceholderParser.cpp:1526
static void scalar_variable_new_from_scalar_expression(const MyContext *ctx, bool global_variable, NewOldVariable &lhs, const expr &rhs)
Definition PlaceholderParser.cpp:1264
static void one_of_test_regex(const expr &match, IteratorRange &pattern, expr &out)
Definition PlaceholderParser.cpp:703
static void regex_matches(expr &lhs, IteratorRange &rhs)
Definition PlaceholderParser.cpp:674
static void greater(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:564
static void lower(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:563
static void not_equal(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:562
static void logical_and(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:731
static void logical_or(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:730
static void regex_doesnt_match(expr &lhs, IteratorRange &rhs)
Definition PlaceholderParser.cpp:675
static void evaluate_boolean(expr &self, bool &out)
Definition PlaceholderParser.cpp:501
static void to_string2(expr &self, std::string &out)
Definition PlaceholderParser.cpp:494
static void leq(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:565
static void evaluate_boolean_to_string(expr &self, std::string &out)
Definition PlaceholderParser.cpp:511
static void max(expr &param1, expr &param2)
Definition PlaceholderParser.cpp:606
static void one_of_test_init(expr &out)
Definition PlaceholderParser.cpp:677
static void equal(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:561
static void geq(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:566
static void min(expr &param1, expr &param2)
Definition PlaceholderParser.cpp:605
qi::rule< Iterator, std::string(const MyContext *), skipper > block
Definition PlaceholderParser.cpp:2280
qi::rule< Iterator, std::string(const MyContext *), qi::locals< bool, MyContext::NewOldVariable >, skipper > new_variable_statement
Definition PlaceholderParser.cpp:2323
RuleExpression multiplicative_expression
Definition PlaceholderParser.cpp:2298
RuleExpression additive_expression
Definition PlaceholderParser.cpp:2294
RuleExpression logical_or_expression
Definition PlaceholderParser.cpp:2288
qi::symbols< char > keywords
Definition PlaceholderParser.cpp:2326
qi::rule< Iterator, expr(const MyContext *), qi::locals< expr >, skipper > interpolate_table
Definition PlaceholderParser.cpp:2317
qi::rule< Iterator, expr(const MyContext *), qi::locals< bool >, skipper > conditional_expression
Definition PlaceholderParser.cpp:2286
qi::rule< Iterator, std::vector< expr >(const MyContext *), skipper > initializer_list
Definition PlaceholderParser.cpp:2324
qi::rule< Iterator, std::string(const MyContext *), qi::locals< OptWithPos >, skipper > assignment_statement
Definition PlaceholderParser.cpp:2321
qi::rule< Iterator, IteratorRange(), skipper > identifier
Definition PlaceholderParser.cpp:2284
qi::rule< Iterator, std::string(const MyContext *), skipper > else_macros
Definition PlaceholderParser.cpp:2280
RuleExpression logical_and_expression
Definition PlaceholderParser.cpp:2290
RuleExpression equality_expression
Definition PlaceholderParser.cpp:2296
qi::rule< Iterator, std::string(const MyContext *), qi::locals< bool >, skipper > if_else_output
Definition PlaceholderParser.cpp:2320
RuleExpression optional_parameter
Definition PlaceholderParser.cpp:2302
qi::rule< Iterator, std::string(const MyContext *), qi::locals< bool >, skipper > start
Definition PlaceholderParser.cpp:2274
qi::rule< Iterator, std::string(), skipper > text
Definition PlaceholderParser.cpp:2276
qi::rule< Iterator, expr(const MyContext *), qi::locals< expr >, skipper > one_of
Definition PlaceholderParser.cpp:2314
qi::rule< Iterator, IteratorRange(), skipper > regular_expression
Definition PlaceholderParser.cpp:2304
RuleExpression unary_expression
Definition PlaceholderParser.cpp:2300
qi::rule< Iterator, InterpolateTableContext(const MyContext *, const expr &param), skipper > interpolate_table_list
Definition PlaceholderParser.cpp:2318
qi::rule< Iterator, bool(const MyContext *), skipper > bool_expr_eval
Definition PlaceholderParser.cpp:2306
qi::rule< Iterator, std::string(const MyContext *), skipper > if_macros
Definition PlaceholderParser.cpp:2280
qi::rule< Iterator, std::string(const MyContext *), skipper > legacy_variable_expansion
Definition PlaceholderParser.cpp:2282
qi::rule< Iterator, std::string(const MyContext *), skipper > macros
Definition PlaceholderParser.cpp:2280
qi::rule< Iterator, std::string(const MyContext *), skipper > if_text_block
Definition PlaceholderParser.cpp:2280
qi::rule< Iterator, OptWithPos(const MyContext *), skipper > variable
Definition PlaceholderParser.cpp:2310
qi::rule< Iterator, expr(const MyContext *, const expr &param), skipper > one_of_list
Definition PlaceholderParser.cpp:2315
qi::rule< Iterator, OptWithPos(const MyContext *), qi::locals< OptWithPos, int >, skipper > variable_reference
Definition PlaceholderParser.cpp:2308
RuleExpression relational_expression
Definition PlaceholderParser.cpp:2292
qi::rule< Iterator, std::string(const MyContext *), skipper > statement
Definition PlaceholderParser.cpp:2280
qi::rule< Iterator, std::string(const MyContext *), skipper > text_block
Definition PlaceholderParser.cpp:2278

References Slic3r::client::InterpolateTableContext::add_pair(), additive_expression, assignment_statement, block, Slic3r::client::MyContext::block_enter(), Slic3r::client::MyContext::block_exit(), Slic3r::client::MyContext::block_exit_ternary(), Slic3r::client::FactorActions::bool_(), bool_expr_eval, conditional_expression, Slic3r::client::MyContext::copy_vector_variable_to_vector_variable(), Slic3r::client::MyContext::could_be_vector_variable_reference(), Slic3r::client::FactorActions::double_(), else_macros, Slic3r::client::expr::equal(), equality_expression, Slic3r::client::InterpolateTableContext::evaluate(), Slic3r::client::expr::evaluate_boolean(), Slic3r::client::expr::evaluate_boolean_to_string(), Slic3r::client::MyContext::evaluate_full_macro(), Slic3r::client::MyContext::evaluate_index(), Slic3r::client::FactorActions::expr_(), Slic3r::client::expr::geq(), Slic3r::client::expr::greater(), identifier, if_else_output, if_macros, if_text_block, Slic3r::client::InterpolateTableContext::init(), initializer_list, Slic3r::client::MyContext::initializer_list_append(), Slic3r::client::FactorActions::int_(), interpolate_table, interpolate_table_list, Slic3r::client::MyContext::is_nil_test(), Slic3r::client::MyContext::is_vector_empty(), Slic3r::client::MyContext::is_vector_variable_reference(), keywords, Slic3r::client::MyContext::legacy_variable_expansion(), legacy_variable_expansion, Slic3r::client::MyContext::legacy_variable_expansion2(), Slic3r::client::expr::leq(), Slic3r::client::expr::logical_and(), logical_and_expression, Slic3r::client::expr::logical_or(), logical_or_expression, Slic3r::client::expr::lower(), macros, Slic3r::client::expr::max(), Slic3r::client::expr::min(), Slic3r::client::FactorActions::minus_(), multiplicative_expression, Slic3r::client::MyContext::new_old_variable(), new_variable_statement, Slic3r::client::FactorActions::noexpr(), Slic3r::client::FactorActions::not_(), Slic3r::client::expr::not_equal(), one_of, one_of_list, Slic3r::client::expr::one_of_test_init(), Slic3r::client::expr::one_of_test_regex(), optional_parameter, Slic3r::client::MyContext::process_error_message(), Slic3r::client::MyContext::random(), Slic3r::client::expr::regex_doesnt_match(), Slic3r::client::expr::regex_matches(), regular_expression, relational_expression, Slic3r::client::MyContext::resolve_variable(), Slic3r::client::FactorActions::round(), Slic3r::client::MyContext::scalar_variable_assign_scalar_expression(), Slic3r::client::MyContext::scalar_variable_new_from_scalar_expression(), Slic3r::client::FactorActions::set_start_pos(), start, statement, Slic3r::client::MyContext::store_variable_index(), string(), Slic3r::client::FactorActions::string_(), text, text_block, Slic3r::client::FactorActions::to_int(), Slic3r::client::expr::to_string2(), unary_expression, variable, variable_reference, Slic3r::client::MyContext::variable_value(), Slic3r::client::MyContext::vector_size(), Slic3r::client::MyContext::vector_variable_assign_array(), Slic3r::client::MyContext::vector_variable_assign_initializer_list(), Slic3r::client::MyContext::vector_variable_new_from_array(), Slic3r::client::MyContext::vector_variable_new_from_copy(), and Slic3r::client::MyContext::vector_variable_new_from_initializer_list().

Member Data Documentation

◆ additive_expression

RuleExpression Slic3r::client::macro_processor::additive_expression

Referenced by macro_processor().

◆ assignment_statement

qi::rule<Iterator, std::string(const MyContext*), qi::locals<OptWithPos>, skipper> Slic3r::client::macro_processor::assignment_statement

Referenced by macro_processor().

◆ block

qi::rule<Iterator, std::string(const MyContext*), skipper> Slic3r::client::macro_processor::block

Referenced by macro_processor().

◆ bool_expr_eval

qi::rule<Iterator, bool(const MyContext*), skipper> Slic3r::client::macro_processor::bool_expr_eval

Referenced by macro_processor().

◆ conditional_expression

qi::rule<Iterator, expr(const MyContext*), qi::locals<bool>, skipper> Slic3r::client::macro_processor::conditional_expression

Referenced by macro_processor().

◆ else_macros

qi::rule<Iterator, std::string(const MyContext*), skipper> Slic3r::client::macro_processor::else_macros

Referenced by macro_processor().

◆ equality_expression

RuleExpression Slic3r::client::macro_processor::equality_expression

Referenced by macro_processor().

◆ identifier

qi::rule<Iterator, IteratorRange(), skipper> Slic3r::client::macro_processor::identifier

Referenced by macro_processor().

◆ if_else_output

qi::rule<Iterator, std::string(const MyContext*), qi::locals<bool>, skipper> Slic3r::client::macro_processor::if_else_output

Referenced by macro_processor().

◆ if_macros

qi::rule<Iterator, std::string(const MyContext*), skipper> Slic3r::client::macro_processor::if_macros

Referenced by macro_processor().

◆ if_text_block

qi::rule<Iterator, std::string(const MyContext*), skipper> Slic3r::client::macro_processor::if_text_block

Referenced by macro_processor().

◆ initializer_list

qi::rule<Iterator, std::vector<expr>(const MyContext*), skipper> Slic3r::client::macro_processor::initializer_list

Referenced by macro_processor().

◆ interpolate_table

qi::rule<Iterator, expr(const MyContext*), qi::locals<expr>, skipper> Slic3r::client::macro_processor::interpolate_table

Referenced by macro_processor().

◆ interpolate_table_list

qi::rule<Iterator, InterpolateTableContext(const MyContext*, const expr &param), skipper> Slic3r::client::macro_processor::interpolate_table_list

Referenced by macro_processor().

◆ is_nil_test

qi::rule<Iterator, expr(const MyContext*), skipper> Slic3r::client::macro_processor::is_nil_test

◆ keywords

qi::symbols<char> Slic3r::client::macro_processor::keywords

Referenced by macro_processor().

◆ legacy_variable_expansion

qi::rule<Iterator, std::string(const MyContext*), skipper> Slic3r::client::macro_processor::legacy_variable_expansion

Referenced by macro_processor().

◆ logical_and_expression

RuleExpression Slic3r::client::macro_processor::logical_and_expression

Referenced by macro_processor().

◆ logical_or_expression

RuleExpression Slic3r::client::macro_processor::logical_or_expression

Referenced by macro_processor().

◆ macros

qi::rule<Iterator, std::string(const MyContext*), skipper> Slic3r::client::macro_processor::macros

Referenced by macro_processor().

◆ multiplicative_expression

RuleExpression Slic3r::client::macro_processor::multiplicative_expression

Referenced by macro_processor().

◆ new_variable_statement

qi::rule<Iterator, std::string(const MyContext*), qi::locals<bool, MyContext::NewOldVariable>, skipper> Slic3r::client::macro_processor::new_variable_statement

Referenced by macro_processor().

◆ one_of

qi::rule<Iterator, expr(const MyContext*), qi::locals<expr>, skipper> Slic3r::client::macro_processor::one_of

Referenced by macro_processor().

◆ one_of_list

qi::rule<Iterator, expr(const MyContext*, const expr &param), skipper> Slic3r::client::macro_processor::one_of_list

Referenced by macro_processor().

◆ optional_parameter

RuleExpression Slic3r::client::macro_processor::optional_parameter

Referenced by macro_processor().

◆ regular_expression

qi::rule<Iterator, IteratorRange(), skipper> Slic3r::client::macro_processor::regular_expression

Referenced by macro_processor().

◆ relational_expression

RuleExpression Slic3r::client::macro_processor::relational_expression

Referenced by macro_processor().

◆ start

qi::rule<Iterator, std::string(const MyContext*), qi::locals<bool>, skipper> Slic3r::client::macro_processor::start

Referenced by macro_processor().

◆ statement

qi::rule<Iterator, std::string(const MyContext*), skipper> Slic3r::client::macro_processor::statement

Referenced by macro_processor().

◆ text

qi::rule<Iterator, std::string(), skipper> Slic3r::client::macro_processor::text

Referenced by macro_processor().

◆ text_block

qi::rule<Iterator, std::string(const MyContext*), skipper> Slic3r::client::macro_processor::text_block

Referenced by macro_processor().

◆ unary_expression

RuleExpression Slic3r::client::macro_processor::unary_expression

Referenced by macro_processor().

◆ variable

qi::rule<Iterator, OptWithPos(const MyContext*), skipper> Slic3r::client::macro_processor::variable

Referenced by macro_processor().

◆ variable_reference

qi::rule<Iterator, OptWithPos(const MyContext*), qi::locals<OptWithPos, int>, skipper> Slic3r::client::macro_processor::variable_reference

Referenced by macro_processor().


The documentation for this struct was generated from the following file: