Skip to content

UnparseFormat

Synopsis

Declared in <src/backend/unparser/formatSupport/unparse_format.h>

class UnparseFormat;

Member Functions

Name Description
UnparseFormat
UnparseFormat(UnparseFormat const& X) = delete; [constructor]
Constructors
~UnparseFormat
~UnparseFormat(); [destructor]
Destructor
operator=
UnparseFormat& operator=(UnparseFormat const& X) = delete; [deleted]
Copy assignment operator
begin_compact_directive
void begin_compact_directive();
current_col
int current_col() const;
current_indent
int current_indent() const;
current_line
int current_line() const;
disable_linewrap
void disable_linewrap();
emit_compact_directive
void emit_compact_directive(std::string const& text);
emit_literal
void emit_literal(std::string const& text);
emit_raw_text
void emit_raw_text(std::string const& text);
finalize_compact_output
void finalize_compact_output();
finish_compact_directive
void finish_compact_directive();
flush
void flush();
format
void format( SgLocatedNode*, SgUnparse_Info& info, FormatOpt opt = FORMAT_BEFORE_STMT);
the ultimate formatting functions
get_compact_output
bool get_compact_output() const;
get_indentstop
int get_indentstop() const;
get_linewrap
std::optional<int> get_linewrap() const;
has_compact_directive
bool has_compact_directive() const;
insert_newline
void insert_newline( int count = 1, std::optional<int> indent = std::nullopt);
line_is_empty
bool line_is_empty() const;
require_noncompact_category
void require_noncompact_category(char const* category) const;
set_compact_output
void set_compact_output(bool enabled);
set_linewrap
void set_linewrap(std::optional<int> width);
statement_indent
int statement_indent() const;
operator<<
UnparseFormat& operator<<(std::string out);
Left shift operators

Private Member Functions

Name Description
bufferNormalSpace
void bufferNormalSpace();
discardNormalPendingSpaces
void discardNormalPendingSpaces();
emitCompactCharacter
void emitCompactCharacter(char ch);
emitCompactText
void emitCompactText(std::string const& text);
flushNormalPendingSpaces
void flushNormalPendingSpaces();
formatHelp
bool formatHelp( SgLocatedNode*, SgUnparse_Info& info, FormatOpt opt = FORMAT_BEFORE_STMT);
insert_space
void insert_space(int);
removeTrailingZeros
void removeTrailingZeros(char* inputString);
make the output nicer
requireCompactOutputWritable
void requireCompactOutputWritable() const;
resolveCompactPendingSpace
void resolveCompactPendingSpace(char nextCharacter);

Private Data Members

Name Description
chars_on_line indent of the current line
compactDirectiveActive
compactDirectiveBuffer
compactFinalized
compactHasPreviousInputCharacter
compactOutput
compactPendingSpace
compactPreviousInputCharacter
currentIndent stores current line number being unparsed
currentLine
formatHelpInfo the directed output for the current file
indentstop caller-selected wrap mode restored after temporary formatter overrides
linewrap the current indent for statement
normalPendingSpaces
os The previous SgLocatedNode unparsed
prevnode the number of spaces allowed for indenting
stmtIndent the number of characters printed on the line
userDefinedLinewrap the enabled positive line width, or disabled wrapping

Created with MrDocs