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) | |
TextEvalToken | get_next_token (calc_parser::TOKEN_TYPE &token_value) |
constexpr 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 | |
constexpr char32_t | current_char () const noexcept |
constexpr char32_t | peek_char (size_t offset=1) const noexcept |
constexpr 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 (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 451 of file text_eval_wrapper.cpp.
|
private |
Definition at line 469 of file text_eval_wrapper.cpp.
|
private |
Definition at line 470 of file text_eval_wrapper.cpp.
|
strongprivate |
Enumerator | |
---|---|
TEXT | |
EXPRESSION |
Definition at line 454 of file text_eval_wrapper.cpp.
|
inlineexplicit |
Definition at line 846 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 506 of file text_eval_wrapper.cpp.
References m_column, m_errorCollector, and m_line.
Referenced by parse_number(), and parse_string_literal().
|
inlineconstexprprivatenoexcept |
Definition at line 483 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().
|
inlinenodiscardconstexprprivatenoexcept |
Definition at line 472 of file text_eval_wrapper.cpp.
Referenced by get_next_token(), parse_identifier(), parse_number(), parse_string_literal(), parse_text_content(), and skip_whitespace().
|
inlinenodiscardconstexprnoexcept |
Definition at line 1001 of file text_eval_wrapper.cpp.
References m_column.
|
inlinenodiscardconstexprnoexcept |
Definition at line 1000 of file text_eval_wrapper.cpp.
References m_line.
|
inlinenodiscard |
Definition at line 854 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().
|
inlinenodiscardconstexprnoexcept |
Definition at line 999 of file text_eval_wrapper.cpp.
|
inlinestaticnodiscardconstexprprivatenoexcept |
Definition at line 525 of file text_eval_wrapper.cpp.
References calc_parser::TOKEN_TYPE::isString.
Referenced by parse_number().
|
inlinestaticnodiscardprivatenoexcept |
Definition at line 515 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().
|
inlinenodiscardprivate |
Definition at line 811 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().
|
inlinenodiscardprivate |
Definition at line 630 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(), KIEVAL_UNIT_CONV::parseUnit(), result, and utf8_utils::UTF8_CONVERTER::to_utf8().
Referenced by get_next_token().
|
inlinenodiscardprivate |
Definition at line 533 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().
|
inlinenodiscardprivate |
Definition at line 824 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().
|
inlinenodiscardconstexprprivatenoexcept |
Definition at line 477 of file text_eval_wrapper.cpp.
Referenced by get_next_token(), parse_string_literal(), and parse_text_content().
|
inlineprivatenoexcept |
Definition at line 500 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 465 of file text_eval_wrapper.cpp.
Referenced by get_next_token().
|
private |
Definition at line 463 of file text_eval_wrapper.cpp.
Referenced by add_error(), advance_position(), and get_column().
|
private |
Definition at line 464 of file text_eval_wrapper.cpp.
Referenced by get_next_token(), and parse_number().
|
private |
Definition at line 467 of file text_eval_wrapper.cpp.
Referenced by KIEVAL_TEXT_TOKENIZER(), and parse_number().
|
private |
Definition at line 466 of file text_eval_wrapper.cpp.
Referenced by add_error(), and KIEVAL_TEXT_TOKENIZER().
|
private |
Definition at line 462 of file text_eval_wrapper.cpp.
Referenced by add_error(), advance_position(), and get_line().
|
private |
Definition at line 461 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 460 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().