GCC Middle and Back End API Reference
|
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 | indent_amount_ |
int | had_recent_newline_ |
A class for writing out s-expressions, keeping track of newlines and nested indentation.
s_expr_writer::s_expr_writer | ( | ) |
class s_expr_writer's trivial constructor.
void s_expr_writer::begin_s_expr | ( | const char * | tag | ) |
Write the beginning of a new s-expresion e.g. "(!foo " The writer automatically adds whitespace to show the hierarchical structure of the expressions, so each one starts on a new line, and any within it will be at an increased indentation level.
References indent_amount_, state_file, write_any_indent(), and write_new_line().
Referenced by state_writer::write_state_fields(), state_writer::write_state_fileloc(), state_writer::write_state_files_list(), state_writer::write_state_lang_struct_type(), state_writer::write_state_languages(), state_writer::write_state_option(), state_writer::write_state_options(), state_writer::write_state_pair(), state_writer::write_state_param_structs(), state_writer::write_state_srcdir(), state_writer::write_state_structures(), state_writer::write_state_type(), state_writer::write_state_typedefs(), state_writer::write_state_variables(), and state_writer::write_state_version().
void s_expr_writer::end_s_expr | ( | void | ) |
Write out the end of an s-expression: any necssessary indentation, a closing parenthesis, and a new line.
References indent_amount_, state_file, write_any_indent(), and write_new_line().
Referenced by state_writer::write_state_fields(), state_writer::write_state_fileloc(), state_writer::write_state_files_list(), state_writer::write_state_lang_struct_type(), state_writer::write_state_languages(), state_writer::write_state_option(), state_writer::write_state_options(), state_writer::write_state_pair(), state_writer::write_state_param_structs(), state_writer::write_state_srcdir(), state_writer::write_state_structures(), state_writer::write_state_type(), state_writer::write_state_typedefs(), state_writer::write_state_variables(), and state_writer::write_state_version().
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 had_recent_newline_, 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_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_param_struct_type(), 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().
void s_expr_writer::write_new_line | ( | void | ) |
Write a newline to the output file, merging adjacent newlines.
References had_recent_newline_, and state_file.
Referenced by begin_s_expr(), end_s_expr(), and state_writer::write_state_structures().
|
private |
Referenced by write_any_indent(), and write_new_line().
|
private |
Referenced by begin_s_expr(), end_s_expr(), and write_any_indent().