GCC Middle and Back End API Reference
s_expr_writer Class Reference
Inheritance diagram for s_expr_writer:

Public Member Functions

 s_expr_writer ()
 
void write_new_line ()
 
void write_any_indent (int leading_spaces)
 
void begin_s_expr (const char *tag)
 
void end_s_expr ()
 

Private Attributes

int m_indent_amount
 
int m_had_recent_newline
 

Detailed Description

A class for writing out s-expressions, keeping track of newlines and
nested indentation.   

Constructor & Destructor Documentation

◆ s_expr_writer()

s_expr_writer::s_expr_writer ( )
class s_expr_writer's trivial constructor.   

Member Function Documentation

◆ begin_s_expr()

◆ end_s_expr()

◆ write_any_indent()

void s_expr_writer::write_any_indent ( int leading_spaces)
If we've just had a newline, write the indentation amount, potentially
omitting some spaces.

LEADING_SPACES exists to support code that writes strings with leading
spaces (e.g " foo") which might occur within a line, or could be the first
thing on a line.  By passing leading_spaces == 1, when such a string is the
first thing on a line, write_any_indent () swallows the successive
leading spaces into the indentation so that the "foo" begins at the expected
column.   

References i, m_had_recent_newline, m_indent_amount, and state_file.

Referenced by begin_s_expr(), end_s_expr(), state_writer::write_state_a_string(), state_writer::write_state_array_type(), state_writer::write_state_callback_type(), state_writer::write_state_common_type_content(), state_writer::write_state_gc_used(), state_writer::write_state_lang_bitmap(), state_writer::write_state_nested_option(), state_writer::write_state_option(), state_writer::write_state_options(), state_writer::write_state_pair(), state_writer::write_state_pointer_type(), state_writer::write_state_scalar_type(), state_writer::write_state_string_option(), state_writer::write_state_string_type(), state_writer::write_state_struct_union_type(), state_writer::write_state_type(), state_writer::write_state_type_option(), state_writer::write_state_undefined_type(), and state_writer::write_state_user_struct_type().

◆ write_new_line()

void s_expr_writer::write_new_line ( void )
Write a newline to the output file, merging adjacent newlines.   

References m_had_recent_newline, and state_file.

Referenced by begin_s_expr(), end_s_expr(), and state_writer::write_state_structures().

Field Documentation

◆ m_had_recent_newline

int s_expr_writer::m_had_recent_newline
private

Referenced by write_any_indent(), and write_new_line().

◆ m_indent_amount

int s_expr_writer::m_indent_amount
private

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