GCC Middle and Back End API Reference
|
#include <pretty-print-format-impl.h>
Public Member Functions | |
pp_token_list (obstack &s) | |
pp_token_list (const pp_token_list &)=delete | |
pp_token_list (pp_token_list &&) | |
~pp_token_list () | |
pp_token & | operator= (const pp_token_list &)=delete |
pp_token & | operator= (pp_token_list &&)=delete |
template<typename Subclass , typename... Args> | |
std::unique_ptr< pp_token > | make_token (Args &&... args) |
template<typename Subclass , typename... Args> | |
void | push_back (Args &&... args) |
void | push_back_text (label_text &&text) |
void | push_back (std::unique_ptr< pp_token > tok) |
void | push_back_list (pp_token_list &&list) |
std::unique_ptr< pp_token > | pop_front () |
std::unique_ptr< pp_token > | remove_token (pp_token *tok) |
void | insert_after (std::unique_ptr< pp_token > new_tok, pp_token *relative_tok) |
void | replace_custom_tokens () |
void | merge_consecutive_text_tokens () |
void | apply_urlifier (const urlifier &urlifier) |
void | dump (FILE *out) const |
void DEBUG_FUNCTION | dump () const |
Static Public Member Functions | |
static pp_token_list * | make (obstack &s) |
static void * | operator new (size_t sz, obstack &s) |
static void | operator delete (void *) |
Data Fields | |
obstack & | m_obstack |
pp_token * | m_first |
pp_token * | m_end |
A list of pp_token, with ownership of the tokens, using a particular obstack to allocate its tokens. These are also allocated on the obstack during formatting (or, occasionally, the stack).
pp_token_list::pp_token_list | ( | obstack & | s | ) |
|
delete |
pp_token_list::pp_token_list | ( | pp_token_list && | other | ) |
pp_token_list::~pp_token_list | ( | ) |
References m_first, and pp_token::m_next.
void pp_token_list::apply_urlifier | ( | const urlifier & | urlifier | ) |
Apply URLIFIER to this token list. Find BEGIN_QUOTE, TEXT, END_QUOTE triples, and if URLIFIER has a url for the value of TEXT, then wrap TEXT in a {BEGIN,END}_URL pair.
References as_a(), pp_token::begin_quote, pp_token::end_quote, urlifier::get_url_for_quoted_text(), insert_after(), m_first, pp_token::m_next, pp_token_text::m_value, make_token(), and pp_token::text.
|
inline |
void pp_token_list::dump | ( | FILE * | out | ) | const |
References m_first, and pp_token::m_next.
Referenced by pp_formatted_chunks::dump().
void pp_token_list::insert_after | ( | std::unique_ptr< pp_token > | new_tok_up, |
pp_token * | relative_tok ) |
Insert NEW_TOK after RELATIVE_TOK.
References gcc_assert, m_end, pp_token::m_next, and pp_token::m_prev.
Referenced by apply_urlifier(), and replace_custom_tokens().
|
inlinestatic |
Referenced by pp_formatted_chunks::append_formatted_chunk(), format_phase_1(), and format_phase_2().
|
inline |
Make a pp_token of the given subclass, using the relevant obstack to provide the memory. The pp_token must therefore not outlive the current pp_formatted_chunks level during formatting.
References m_obstack.
Referenced by apply_urlifier(), and push_back().
void pp_token_list::merge_consecutive_text_tokens | ( | ) |
Merge any runs of consecutive text tokens within this list into individual text tokens.
References allocate_object(), m_first, pp_token::m_kind, pp_token::m_next, m_obstack, pp_token_text::m_value, remove_token(), and pp_token::text.
|
static |
|
static |
class pp_token_list.
Make room for a pp_token_list instance within obstack S.
References allocate_object().
|
delete |
|
delete |
std::unique_ptr< pp_token > pp_token_list::pop_front | ( | ) |
References gcc_assert, m_end, m_first, pp_token::m_next, and pp_token::m_prev.
Referenced by replace_custom_tokens().
|
inline |
References make_token(), and push_back().
Referenced by pp_markup::context::begin_quote(), format_phase_1(), format_phase_2(), push_back(), push_back_list(), push_back_text(), and dump_pretty_printer::stash_item().
void pp_token_list::push_back | ( | std::unique_ptr< pp_token > | tok | ) |
References gcc_assert, m_end, m_first, pp_token::m_next, and pp_token::m_prev.
void pp_token_list::push_back_list | ( | pp_token_list && | list | ) |
References push_back().
void pp_token_list::push_back_text | ( | label_text && | text | ) |
References push_back().
Referenced by pp_formatted_chunks::append_formatted_chunk(), and push_back_any_text().
References gcc_assert, m_end, m_first, pp_token::m_next, and pp_token::m_prev.
Referenced by merge_consecutive_text_tokens(), and replace_custom_tokens().
void pp_token_list::replace_custom_tokens | ( | ) |
References as_a(), pp_token::custom_data, gcc_assert, insert_after(), m_first, pp_token::m_kind, pp_token::m_next, m_obstack, pop_front(), and remove_token().
pp_token* pp_token_list::m_end |
Referenced by format_phase_2(), insert_after(), pop_front(), push_back(), and remove_token().
pp_token* pp_token_list::m_first |
Referenced by apply_urlifier(), default_token_printer(), dump(), format_phase_2(), merge_consecutive_text_tokens(), pop_front(), dump_pretty_printer::custom_token_printer::print_tokens(), sarif_builder::sarif_token_printer::print_tokens(), push_back(), remove_token(), replace_custom_tokens(), and ~pp_token_list().
obstack& pp_token_list::m_obstack |
Referenced by make_token(), merge_consecutive_text_tokens(), and replace_custom_tokens().