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. | |
bool | add_class (std::shared_ptr< bpp_class > class_) override |
Add a class to the program. | |
std::shared_ptr< bpp_class > | get_primitive_class () const |
void | set_include_paths (std::shared_ptr< std::vector< std::string > > paths) |
std::shared_ptr< std::vector< std::string > > | get_include_paths () 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_typeof_counter () |
uint64_t | get_typeof_counter () const |
void | increment_object_counter () |
uint64_t | get_object_counter () const |
void | set_target_bash_version (uint16_t major, uint16_t minor) |
std::pair< uint16_t, uint16_t > | get_target_bash_version () const |
void | mark_entity (const std::string &file, uint32_t start_line, uint32_t start_column, uint32_t end_line, uint32_t end_column, std::shared_ptr< bpp::bpp_entity > entity) |
std::shared_ptr< bpp::bpp_entity > | get_active_entity (const std::string &file, uint32_t line, uint32_t column) |
std::vector< std::string > | get_source_files () const |
std::string | get_main_source_file () const |
void | set_main_source_file (const std::string &file) |
void | add_source_file (const std::string &file) |
void | add_diagnostic (const std::string &file, diagnostic_type type, const std::string &message, uint32_t start_line, uint32_t start_column, uint32_t end_line, uint32_t end_column) |
std::vector< bpp::diagnostic > | get_diagnostics (const std::string &file) const |
void | clear_diagnostics (const std::string &file) |
![]() | |
bpp_code_entity () | |
virtual void | add_code (const std::string &code, bool add_newline=true) |
Add code to the code entity. | |
virtual void | add_code_to_previous_line (const std::string &code) |
Add code to the code entity's pre-code buffer. | |
virtual void | add_code_to_next_line (const std::string &code) |
Add code to the code entity's post-code buffer. | |
bool | add_object (std::shared_ptr< bpp_object > object, bool make_local=false) override |
Add an object to the code entity. | |
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. | |
virtual std::string | get_pre_code () const |
Return the contents of the pre-code buffer as a string. | |
virtual std::string | get_post_code () const |
Return the contents of the post-code buffer as a string. | |
![]() | |
virtual | ~bpp_entity ()=default |
virtual std::shared_ptr< bpp_class > | get_class () |
virtual std::string | get_address () const |
virtual void | set_name (const std::string &name) |
virtual std::string | get_name () const |
virtual std::weak_ptr< bpp::bpp_class > | get_containing_class () |
Get the class which contains this entity. | |
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. | |
virtual void | inherit (std::shared_ptr< bpp_class > parent) |
void | set_definition_position (const std::string &file, uint64_t line, uint64_t column) |
void | add_reference (const std::string &file, uint64_t line, uint64_t column) |
bpp::SymbolPosition | get_initial_definition () const |
std::list< bpp::SymbolPosition > | get_references () const |
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) |
std::shared_ptr< bpp_class > | get_parent () const |
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 | typeof_counter = 0 |
uint64_t | object_counter = 0 |
std::pair< uint16_t, uint16_t > | target_bash_version = {5, 2} |
std::string | main_source_file |
std::unordered_map< std::string, EntityMap > | entity_maps |
std::unordered_map< std::string, std::vector< bpp::diagnostic > > | diagnostics |
std::shared_ptr< std::vector< std::string > > | include_paths |
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::string | name = "" |
std::unordered_map< std::string, std::shared_ptr< bpp_class > > | classes |
A map of class names to class objects within this entity. | |
std::unordered_map< std::string, std::shared_ptr< bpp_object > > | objects |
A map of object names to bpp_objects within this entity. | |
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. | |
std::shared_ptr< bpp_class > | type = nullptr |
std::weak_ptr< bpp_class > | containing_class |
std::vector< std::shared_ptr< bpp_class > > | parents |
bpp::SymbolPosition | initial_definition |
std::list< bpp::SymbolPosition > | references |
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.
void bpp::bpp_program::add_diagnostic | ( | const std::string & | file, |
diagnostic_type | type, | ||
const std::string & | message, | ||
uint32_t | start_line, | ||
uint32_t | start_column, | ||
uint32_t | end_line, | ||
uint32_t | end_column | ||
) |
void bpp::bpp_program::add_source_file | ( | const std::string & | file | ) |
void bpp::bpp_program::clear_diagnostics | ( | const std::string & | file | ) |
std::shared_ptr< bpp::bpp_entity > bpp::bpp_program::get_active_entity | ( | const std::string & | file, |
uint32_t | line, | ||
uint32_t | column | ||
) |
uint64_t bpp::bpp_program::get_assignment_counter | ( | ) | const |
std::vector< bpp::diagnostic > bpp::bpp_program::get_diagnostics | ( | const std::string & | file | ) | const |
uint64_t bpp::bpp_program::get_dynamic_cast_counter | ( | ) | const |
uint64_t bpp::bpp_program::get_function_counter | ( | ) | const |
std::shared_ptr< std::vector< std::string > > bpp::bpp_program::get_include_paths | ( | ) | const |
std::string bpp::bpp_program::get_main_source_file | ( | ) | const |
uint64_t bpp::bpp_program::get_object_counter | ( | ) | const |
std::shared_ptr< bpp::bpp_class > bpp::bpp_program::get_primitive_class | ( | ) | const |
std::vector< std::string > bpp::bpp_program::get_source_files | ( | ) | const |
uint64_t bpp::bpp_program::get_supershell_counter | ( | ) | const |
std::pair< uint16_t, uint16_t > bpp::bpp_program::get_target_bash_version | ( | ) | const |
uint64_t bpp::bpp_program::get_typeof_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 | ( | ) |
void bpp::bpp_program::increment_typeof_counter | ( | ) |
void bpp::bpp_program::mark_entity | ( | const std::string & | file, |
uint32_t | start_line, | ||
uint32_t | start_column, | ||
uint32_t | end_line, | ||
uint32_t | end_column, | ||
std::shared_ptr< bpp::bpp_entity > | entity | ||
) |
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_include_paths | ( | std::shared_ptr< std::vector< std::string > > | paths | ) |
void bpp::bpp_program::set_main_source_file | ( | const std::string & | file | ) |
void bpp::bpp_program::set_output_stream | ( | std::shared_ptr< std::ostream > | output_stream | ) |
void bpp::bpp_program::set_target_bash_version | ( | uint16_t | major, |
uint16_t | minor | ||
) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |