|
KiCad PCB EDA Suite
|
Public Member Functions | |
| KIEVAL_TEXT_TOKENIZER (std::string_view input, calc_parser::ERROR_COLLECTOR *error_collector=nullptr, EDA_UNITS default_units=EDA_UNITS::MM) | |
| TEXT_EVAL_TOKEN | get_next_token (calc_parser::TOKEN_TYPE &token_value) |
| bool | has_more_tokens () const noexcept |
| constexpr size_t | get_line () const noexcept |
| constexpr size_t | get_column () const noexcept |
Private Types | |
| enum class | TOKENIZER_CONTEXT { TEXT , EXPRESSION } |
| using | CLASSIFIER = utf8_utils::CHARACTER_CLASSIFIER |
| using | SI_HANDLER = utf8_utils::SI_PREFIX_HANDLER |
Private Member Functions | |
| char32_t | current_char () const noexcept |
| char32_t | peek_char (size_t offset=1) const noexcept |
| void | advance_position (size_t count=1) noexcept |
| void | skip_whitespace () noexcept |
| void | add_error (std::string_view message) const |
| calc_parser::TOKEN_TYPE | parse_string_literal (char32_t quote_char) |
| calc_parser::TOKEN_TYPE | parse_number () |
| calc_parser::TOKEN_TYPE | parse_identifier () |
| calc_parser::TOKEN_TYPE | parse_text_content () |
Static Private Member Functions | |
| static calc_parser::TOKEN_TYPE | make_string_token (const std::string &value) noexcept |
| static constexpr calc_parser::TOKEN_TYPE | make_number_token (double value) noexcept |
Private Attributes | |
| std::u32string | m_text |
| size_t | m_pos { 0 } |
| size_t | m_line { 1 } |
| size_t | m_column { 1 } |
| TOKENIZER_CONTEXT | m_context { TOKENIZER_CONTEXT::TEXT } |
| int | m_braceNestingLevel { 0 } |
| calc_parser::ERROR_COLLECTOR * | m_errorCollector { nullptr } |
| EDA_UNITS | m_defaultUnits { EDA_UNITS::MM } |
Definition at line 480 of file text_eval_wrapper.cpp.
|
private |
Definition at line 483 of file text_eval_wrapper.cpp.
|
private |
Definition at line 484 of file text_eval_wrapper.cpp.
|
strongprivate |
| Enumerator | |
|---|---|
| TEXT | |
| EXPRESSION | |
Definition at line 1127 of file text_eval_wrapper.cpp.
|
inlineexplicit |
Definition at line 968 of file text_eval_wrapper.cpp.
References m_defaultUnits, m_errorCollector, m_text, MM, and utf8_utils::UTF8_CONVERTER::to_utf32().
|
inlineprivate |
Definition at line 521 of file text_eval_wrapper.cpp.
References m_column, m_errorCollector, m_line, and message.
Referenced by parse_number(), and parse_string_literal().
|
inlineprivatenoexcept |
Definition at line 497 of file text_eval_wrapper.cpp.
References m_column, m_line, m_pos, and m_text.
Referenced by get_next_token(), parse_identifier(), parse_number(), parse_string_literal(), parse_text_content(), and skip_whitespace().
|
inlineprivatenoexcept |
Definition at line 486 of file text_eval_wrapper.cpp.
Referenced by get_next_token(), parse_identifier(), parse_number(), parse_string_literal(), parse_text_content(), and skip_whitespace().
|
inlineconstexprnoexcept |
Definition at line 1124 of file text_eval_wrapper.cpp.
References m_column.
|
inlineconstexprnoexcept |
Definition at line 1123 of file text_eval_wrapper.cpp.
References m_line.
|
inline |
Definition at line 976 of file text_eval_wrapper.cpp.
References advance_position(), AT_OPEN, CLOSE_BRACE, COMMA, current_char(), DIVIDE, DOLLAR_OPEN, ENDS, EQ, EXPRESSION, GE, GT, IDENTIFIER, utf8_utils::CHARACTER_CLASSIFIER::is_alpha(), utf8_utils::CHARACTER_CLASSIFIER::is_digit(), LE, LPAREN, LT, m_braceNestingLevel, m_context, m_pos, m_text, make_string_token(), MINUS, MODULO, MULTIPLY, NE, next(), NUMBER, parse_identifier(), parse_number(), parse_string_literal(), parse_text_content(), peek_char(), PLUS, POWER, RPAREN, skip_whitespace(), STRING, TEXT, TEXT, calc_parser::TOKEN_TYPE::text, and utf8_utils::UTF8_CONVERTER::to_utf8().
|
inlinenoexcept |
Definition at line 1122 of file text_eval_wrapper.cpp.
|
inlinestaticconstexprprivatenoexcept |
Definition at line 540 of file text_eval_wrapper.cpp.
References calc_parser::TOKEN_TYPE::isString.
Referenced by parse_number().
|
inlinestaticprivatenoexcept |
Definition at line 530 of file text_eval_wrapper.cpp.
References calc_parser::TOKEN_TYPE::isString.
Referenced by get_next_token(), parse_identifier(), parse_string_literal(), and parse_text_content().
|
inlineprivate |
Definition at line 932 of file text_eval_wrapper.cpp.
References advance_position(), current_char(), utf8_utils::CHARACTER_CLASSIFIER::is_alnum(), m_pos, m_text, make_string_token(), and utf8_utils::UTF8_CONVERTER::to_utf8().
Referenced by get_next_token().
|
inlineprivate |
Definition at line 662 of file text_eval_wrapper.cpp.
References add_error(), advance_position(), KIEVAL_UNIT_CONV::convertToDefaultUnits(), current_char(), EXPRESSION, utf8_utils::SI_PREFIX_HANDLER::get_multiplier(), KIEVAL_UNIT_CONV::Invalid, utf8_utils::CHARACTER_CLASSIFIER::is_alpha(), utf8_utils::CHARACTER_CLASSIFIER::is_digit(), utf8_utils::SI_PREFIX_HANDLER::is_si_prefix(), utf8_utils::CHARACTER_CLASSIFIER::is_whitespace(), m_context, m_defaultUnits, m_pos, m_text, make_number_token(), next(), KIEVAL_UNIT_CONV::parseUnit(), result, and utf8_utils::UTF8_CONVERTER::to_utf8().
Referenced by get_next_token().
|
inlineprivate |
Definition at line 548 of file text_eval_wrapper.cpp.
References add_error(), advance_position(), current_char(), m_pos, m_text, make_string_token(), peek_char(), and utf8_utils::UTF8_CONVERTER::to_utf8().
Referenced by get_next_token().
|
inlineprivate |
Definition at line 946 of file text_eval_wrapper.cpp.
References advance_position(), current_char(), m_pos, m_text, make_string_token(), next(), peek_char(), text, and utf8_utils::UTF8_CONVERTER::to_utf8().
Referenced by get_next_token().
|
inlineprivatenoexcept |
Definition at line 491 of file text_eval_wrapper.cpp.
Referenced by get_next_token(), parse_string_literal(), and parse_text_content().
|
inlineprivatenoexcept |
Definition at line 515 of file text_eval_wrapper.cpp.
References advance_position(), current_char(), utf8_utils::CHARACTER_CLASSIFIER::is_whitespace(), m_pos, and m_text.
Referenced by get_next_token().
|
private |
Definition at line 1138 of file text_eval_wrapper.cpp.
Referenced by get_next_token().
|
private |
Definition at line 1136 of file text_eval_wrapper.cpp.
Referenced by add_error(), advance_position(), and get_column().
|
private |
Definition at line 1137 of file text_eval_wrapper.cpp.
Referenced by get_next_token(), and parse_number().
|
private |
Definition at line 1140 of file text_eval_wrapper.cpp.
Referenced by KIEVAL_TEXT_TOKENIZER(), and parse_number().
|
private |
Definition at line 1139 of file text_eval_wrapper.cpp.
Referenced by add_error(), and KIEVAL_TEXT_TOKENIZER().
|
private |
Definition at line 1135 of file text_eval_wrapper.cpp.
Referenced by add_error(), advance_position(), and get_line().
|
private |
Definition at line 1134 of file text_eval_wrapper.cpp.
Referenced by advance_position(), current_char(), get_next_token(), has_more_tokens(), parse_identifier(), parse_number(), parse_string_literal(), parse_text_content(), peek_char(), and skip_whitespace().
|
private |
Definition at line 1133 of file text_eval_wrapper.cpp.
Referenced by advance_position(), current_char(), get_next_token(), has_more_tokens(), KIEVAL_TEXT_TOKENIZER(), parse_identifier(), parse_number(), parse_string_literal(), parse_text_content(), peek_char(), and skip_whitespace().