OrcaSlicer latest
OrcaSlicer
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 *), skipper > RuleExpression

Public Member Functions

 macro_processor ()

Public Attributes

qi::rule< Iterator, std::string(const MyContext *), qi::locals< bool >, skipper > start
qi::rule< Iterator, std::string(), skipper > text
qi::rule< Iterator, std::string(const MyContext *), skipper > text_block
qi::rule< Iterator, std::string(const MyContext *), skipper > block
qi::rule< Iterator, std::string(const MyContext *), skipper > statement
qi::rule< Iterator, std::string(const MyContext *), skipper > macros
qi::rule< Iterator, std::string(const MyContext *), skipper > if_text_block
qi::rule< Iterator, std::string(const MyContext *), skipper > if_macros
qi::rule< Iterator, std::string(const MyContext *), skipper > else_macros
qi::rule< Iterator, std::string(const MyContext *), skipper > legacy_variable_expansion
qi::rule< Iterator, IteratorRange(), skipper > identifier
qi::rule< Iterator, expr(const MyContext *), qi::locals< bool >, skipper > conditional_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(), skipper > regular_expression
qi::rule< Iterator, bool(const MyContext *), skipper > bool_expr_eval
qi::rule< Iterator, OptWithPos(const MyContext *), qi::locals< OptWithPos, int >, skipper > variable_reference
qi::rule< Iterator, OptWithPos(const MyContext *), skipper > variable
qi::rule< Iterator, expr(const MyContext *), skipper > is_nil_test
qi::rule< Iterator, expr(const MyContext *), qi::locals< expr >, skipper > one_of
qi::rule< Iterator, expr(const MyContext *, const expr &param), skipper > one_of_list
qi::rule< Iterator, expr(const MyContext *), qi::locals< expr >, skipper > interpolate_table
qi::rule< Iterator, InterpolateTableContext(const MyContext *, const expr &param), skipper > interpolate_table_list
qi::rule< Iterator, std::string(const MyContext *), qi::locals< bool >, skipper > if_else_output
qi::rule< Iterator, std::string(const MyContext *), qi::locals< OptWithPos >, skipper > assignment_statement
qi::rule< Iterator, std::string(const MyContext *), qi::locals< bool, MyContext::NewOldVariable >, skipper > new_variable_statement
qi::rule< Iterator, std::vector< expr >(const MyContext *), skipper > initializer_list
qi::symbols< char > keywords

Detailed Description

Member Typedef Documentation

◆ RuleExpression

Constructor & Destructor Documentation

◆ macro_processor()

Slic3r::client::macro_processor::macro_processor ( )
inline
2249 : macro_processor::base_type(start)
2250 {
2251 qi::alpha_type alpha;
2252 qi::alnum_type alnum;
2253 qi::eps_type eps;
2254 qi::raw_type raw;
2255 qi::lit_type lit;
2256 qi::lexeme_type lexeme;
2257 qi::no_skip_type no_skip;
2258 qi::real_parser<double, strict_real_policies_without_nan_inf> strict_double;
2259 spirit_encoding::char_type char_;
2260 utf8_char_parser utf8char;
2261 spirit::bool_type bool_;
2262 spirit::int_type int_;
2263 spirit::double_type double_;
2264 spirit_encoding::string_type string;
2265 spirit::eoi_type eoi;
2266 spirit::repository::qi::iter_pos_type iter_pos;
2267 auto kw = spirit::repository::qi::distinct(qi::copy(alnum | '_'));
2268
2269 qi::_val_type _val;
2270 qi::_1_type _1;
2271 qi::_2_type _2;
2272 qi::_3_type _3;
2273 qi::_4_type _4;
2274 qi::_a_type _a;
2275 qi::_b_type _b;
2276 qi::_r1_type _r1;
2277 qi::_r2_type _r2;
2278
2279 // Starting symbol of the grammer.
2280 // The leading eps is required by the "expectation point" operator ">".
2281 // Without it, some of the errors would not trigger the error handler.
2282 // Also the start symbol switches between the "full macro syntax" and a "boolean expression only",
2283 // depending on the context->just_boolean_expression flag. This way a single static expression parser
2284 // could serve both purposes.
2285 start =
2286 ( (eps(px::bind(&MyContext::evaluate_full_macro, _r1)) > text_block(_r1) [_val=_1])
2287 | conditional_expression(_r1) [ px::bind(&expr::evaluate_boolean_to_string, _1, _val) ]
2288 ) > eoi;
2289 start.name("start");
2290 qi::on_error<qi::fail>(start, px::bind(&MyContext::process_error_message, _r1, _4, _1, _2, _3));
2291
2292 text_block = *(
2293 text [_val+=_1]
2294 // Allow back tracking after '{' in case of a text_block embedded inside a condition.
2295 // In that case the inner-most {else} wins and the {if}/{elsif}/{else} shall be paired.
2296 // {elsif}/{else} without an {if} will be allowed to back track from the embedded text_block.
2297 | (lit('{') >> (macros(_r1)[_val += _1] > '}') | '}')
2298 | (lit('[') > legacy_variable_expansion(_r1) [_val+=_1] > ']')
2299 );
2300 text_block.name("text_block");
2301
2302 // Free-form text up to a first brace, including spaces and newlines.
2303 // The free-form text will be inserted into the processed text without a modification.
2304 text = no_skip[raw[+(utf8char - char_('[') - char_('{'))]];
2305 text.name("text");
2306
2307 // New style of macro expansion.
2308 // The macro expansion may contain numeric or string expressions, ifs and cases.
2309 macros =
2310 +(block(_r1)[_val += _1] | (statement(_r1) > (+lit(';') | &lit('}')))[_val += _1] | +lit(';'));
2311 macros.name("macro");
2312 // if_macros and else_macros only differ by the look-ahead ending condition, which is to not have to repeat the last semicolon
2313 // at the end of the block.
2314 if_macros = kw["then"] > *(block(_r1)[_val += _1] | (statement(_r1) > (+lit(';') | &(kw["elsif"] | kw["else"] | kw["endif"])))[_val += _1] | +lit(';'));
2315 if_macros.name("if_macros");
2316 else_macros = *(block(_r1)[_val += _1] | (statement(_r1) > (+lit(';') | &kw["endif"]))[_val += _1] | +lit(';'));
2317 else_macros.name("else_macros");
2318
2319 // Blocks do not require a separating semicolon.
2320 block =
2321 (kw["if"] > if_else_output(_r1)[_val = _1])
2322 // (kw["switch"] ...
2323 ;
2324 block.name("block");
2325
2326 // Statements require a separating semicolon.
2327 statement =
2328 (assignment_statement(_r1) [_val = _1])
2329 | (new_variable_statement(_r1)[_val = _1])
2330 | (conditional_expression(_r1)[px::bind(&expr::to_string2, _1, _val)])
2331 ;
2332
2333 // An if expression enclosed in {} (the outmost {} are already parsed by the caller).
2334 // Also }{ could be replaced with ; to simplify writing of pure code.
2336 eps[_a=true] >
2337 (bool_expr_eval(_r1)[px::bind(&MyContext::block_enter, _r1, _1)] > (if_text_block(_r1) | if_macros(_r1)))
2338 [px::bind(&MyContext::block_exit, _r1, _1, _a, _2, _val)] >
2339 *((kw["elsif"] > bool_expr_eval(_r1)[px::bind(&MyContext::block_enter, _r1, _1 && _a)] > (if_text_block(_r1) | if_macros(_r1)))
2340 [px::bind(&MyContext::block_exit, _r1, _1, _a, _2, _val)]) >
2341 -(kw["else"] > eps[px::bind(&MyContext::block_enter, _r1, _a)] > (if_text_block(_r1) | else_macros(_r1)))
2342 [px::bind(&MyContext::block_exit, _r1, _a, _a, _1, _val)] >
2343 kw["endif"];
2344 if_else_output.name("if_else_output");
2345 if_text_block = (lit('}') > text_block(_r1) > '{');
2346 if_text_block.name("if_text_block");
2347
2348 // A switch expression enclosed in {} (the outmost {} are already parsed by the caller).
2349/*
2350 switch_output =
2351 eps[_b=true] >
2352 omit[expr(_r1)[_a=_1]] > '}' > text_block(_r1)[px::bind(&expr::set_if_equal, _a, _b, _1, _val)] > '{' >
2353 *("elsif" > omit[bool_expr_eval(_r1)[_a=_1]] > '}' > text_block(_r1)[px::bind(&expr::set_if, _a, _b, _1, _val)]) >>
2354 -("else" > '}' >> text_block(_r1)[px::bind(&expr::set_if, _b, _b, _1, _val)]) >
2355 "endif";
2356*/
2357
2358 // Legacy variable expansion of the original Slic3r, in the form of [scalar_variable] or [vector_variable_index].
2360 (identifier >> &lit(']'))
2361 [ px::bind(&MyContext::legacy_variable_expansion, _r1, _1, _val) ]
2362 | (identifier > lit('[') > identifier > ']')
2363 [ px::bind(&MyContext::legacy_variable_expansion2, _r1, _1, _2, _val) ]
2364 ;
2365 legacy_variable_expansion.name("legacy_variable_expansion");
2366
2367 identifier =
2368 ! kw[keywords] >>
2369 raw[lexeme[(alpha | '_') >> *(alnum | '_')]];
2370 identifier.name("identifier");
2371
2373 logical_or_expression(_r1) [_val = _1]
2374 >> -('?' > eps[px::bind(&expr::evaluate_boolean, _val, _a)] >
2375 eps[px::bind(&MyContext::block_enter, _r1, _a)] > conditional_expression(_r1)[px::bind(&MyContext::block_exit_ternary, _r1, _a, _1, _val)]
2376 > ':' >
2377 eps[px::bind(&MyContext::block_enter, _r1, ! _a)] > conditional_expression(_r1)[px::bind(&MyContext::block_exit_ternary, _r1, ! _a, _1, _val)]);
2378 conditional_expression.name("conditional_expression");
2379
2381 logical_and_expression(_r1) [_val = _1]
2382 >> *( ((kw["or"] | "||") > logical_and_expression(_r1) ) [px::bind(&expr::logical_or, _val, _1)] );
2383 logical_or_expression.name("logical_or_expression");
2384
2386 equality_expression(_r1) [_val = _1]
2387 >> *( ((kw["and"] | "&&") > equality_expression(_r1) ) [px::bind(&expr::logical_and, _val, _1)] );
2388 logical_and_expression.name("logical_and_expression");
2389
2391 relational_expression(_r1) [_val = _1]
2392 >> *( ("==" > relational_expression(_r1) ) [px::bind(&expr::equal, _val, _1)]
2393 | ("!=" > relational_expression(_r1) ) [px::bind(&expr::not_equal, _val, _1)]
2394 | ("<>" > relational_expression(_r1) ) [px::bind(&expr::not_equal, _val, _1)]
2395 | ("=~" > regular_expression ) [px::bind(&expr::regex_matches, _val, _1)]
2396 | ("!~" > regular_expression ) [px::bind(&expr::regex_doesnt_match, _val, _1)]
2397 );
2398 equality_expression.name("bool expression");
2399
2400 // Evaluate a boolean expression stored as expr into a boolean value.
2401 // Throw if the equality_expression does not produce a expr of boolean type.
2402 bool_expr_eval = conditional_expression(_r1) [ px::bind(&expr::evaluate_boolean, _1, _val) ];
2403 bool_expr_eval.name("bool_expr_eval");
2404
2406 additive_expression(_r1) [_val = _1]
2407 >> *( ("<=" > additive_expression(_r1) ) [px::bind(&expr::leq, _val, _1)]
2408 | (">=" > additive_expression(_r1) ) [px::bind(&expr::geq, _val, _1)]
2409 | (lit('<') > additive_expression(_r1) ) [px::bind(&expr::lower, _val, _1)]
2410 | (lit('>') > additive_expression(_r1) ) [px::bind(&expr::greater, _val, _1)]
2411 );
2412 relational_expression.name("relational_expression");
2413
2415 multiplicative_expression(_r1) [_val = _1]
2416 >> *( (lit('+') > multiplicative_expression(_r1) ) [_val += _1]
2417 | (lit('-') > multiplicative_expression(_r1) ) [_val -= _1]
2418 );
2419 additive_expression.name("additive_expression");
2420
2422 unary_expression(_r1) [_val = _1]
2423 >> *( (lit('*') > unary_expression(_r1) ) [_val *= _1]
2424 | (lit('/') > unary_expression(_r1) ) [_val /= _1]
2425 | (lit('%') > unary_expression(_r1) ) [_val %= _1]
2426 );
2427 multiplicative_expression.name("multiplicative_expression");
2428
2430 (variable_reference(_r1)[_a = _1] >> '=') >
2431 ( // Consumes also '(' conditional_expression ')', that means enclosing an expression into braces makes it a single value vector initializer.
2433 // Process it before conditional_expression, as conditional_expression requires a vector reference to be augmented with an index.
2434 // Only process such variable references, which return a naked vector variable.
2435 | eps(px::bind(&MyContext::is_vector_variable_reference, _a)) >>
2437 // Would NOT consume '(' conditional_expression ')' because such value was consumed with the expression above.
2440 | (kw["repeat"] > "(" > additive_expression(_r1) > "," > conditional_expression(_r1) > ")")
2441 [px::bind(&MyContext::vector_variable_assign_array, _r1, _a, _1, _2)]
2442 );
2443
2445 (kw["local"][_a = false] | kw["global"][_a = true]) > identifier[px::bind(&MyContext::new_old_variable, _r1, _a, _1, _b)] > lit('=') >
2446 ( // Consumes also '(' conditional_expression ')', that means enclosing an expression into braces makes it a single value vector initializer.
2448 // Process it before conditional_expression, as conditional_expression requires a vector reference to be augmented with an index.
2449 // Only process such variable references, which return a naked vector variable.
2450 | eps(px::bind(&MyContext::could_be_vector_variable_reference, _b)) >>
2451 variable_reference(_r1)[qi::_pass = px::bind(&MyContext::vector_variable_new_from_copy, _r1, _a, _b, _1)]
2452 // Would NOT consume '(' conditional_expression ')' because such value was consumed with the expression above.
2454 [px::bind(&MyContext::scalar_variable_new_from_scalar_expression, _r1, _a, _b, _1)]
2455 | (kw["repeat"] > "(" > additive_expression(_r1) > "," > conditional_expression(_r1) > ")")
2456 [px::bind(&MyContext::vector_variable_new_from_array, _r1, _a, _b, _1, _2)]
2457 );
2458 initializer_list = lit('(') >
2459 ( lit(')') |
2460 ( conditional_expression(_r1)[px::bind(&MyContext::initializer_list_append, _val, _1)] >
2461 *(lit(',') > conditional_expression(_r1)[px::bind(&MyContext::initializer_list_append, _val, _1)]) >
2462 lit(')')
2463 )
2464 );
2465
2466 unary_expression = iter_pos[px::bind(&FactorActions::set_start_pos, _1, _val)] >> (
2467 variable_reference(_r1) [px::bind(&MyContext::variable_value, _r1, _1, _val)]
2468 | (lit('(') > conditional_expression(_r1) > ')' > iter_pos) [ px::bind(&FactorActions::expr_, _1, _2, _val) ]
2469 | (lit('-') > unary_expression(_r1) ) [ px::bind(&FactorActions::minus_, _1, _val) ]
2470 | (lit('+') > unary_expression(_r1) > iter_pos) [ px::bind(&FactorActions::expr_, _1, _2, _val) ]
2471 | ((kw["not"] | '!') > unary_expression(_r1) > iter_pos) [ px::bind(&FactorActions::not_, _1, _val) ]
2472 | (kw["min"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > ')')
2473 [ px::bind(&expr::min, _val, _2) ]
2474 | (kw["max"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > ')')
2475 [ px::bind(&expr::max, _val, _2) ]
2476 | (kw["random"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > ')')
2477 [ px::bind(&MyContext::random, _r1, _val, _2) ]
2478 | (kw["filament_change"] > '(' > conditional_expression(_r1) > ')') [ px::bind(&MyContext::filament_change, _r1, _1) ]
2479 | (kw["digits"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > optional_parameter(_r1))
2480 [ px::bind(&expr::digits<false>, _val, _2, _3) ]
2481 | (kw["zdigits"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > optional_parameter(_r1))
2482 [ px::bind(&expr::digits<true>, _val, _2, _3) ]
2483 | (kw["regex_replace"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > regular_expression > ',' > conditional_expression(_r1) > ')')
2484 [ px::bind(&MyContext::regex_replace, _r1, _val, _2, _3) ]
2485 | (kw["int"] > '(' > conditional_expression(_r1) > ')') [ px::bind(&FactorActions::to_int, _1, _val) ]
2486 | (kw["round"] > '(' > conditional_expression(_r1) > ')') [ px::bind(&FactorActions::round, _1, _val) ]
2487 | (kw["ceil"] > '(' > conditional_expression(_r1) > ')') [ px::bind(&FactorActions::ceil, _1, _val) ]
2488 | (kw["floor"] > '(' > conditional_expression(_r1) > ')') [ px::bind(&FactorActions::floor, _1, _val) ]
2489 | (kw["is_nil"] > '(' > variable_reference(_r1) > ')') [px::bind(&MyContext::is_nil_test, _r1, _1, _val)]
2490 | (kw["one_of"] > '(' > one_of(_r1) > ')') [ _val = _1 ]
2491 | (kw["empty"] > '(' > variable_reference(_r1) > ')') [px::bind(&MyContext::is_vector_empty, _r1, _1, _val)]
2492 | (kw["size"] > '(' > variable_reference(_r1) > ')') [px::bind(&MyContext::vector_size, _r1, _1, _val)]
2493 | (kw["interpolate_table"] > '(' > interpolate_table(_r1) > ')') [ _val = _1 ]
2494 | (strict_double > iter_pos) [ px::bind(&FactorActions::double_, _r1, _1, _2, _val) ]
2495 | (int_ > iter_pos) [ px::bind(&FactorActions::int_, _r1, _1, _2, _val) ]
2496 | (kw[bool_] > iter_pos) [ px::bind(&FactorActions::bool_, _r1, _1, _2, _val) ]
2497 | raw[lexeme['"' > *((utf8char - char_('\\') - char_('"')) | ('\\' > char_)) > '"']]
2498 [ px::bind(&FactorActions::string_, _r1, _1, _val) ]
2499 );
2500 unary_expression.name("unary_expression");
2501
2502 one_of = (unary_expression(_r1)[_a = _1] > one_of_list(_r1, _a))[_val = _2];
2503 one_of.name("one_of");
2504 one_of_list =
2505 eps[px::bind(&expr::one_of_test_init, _val)] >
2506 ( ( ',' > *(
2507 (
2508 unary_expression(_r1)[px::bind(&expr::one_of_test<false>, _r2, _1, _val)]
2509 | (lit('~') > unary_expression(_r1))[px::bind(&expr::one_of_test<true>, _r2, _1, _val)]
2510 | regular_expression[px::bind(&expr::one_of_test_regex, _r2, _1, _val)]
2511 ) >> -lit(','))
2512 )
2513 | eps
2514 );
2515 one_of_list.name("one_of_list");
2516
2517 interpolate_table = (unary_expression(_r1)[_a = _1] > ',' > interpolate_table_list(_r1, _a))
2518 [px::bind(&InterpolateTableContext::evaluate, _a, _2, _val)];
2519 interpolate_table.name("interpolate_table");
2521 eps[px::bind(&InterpolateTableContext::init, _r2)] >
2522 ( *(( lit('(') > unary_expression(_r1) > ',' > unary_expression(_r1) > ')' )
2523 [px::bind(&InterpolateTableContext::add_pair, _1, _2, _val)] >> -lit(',')) );
2524 interpolate_table.name("interpolate_table_list");
2525
2526 optional_parameter = iter_pos[px::bind(&FactorActions::set_start_pos, _1, _val)] >> (
2527 lit(')') [ px::bind(&FactorActions::noexpr, _val) ]
2528 | (lit(',') > conditional_expression(_r1) > ')') [ _val = _1 ]
2529 );
2530 optional_parameter.name("optional_parameter");
2531
2533 variable(_r1)[_a=_1] >>
2534 (
2535 ('[' > additive_expression(_r1)[px::bind(&MyContext::evaluate_index, _1, _b)] > ']' > iter_pos)
2536 [px::bind(&MyContext::store_variable_index, _r1, _a, _b, _2, _val)]
2537 | eps[_val=_a]
2538 );
2539 variable_reference.name("variable reference");
2540
2541 variable = identifier[ px::bind(&MyContext::resolve_variable, _r1, _1, _val) ];
2542 variable.name("variable name");
2543
2544 regular_expression = raw[lexeme['/' > *((utf8char - char_('\\') - char_('/')) | ('\\' > char_)) > '/']];
2545 regular_expression.name("regular_expression");
2546
2547 keywords.add
2548 ("and")
2549 ("digits")
2550 ("zdigits")
2551 ("empty")
2552 ("if")
2553 ("int")
2554 ("is_nil")
2555 ("local")
2556 //("inf")
2557 ("else")
2558 ("elsif")
2559 ("endif")
2560 ("false")
2561 ("global")
2562 ("interpolate_table")
2563 ("min")
2564 ("max")
2565 ("random")
2566 ("regex_replace")
2567 ("filament_change")
2568 ("repeat")
2569 ("round")
2570 ("floor")
2571 ("ceil")
2572 ("not")
2573 ("one_of")
2574 ("or")
2575 ("size")
2576 ("true");
2577
2578 if (0) {
2579 debug(start);
2580 debug(text);
2581 debug(text_block);
2582 debug(macros);
2583 debug(if_else_output);
2584 debug(interpolate_table);
2585// debug(switch_output);
2587 debug(identifier);
2588 debug(interpolate_table);
2591 debug(logical_or_expression);
2593 debug(equality_expression);
2594 debug(bool_expr_eval);
2595 debug(relational_expression);
2596 debug(additive_expression);
2598 debug(unary_expression);
2599 debug(one_of);
2600 debug(one_of_list);
2601 debug(optional_parameter);
2602 debug(variable_reference);
2603 debug(variable);
2604 debug(regular_expression);
2605 }
2606 }
static void ceil(expr &value, expr &out)
Definition PlaceholderParser.cpp:2235
static void noexpr(expr &out)
Definition PlaceholderParser.cpp:2238
static void round(expr &value, expr &out)
Definition PlaceholderParser.cpp:2231
static void not_(expr &value, expr &out)
Definition PlaceholderParser.cpp:2227
static void minus_(expr &value, expr &out)
Definition PlaceholderParser.cpp:2225
static void double_(const MyContext *ctx, double &value, Iterator &end_pos, expr &out)
Definition PlaceholderParser.cpp:2161
static void int_(const MyContext *ctx, int &value, Iterator &end_pos, expr &out)
Definition PlaceholderParser.cpp:2154
static void set_start_pos(Iterator &start_pos, expr &out)
Definition PlaceholderParser.cpp:2152
static void to_int(expr &value, expr &out)
Definition PlaceholderParser.cpp:2229
static void bool_(const MyContext *ctx, bool &value, Iterator &end_pos, expr &out)
Definition PlaceholderParser.cpp:2168
static void string_(const MyContext *ctx, IteratorRange &it_range, expr &out)
Definition PlaceholderParser.cpp:2175
static void floor(expr &value, expr &out)
Definition PlaceholderParser.cpp:2233
static void expr_(expr &value, Iterator &end_pos, expr &out)
Definition PlaceholderParser.cpp:2223
static void evaluate(const expr &expr_x, const InterpolateTableContext &table, expr &out)
Definition PlaceholderParser.cpp:1965
static void init(const expr &x)
Definition PlaceholderParser.cpp:1950
static void add_pair(const expr &x, const expr &y, InterpolateTableContext &table)
Definition PlaceholderParser.cpp:1956
static void regex_replace(const MyContext *ctx, expr &subject, IteratorRange &pattern, expr &replacement)
Definition PlaceholderParser.cpp:1876
static void evaluate_index(expr &expr_index, int &output)
Definition PlaceholderParser.cpp:1845
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:1889
static bool could_be_vector_variable_reference(const NewOldVariable &var)
Definition PlaceholderParser.cpp:1749
static void block_enter(const MyContext *ctx, const bool condition)
Definition PlaceholderParser.cpp:963
static void legacy_variable_expansion(const MyContext *ctx, IteratorRange &opt_key, std::string &output)
Definition PlaceholderParser.cpp:1034
static bool evaluate_full_macro(const MyContext *ctx)
Definition PlaceholderParser.cpp:960
static void random(const MyContext *ctx, expr &param1, expr &param2)
Definition PlaceholderParser.cpp:1854
static void filament_change(const MyContext *ctx, expr &param)
Definition PlaceholderParser.cpp:1865
static void vector_variable_assign_initializer_list(const MyContext *ctx, OptWithPos &lhs, const std::vector< expr > &il)
Definition PlaceholderParser.cpp:1646
static bool vector_variable_new_from_copy(const MyContext *ctx, bool global_variable, NewOldVariable &lhs, const OptWithPos &rhs)
Definition PlaceholderParser.cpp:1782
static void vector_variable_new_from_initializer_list(const MyContext *ctx, bool global_variable, NewOldVariable &lhs, const std::vector< expr > &il)
Definition PlaceholderParser.cpp:1693
static void vector_variable_assign_array(const MyContext *ctx, OptWithPos &lhs, const expr &rhs_count, const expr &rhs_value)
Definition PlaceholderParser.cpp:1623
static void new_old_variable(const MyContext *ctx, bool global_variable, const IteratorRange &it_range, NewOldVariable &out)
Definition PlaceholderParser.cpp:1523
static void copy_vector_variable_to_vector_variable(const MyContext *ctx, OptWithPos &lhs, const OptWithPos &rhs)
Definition PlaceholderParser.cpp:1753
static void legacy_variable_expansion2(const MyContext *ctx, IteratorRange &opt_key, IteratorRange &opt_vector_index, std::string &output)
Definition PlaceholderParser.cpp:1077
static void variable_value(const MyContext *ctx, OptWithPos &opt, expr &output)
Definition PlaceholderParser.cpp:1486
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:969
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:1596
static void is_vector_empty(const MyContext *ctx, OptWithPos &opt, expr &out)
Definition PlaceholderParser.cpp:1823
static void scalar_variable_assign_scalar_expression(const MyContext *ctx, OptWithPos &opt, const expr &param)
Definition PlaceholderParser.cpp:1560
static bool is_vector_variable_reference(const OptWithPos &var)
Definition PlaceholderParser.cpp:1744
static void is_nil_test(const MyContext *ctx, OptWithPos &opt, expr &output)
Definition PlaceholderParser.cpp:1500
static void resolve_variable(const MyContext *ctx, IteratorRange &opt_key, OptWithPos &output)
Definition PlaceholderParser.cpp:1120
static void initializer_list_append(std::vector< expr > &list, expr &param)
Definition PlaceholderParser.cpp:1816
static void block_exit_ternary(const MyContext *ctx, const bool condition, expr &data_in, expr &data_out)
Definition PlaceholderParser.cpp:978
static void store_variable_index(const MyContext *ctx, OptWithPos &opt, int index, Iterator it_end, OptWithPos &output)
Definition PlaceholderParser.cpp:1146
static void vector_size(const MyContext *ctx, OptWithPos &opt, expr &out)
Definition PlaceholderParser.cpp:1833
static void scalar_variable_new_from_scalar_expression(const MyContext *ctx, bool global_variable, NewOldVariable &lhs, const expr &rhs)
Definition PlaceholderParser.cpp:1571
static void one_of_test_regex(const expr &match, IteratorRange &pattern, expr &out)
Definition PlaceholderParser.cpp:832
static void regex_matches(expr &lhs, IteratorRange &rhs)
Definition PlaceholderParser.cpp:780
static void greater(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:669
static void digits(expr &param1, expr &param2, expr &param3)
Definition PlaceholderParser.cpp:730
static void lower(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:668
static void not_equal(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:667
static void logical_and(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:862
static void one_of_test(const expr &match, const expr &pattern, expr &out)
Definition PlaceholderParser.cpp:808
static void logical_or(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:861
static void regex_doesnt_match(expr &lhs, IteratorRange &rhs)
Definition PlaceholderParser.cpp:781
static void evaluate_boolean(expr &self, bool &out)
Definition PlaceholderParser.cpp:604
static void to_string2(expr &self, std::string &out)
Definition PlaceholderParser.cpp:597
static void leq(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:670
static void evaluate_boolean_to_string(expr &self, std::string &out)
Definition PlaceholderParser.cpp:614
static void max(expr &param1, expr &param2)
Definition PlaceholderParser.cpp:711
static void one_of_test_init(expr &out)
Definition PlaceholderParser.cpp:804
static void equal(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:666
static void geq(expr &lhs, expr &rhs)
Definition PlaceholderParser.cpp:671
static void min(expr &param1, expr &param2)
Definition PlaceholderParser.cpp:710
qi::rule< Iterator, std::string(const MyContext *), skipper > block
Definition PlaceholderParser.cpp:2618
qi::rule< Iterator, std::string(const MyContext *), qi::locals< bool, MyContext::NewOldVariable >, skipper > new_variable_statement
Definition PlaceholderParser.cpp:2661
RuleExpression multiplicative_expression
Definition PlaceholderParser.cpp:2636
RuleExpression additive_expression
Definition PlaceholderParser.cpp:2632
RuleExpression logical_or_expression
Definition PlaceholderParser.cpp:2626
qi::symbols< char > keywords
Definition PlaceholderParser.cpp:2664
qi::rule< Iterator, expr(const MyContext *), qi::locals< expr >, skipper > interpolate_table
Definition PlaceholderParser.cpp:2655
qi::rule< Iterator, expr(const MyContext *), qi::locals< bool >, skipper > conditional_expression
Definition PlaceholderParser.cpp:2624
qi::rule< Iterator, std::vector< expr >(const MyContext *), skipper > initializer_list
Definition PlaceholderParser.cpp:2662
qi::rule< Iterator, std::string(const MyContext *), qi::locals< OptWithPos >, skipper > assignment_statement
Definition PlaceholderParser.cpp:2659
qi::rule< Iterator, IteratorRange(), skipper > identifier
Definition PlaceholderParser.cpp:2622
qi::rule< Iterator, std::string(const MyContext *), skipper > else_macros
Definition PlaceholderParser.cpp:2618
RuleExpression logical_and_expression
Definition PlaceholderParser.cpp:2628
RuleExpression equality_expression
Definition PlaceholderParser.cpp:2634
qi::rule< Iterator, std::string(const MyContext *), qi::locals< bool >, skipper > if_else_output
Definition PlaceholderParser.cpp:2658
RuleExpression optional_parameter
Definition PlaceholderParser.cpp:2640
qi::rule< Iterator, std::string(const MyContext *), qi::locals< bool >, skipper > start
Definition PlaceholderParser.cpp:2612
qi::rule< Iterator, std::string(), skipper > text
Definition PlaceholderParser.cpp:2614
qi::rule< Iterator, expr(const MyContext *), qi::locals< expr >, skipper > one_of
Definition PlaceholderParser.cpp:2652
qi::rule< Iterator, IteratorRange(), skipper > regular_expression
Definition PlaceholderParser.cpp:2642
RuleExpression unary_expression
Definition PlaceholderParser.cpp:2638
qi::rule< Iterator, InterpolateTableContext(const MyContext *, const expr &param), skipper > interpolate_table_list
Definition PlaceholderParser.cpp:2656
qi::rule< Iterator, bool(const MyContext *), skipper > bool_expr_eval
Definition PlaceholderParser.cpp:2644
qi::rule< Iterator, std::string(const MyContext *), skipper > if_macros
Definition PlaceholderParser.cpp:2618
qi::rule< Iterator, std::string(const MyContext *), skipper > legacy_variable_expansion
Definition PlaceholderParser.cpp:2620
qi::rule< Iterator, std::string(const MyContext *), skipper > macros
Definition PlaceholderParser.cpp:2618
qi::rule< Iterator, std::string(const MyContext *), skipper > if_text_block
Definition PlaceholderParser.cpp:2618
qi::rule< Iterator, OptWithPos(const MyContext *), skipper > variable
Definition PlaceholderParser.cpp:2648
qi::rule< Iterator, expr(const MyContext *, const expr &param), skipper > one_of_list
Definition PlaceholderParser.cpp:2653
qi::rule< Iterator, OptWithPos(const MyContext *), qi::locals< OptWithPos, int >, skipper > variable_reference
Definition PlaceholderParser.cpp:2646
RuleExpression relational_expression
Definition PlaceholderParser.cpp:2630
qi::rule< Iterator, std::string(const MyContext *), skipper > statement
Definition PlaceholderParser.cpp:2618
qi::rule< Iterator, std::string(const MyContext *), skipper > text_block
Definition PlaceholderParser.cpp:2616

References macro_processor(), 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, Slic3r::client::FactorActions::ceil(), conditional_expression, Slic3r::client::MyContext::copy_vector_variable_to_vector_variable(), Slic3r::client::MyContext::could_be_vector_variable_reference(), Slic3r::client::expr::digits(), 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::MyContext::filament_change(), Slic3r::client::FactorActions::floor(), 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, legacy_variable_expansion, Slic3r::client::MyContext::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(), 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(), Slic3r::client::MyContext::regex_replace(), 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(), 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().

Referenced by macro_processor().

Here is the caller graph for this function:

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: