STD::__DETAIL::_SCANNER(3)

πŸ“¦
version 16.2.1+r23+gd564253eb6c8 Β· 6 versions
, in arch rolling, fedora 44

πŸ’– NAME πŸ’–

std::__detail::_Scanner< _CharT > β€” bestie, this one scans an input range for regex tokens. That's the whole job. It eats your pattern and spits out tokens. Periodt.

So real quick, the manual page you're reading? It's std::__det...r< _CharT >(3), from the Library Functions Manual β€” yes the title got squished in the header like that, don't @ me, and the whole thing lives in libstdc++. Ok now let's actually go. 🫢


✨ SYNOPSIS ✨

#include <regex>

🌸 Public Types

  • typedef const std::ctype< _CharT > _CtypeT β€” the ctype of our char type, const-ed up, iconic.
  • typedef regex_constants::syntax_option_type _FlagT β€” the flag type. All your grammar switches are this.
  • typedef std::basic_string< _CharT > _StringT β€” the string type. Just basic_string, keeping it cute.
  • enum _TokenT : unsigned { ... } β€” the token types returned from the scanner. Underlying type is unsigned, no cap. The full lineup, in order, exactly like this:
_S_token_anychar, _S_token_ord_char,
_S_token_oct_num, _S_token_hex_num, _S_token_backref,
_S_token_subexpr_begin, _S_token_subexpr_no_group_begin,
_S_token_subexpr_lookahead_begin, _S_token_subexpr_end,
_S_token_bracket_begin, _S_token_bracket_neg_begin,
_S_token_bracket_end, _S_token_interval_begin,
_S_token_interval_end, _S_token_quoted_class,
_S_token_char_class_name, _S_token_collsymbol,
_S_token_equiv_class_name, _S_token_opt, _S_token_or,
_S_token_closure0, _S_token_closure1, _S_token_line_begin,
_S_token_line_end, _S_token_word_bound, _S_token_comma,
_S_token_dup_count, _S_token_eof, _S_token_bracket_dash,
_S_token_unknown

πŸŽ€ Public Member Functions

  • _Scanner (const _CharT *__begin, const _CharT *__end, _FlagT __flags, std::locale __loc) β€” constructor! Hand it the begin, the end, your flags, and a locale. That's the whole vibe.
  • void _M_advance () β€” moves things along. Go, girl.
  • _TokenT _M_get_token () const noexcept β€” hands you the current token. noexcept, as it should be. πŸ‘‘
  • const _StringT & _M_get_value () const noexcept β€” hands you the current value by const ref. Also noexcept. Also slay.

πŸ¦‹ Protected Types

  • enum _StateT { _S_state_normal, _S_state_in_brace, _S_state_in_bracket } β€” the three states the scanner can be in: normal, in a brace, in a bracket. Pick your fighter.

🌈 Protected Member Functions

  • const char * _M_find_escape (char __c) β€” hunts down the escape for __c.
  • bool _M_is_awk () const β€” are we in awk mode, bestie?
  • bool _M_is_basic () const β€” basic? 🧚
  • bool _M_is_ecma () const β€” ECMA? πŸ’…
  • bool _M_is_extended () const β€” extended? ✨
  • bool _M_is_grep () const β€” grep?? πŸ‘€

πŸ’œ Protected Attributes

  • bool _M_at_bracket_start β€” are we at the start of a bracket or not, that's the question.
  • const std::pair< char, char > _M_awk_escape_tbl [11] β€” the awk escape table, size 11, const, protected, mysterious.
  • const char * _M_basic_spec_char β€” basic special chars.
  • const std::pair< char, char > _M_ecma_escape_tbl [8] β€” ECMA escape table, size 8.
  • const char * _M_ecma_spec_char β€” ECMA special chars.
  • const std::pair< char, char > * _M_escape_tbl β€” pointer to whichever escape table we're riding with.
  • const char * _M_extended_spec_char β€” extended special chars.
  • _FlagT _M_flags β€” the flags. Stored. Remembered. Respected.
  • const char * _M_spec_char β€” the special chars pointer.
  • _StateT _M_state β€” current state, one of the _StateT girlies.
  • _TokenT _M_token β€” current token.
  • const std::pair< char, _TokenT > _M_token_tbl [9] β€” the token table, size 9, mapping a char to a _TokenT.

🌟 Detailed Description 🌟

template<typename _CharT>
class std::__detail::_Scanner< _CharT >
"Scans an input range for regex tokens."

Ok so the _Scanner class takes the regular expression pattern sitting in the input range you handed to its constructor and interprets it as a sequence of parse tokens, which then get passed along to the regular expression compiler. The sequence of tokens it gives you depends on the flag settings you passed to the constructor: different regular expression grammars will interpret the same input pattern in syntactically different ways. Same input, different grammar, different tokens. It's giving shapeshifter energy, fr fr. πŸ”₯


πŸ“ Member Enumeration Documentation πŸ“

enum std::__detail::_ScannerBase::_TokenT : unsigned [inherited]

Token types returned from the scanner. (Yes bestie, inherited β€” it comes from _ScannerBase, not from this class directly. Iykyk.)


πŸ’€ Author πŸ’€

Generated automatically by Doxygen for libstdc++ from the source code. Not a human, just a robot doing its little robot best. πŸ€–πŸ’–


And that's the whole page!! This absolute icon of a manual page is libstdc++'s own, and it signs off on its footer as std::__det...r< _CharT >(3) β€” so shoutout to libstdc++ for the source, and to whatever date this page was born on (the footer keeps that part quiet, and we respect its privacy πŸŽ€). Mwah. πŸ’…βœ¨

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms