Skip to content

backendGenerator

Backend C and C++ Code Generator

Synopsis

Declared in <src/docs/mrdocs/modules/backend_generator.h>

struct backendGenerator;

Description

Generates C or C++ source code from the AST.

Generates C++ source code directly from the AST (older style code that predates the newer traversal mechanisms). Parts of this code were borrowed from the original Sage II unparser. Internally, several options are available so that the generated code can either reference the user's original source code or the generated code. The generated output can use #line directives to optionally reference the original user's file, which helps debuggers map generated code back to the original source.

The primary user‐facing entry point is unparseProject, which generates source code associated with the internal AST. If the AST was transformed, those transformations appear as differences between generated code and the original input.

Additional related functions are available from the SgNode interface (SgNode::unparseToString) and the SgFile interface (unparseFile).

Created with MrDocs