Bash++
Bash++ compiler internal documentation
Public Member Functions | Public Attributes | List of all members
bpp::code_segment Struct Reference

A struct to hold (compiled) code segments. More...

#include <bpp_codegen.h>

Public Member Functions

std::string full_code () const
 Return the full code segment as a single string. More...
 

Public Attributes

std::string pre_code
 
std::string code
 
std::string post_code
 

Detailed Description

A struct to hold (compiled) code segments.

Much of the code generation in the compiler is done using code segments. A code segment consists of three parts:

Generally, the pre_code and post_code are used to set up and clean up the environment in which the main code will run.

Member Function Documentation

◆ full_code()

std::string bpp::code_segment::full_code ( ) const
inline

Return the full code segment as a single string.

This function concatenates the pre_code, code, and post_code, and adds separating newlines only if necessary.

Member Data Documentation

◆ code

std::string bpp::code_segment::code

◆ post_code

std::string bpp::code_segment::post_code

◆ pre_code

std::string bpp::code_segment::pre_code

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