|
| void | new_branch () |
| |
| void | add_condition_code (const std::string &condition_code) |
| |
| void | add_branch_code (const std::string &branch_code) |
| |
| const std::vector< std::pair< std::string, std::string > > & | get_conditional_branches () const |
| |
| void | add_code (const std::string &code, bool add_newline=true) override |
| | Add code to the primary buffer.
|
| |
| void | add_code_to_previous_line (const std::string &code) override |
| | Add code to the pre-code buffer.
|
| |
| void | add_code_to_next_line (const std::string &code) override |
| | Add code to the post-code buffer.
|
| |
| std::string | get_code () const override |
| | Return the contents of the main code buffer as a string.
|
| |
| std::string | get_pre_code () const override |
| | Return the contents of the pre-code buffer as a string.
|
| |
| std::string | get_post_code () const override |
| | Return the contents of the post-code buffer as a string.
|
| |
| 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 () |
| |
| void | destruct_local_objects (std::shared_ptr< bpp_program > program) |
| | Destruct all local objects in the code entity.
|
| |
| void | set_requires_perfect_forwarding (bool require) |
| |
| bool | get_requires_perfect_forwarding () const |
| |
| void | adopt (std::shared_ptr< bpp_entity > entity) |
| | Take ownership of all local objects in another entity, by moving them into this entity's local object map.
|
| |
| | bpp_entity ()=default |
| |
| virtual | ~bpp_entity ()=default |
| |
| | bpp_entity (const bpp_entity &other)=default |
| |
| bpp_entity & | operator= (const bpp_entity &other)=default |
| |
| | bpp_entity (bpp_entity &&other) noexcept=default |
| |
| bpp_entity & | operator= (bpp_entity &&other) noexcept=default |
| |
| virtual bool | add_class (std::shared_ptr< bpp_class > class_) |
| | Add a class to this entity's list of classes.
|
| |
| 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 std::weak_ptr< bpp_program > | get_containing_program () |
| |
| virtual bool | set_containing_class (std::weak_ptr< bpp::bpp_class > containing_class) |
| |
| void | inherit (std::shared_ptr< bpp_entity > parent) |
| | Inherit from a parent entity.
|
| |
| void | inherit (std::shared_ptr< bpp_program > program) |
| |
| 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 |
| |
| const std::unordered_map< std::string, std::shared_ptr< bpp_object > > & | get_local_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 |
| |
An if statement in Bash++.
This entity gets pushed onto the entity stack when an if statement is encountered in Bash++ code. It contains a vector of conditional branches, each of which contains a condition and a branch of code
The reason this requires its own entity type is similar to the reason for bash_while_or_until_loop: The conditions for the if statement may contain references which need to be resolved, And the pre- and post-code for those references need to be added in specific places in the compiled code.
In the case of 'if' statements, the pre- and post-code is added before and after the entire if statement. If these were parsed without their own entity type (e.g., just using a bpp_code_entity), the pre- and post-code would be added before and after each individual conditional branch, which is incorrect.
The 'bash_' prefix signifies that this is used to parse ordinary Bash code, not anything specific to Bash++