Bash++
Bash++ compiler internal documentation
|
The main program. More...
#include <bpp.h>
Public Member Functions | |
bpp_program () | |
bool | set_containing_class (std::weak_ptr< bpp_class > containing_class) override |
void | set_output_stream (std::shared_ptr< std::ostream > output_stream) |
bool | prepare_class (std::shared_ptr< bpp_class > class_) |
Prepare a class for addition to the program by adding it to the classes map. More... | |
bool | add_class (std::shared_ptr< bpp_class > class_) override |
Add a class to the program. More... | |
std::shared_ptr< bpp_class > | get_primitive_class () const |
void | increment_supershell_counter () |
uint64_t | get_supershell_counter () const |
void | increment_assignment_counter () |
uint64_t | get_assignment_counter () const |
void | increment_function_counter () |
uint64_t | get_function_counter () const |
void | increment_dynamic_cast_counter () |
uint64_t | get_dynamic_cast_counter () const |
void | increment_object_counter () |
uint64_t | get_object_counter () const |
![]() | |
bpp_code_entity () | |
virtual void | add_code (const std::string &code, bool add_newline=true) |
Add code to the code entity. More... | |
virtual void | add_code_to_previous_line (const std::string &code) |
Add code to the code entity's pre-code buffer. More... | |
virtual void | add_code_to_next_line (const std::string &code) |
Add code to the code entity's post-code buffer. More... | |
bool | add_object (std::shared_ptr< bpp_object > object, bool make_local=false) override |
Add an object to the code entity. More... | |
virtual void | flush_nextline_buffer () |
virtual void | flush_postline_buffer () |
virtual void | flush_code_buffers () |
virtual void | clear_all_buffers () |
virtual std::string | get_code () const |
Return the contents of the main code buffer as a string. More... | |
virtual std::string | get_pre_code () const |
Return the contents of the pre-code buffer as a string. More... | |
virtual std::string | get_post_code () const |
Return the contents of the post-code buffer as a string. More... | |
![]() | |
virtual | ~bpp_entity ()=default |
virtual std::shared_ptr< bpp_class > | get_class () |
virtual std::string | get_address () const |
virtual std::string | get_name () const |
virtual std::weak_ptr< bpp::bpp_class > | get_containing_class () |
Get the class which contains this entity. More... | |
virtual bool | set_containing_class (std::weak_ptr< bpp::bpp_class > containing_class) |
virtual void | inherit (std::shared_ptr< bpp_entity > parent) |
Inherit from a parent entity. More... | |
virtual void | inherit (std::shared_ptr< bpp_class > parent) |
std::unordered_map< std::string, std::shared_ptr< bpp_class > > | get_classes () const |
std::unordered_map< std::string, std::shared_ptr< bpp_object > > | get_objects () const |
std::shared_ptr< bpp_class > | get_class (const std::string &name) |
std::shared_ptr< bpp_object > | get_object (const std::string &name) |
Private Attributes | |
std::shared_ptr< bpp_class > | primitive_class |
uint64_t | supershell_counter = 0 |
uint64_t | assignment_counter = 0 |
uint64_t | function_counter = 0 |
uint64_t | dynamic_cast_counter = 0 |
uint64_t | object_counter = 0 |
Additional Inherited Members | |
![]() | |
std::shared_ptr< std::ostream > | code = std::make_shared<std::ostringstream>() |
std::string | nextline_buffer = "" |
std::string | postline_buffer = "" |
bool | buffers_flushed = false |
![]() | |
std::unordered_map< std::string, std::shared_ptr< bpp_class > > | classes |
A map of class names to class objects within this entity. More... | |
std::unordered_map< std::string, std::shared_ptr< bpp_object > > | objects |
A map of object names to bpp_objects within this entity. More... | |
std::unordered_map< std::string, std::shared_ptr< bpp_object > > | local_objects |
Like objects, but only for objects whose scope is local to this entity. More... | |
std::shared_ptr< bpp_class > | type = nullptr |
std::weak_ptr< bpp_class > | containing_class |
std::vector< std::shared_ptr< bpp_class > > | parents |
The main program.
bpp::bpp_program::bpp_program | ( | ) |
|
overridevirtual |
Add a class to the program.
This function adds a class to the program, including all necessary code for the class.
Reimplemented from bpp::bpp_entity.
uint64_t bpp::bpp_program::get_assignment_counter | ( | ) | const |
uint64_t bpp::bpp_program::get_dynamic_cast_counter | ( | ) | const |
uint64_t bpp::bpp_program::get_function_counter | ( | ) | const |
uint64_t bpp::bpp_program::get_object_counter | ( | ) | const |
std::shared_ptr< bpp::bpp_class > bpp::bpp_program::get_primitive_class | ( | ) | const |
uint64_t bpp::bpp_program::get_supershell_counter | ( | ) | const |
void bpp::bpp_program::increment_assignment_counter | ( | ) |
void bpp::bpp_program::increment_dynamic_cast_counter | ( | ) |
void bpp::bpp_program::increment_function_counter | ( | ) |
void bpp::bpp_program::increment_object_counter | ( | ) |
void bpp::bpp_program::increment_supershell_counter | ( | ) |
bool bpp::bpp_program::prepare_class | ( | std::shared_ptr< bpp_class > | class_ | ) |
Prepare a class for addition to the program by adding it to the classes map.
This means that the class will be accessible for use in the program, but it does not add any code for the class yet.
That is handled by add_class().
|
override |
void bpp::bpp_program::set_output_stream | ( | std::shared_ptr< std::ostream > | output_stream | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |