GCC Middle and Back End API Reference
pp_token_list Class Reference

#include <pretty-print-format-impl.h>

Collaboration diagram for pp_token_list:

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_tokenoperator= (const pp_token_list &)=delete
 
pp_tokenoperator= (pp_token_list &&)=delete
 
template<typename Subclass , typename... Args>
std::unique_ptr< pp_tokenmake_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_tokenpop_front ()
 
std::unique_ptr< pp_tokenremove_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_listmake (obstack &s)
 
static void * operator new (size_t sz, obstack &s)
 
static void operator delete (void *)
 

Data Fields

obstackm_obstack
 
pp_tokenm_first
 
pp_tokenm_end
 

Detailed Description

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).   

Constructor & Destructor Documentation

◆ pp_token_list() [1/3]

pp_token_list::pp_token_list ( obstack & s)

◆ pp_token_list() [2/3]

pp_token_list::pp_token_list ( const pp_token_list & )
delete

◆ pp_token_list() [3/3]

pp_token_list::pp_token_list ( pp_token_list && other)

◆ ~pp_token_list()

pp_token_list::~pp_token_list ( )

References m_first, and pp_token::m_next.

Member Function Documentation

◆ apply_urlifier()

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.

◆ dump() [1/2]

void DEBUG_FUNCTION pp_token_list::dump ( ) const
inline

References dump().

Referenced by dump().

◆ dump() [2/2]

void pp_token_list::dump ( FILE * out) const

References m_first, and pp_token::m_next.

Referenced by pp_formatted_chunks::dump().

◆ insert_after()

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().

◆ make()

static pp_token_list * pp_token_list::make ( obstack & s)
inlinestatic

◆ make_token()

template<typename Subclass , typename... Args>
std::unique_ptr< pp_token > pp_token_list::make_token ( Args &&... args)
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().

◆ merge_consecutive_text_tokens()

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.

◆ operator delete()

void pp_token_list::operator delete ( void * )
static

◆ operator new()

void * pp_token_list::operator new ( size_t sz,
obstack & s )
static
class pp_token_list.   
Make room for a pp_token_list instance within obstack S.   

References allocate_object().

◆ operator=() [1/2]

pp_token & pp_token_list::operator= ( const pp_token_list & )
delete

◆ operator=() [2/2]

pp_token & pp_token_list::operator= ( pp_token_list && )
delete

◆ pop_front()

std::unique_ptr< pp_token > pp_token_list::pop_front ( )

◆ push_back() [1/2]

template<typename Subclass , typename... Args>
void pp_token_list::push_back ( Args &&... args)
inline

◆ push_back() [2/2]

void pp_token_list::push_back ( std::unique_ptr< pp_token > tok)

◆ push_back_list()

void pp_token_list::push_back_list ( pp_token_list && list)

References push_back().

◆ push_back_text()

void pp_token_list::push_back_text ( label_text && text)

◆ remove_token()

std::unique_ptr< pp_token > pp_token_list::remove_token ( pp_token * tok)

◆ replace_custom_tokens()

Field Documentation

◆ m_end

pp_token* pp_token_list::m_end

◆ m_first

◆ m_obstack

obstack& pp_token_list::m_obstack

The documentation for this class was generated from the following files: