Skip to content

Unparser

Backend C and C++ code generator.

Synopsis

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

class Unparser;

Member Functions

Name

Description

Unparser [constructor] [deleted]

constructor

~Unparser [destructor] [virtual]

destructor

operator= [deleted]

Copy assignment operator

containsLanguageStatements

Used to decide which include files (most often header files) will be unparsed

get_embedColorCodesInGeneratedCode

get_generateSourcePositionCodes

get_output_stream

get the output stream wrapper

get_resetSourcePosition

includeFileIsSurroundedByExternCBraces

special case of extern "C" { #include "foo.h" }

isASecondaryFile

incomplete‐documentation

isCompilerGenerated

true if SgLocatedNode is part of a compiler generated part of the AST (e.g template instatiation)

isPartOfTransformation

true if SgLocatedNode is part of a transformation on the AST

line_count

counts the number of lines in one directive

resetSourcePosition

Reset the Sg_File_Info to reference the unparsed (generated) source code.

set_embedColorCodesInGeneratedCode

set_generateSourcePositionCodes

set_resetSourcePosition

unparseFile

friend string globalUnparseToString ( SgNode* astNode );

unparseFileUsingTokenStream

Static Member Functions

Name

Description

computeNameQualification

getColumnNumberOfEndOfString

getNumberOfLines

removeUnwantedWhiteSpace

remove unneccessary white space to build a condensed string

Data Members

Name

Description

compilerGeneratedStatementQueue

compiler generated code statements are pushed into a temporary queue so that they can be output after any statements attached to the next statements and before the next statement

cur

This is a cursor mechanism which is not encapsulated into the curprint() member function.

cur_index

used to index the preprocessor list

currentFile

delegate

delegate unparser that can be used to replace the output of this unparser

opt

holds all desired options for this unparser

prevdir_was_cppDeclaration

The previous directive was a CPP statment (otherwise it was a comment)

u_debug

u_exprStmt

u_fortran_locatedNode

u_fortran_type

u_name

u_sage

u_sym

u_type

Description

This class represents the backend C++ code generator within ROSE. It is separated from the AST IR so that it can be more easily developed as a separate modular piece of ROSE.

This is the source code generator. It traverses the AST (not using the newer traversal mechanisms) and generates C++ source code from the constructs within the AST. Special attention is given to formatting the generated code.

Note: Large parts of documentation contained in ROSE/src/unparser.docs.

Internal: This class could be simplified now that comments and CPP directives are a part of the AST.

Metadata: ‐ Authors: Lee, Quinlan, Schordan, ... ‐ Version: 0.5 cvs‐version‐#: _Name: _ ‐ Date: _Date: 2006/04/24 00:21:29 _ ‐ Bug: No known bugs. ‐ Warning: Formatting still overly complex (can be simplified now that comments are part of the AST). ‐ TODO: Finish documentation; make formatting easily tailorable to different styles (low priority at the moment).

Created with MrDocs