6 #ifndef SRC_BPP_INCLUDE_BPP_H_
7 #define SRC_BPP_INCLUDE_BPP_H_
12 #include <unordered_map>
35 class bpp_code_entity;
38 class bpp_constructor;
40 class bpp_method_parameter;
47 class bash_while_loop;
48 class bash_while_condition;
52 class bash_case_pattern;
53 class bpp_delete_statement;
54 class bpp_dynamic_cast_statement;
55 class bpp_pointer_dereference;
56 class bpp_value_assignment;
57 class bpp_object_assignment;
58 class bpp_object_reference;
59 class bpp_object_address;
98 std::unordered_map<std::string, std::shared_ptr<bpp_class>>
classes;
104 std::unordered_map<std::string, std::shared_ptr<bpp_object>>
objects;
111 std::shared_ptr<bpp_class>
type =
nullptr;
113 std::vector<std::shared_ptr<bpp_class>>
parents;
116 virtual bool add_class(std::shared_ptr<bpp_class> class_);
117 virtual bool add_object(std::shared_ptr<bpp_object>
object);
119 virtual std::shared_ptr<bpp_class>
get_class()
const;
121 virtual std::string
get_name()
const;
125 virtual void inherit(std::shared_ptr<bpp_entity> parent);
126 virtual void inherit(std::shared_ptr<bpp_class> parent);
128 virtual std::unordered_map<std::string, std::shared_ptr<bpp_class>>
get_classes()
const;
129 virtual std::unordered_map<std::string, std::shared_ptr<bpp_object>>
get_objects()
const;
130 virtual std::shared_ptr<bpp_class>
get_class(
const std::string& name);
131 virtual std::shared_ptr<bpp_object>
get_object(
const std::string& name);
153 std::shared_ptr<std::ostream>
code = std::make_shared<std::ostringstream>();
161 virtual void add_code(
const std::string&
code,
bool add_newline =
true);
165 bool add_object(std::shared_ptr<bpp_object>
object)
override;
173 virtual std::string
get_code()
const;
243 void add_code(
const std::string&
code,
bool add_newline =
true)
override;
247 std::string
get_code()
const override;
260 std::vector<std::shared_ptr<bpp_method_parameter>>
parameters;
270 virtual bool add_parameter(std::shared_ptr<bpp_method_parameter> parameter);
277 std::vector<std::shared_ptr<bpp_method_parameter>>
get_parameters()
const;
293 bool add_parameter(std::shared_ptr<bpp_method_parameter> parameter)
override;
304 bool add_parameter(std::shared_ptr<bpp_method_parameter> parameter)
override;
314 std::shared_ptr<bpp_class>
type;
319 void set_type(std::shared_ptr<bpp_class>);
322 std::shared_ptr<bpp_class>
get_type()
const;
333 std::vector<std::shared_ptr<bpp_method>>
methods;
349 std::shared_ptr<bpp_class>
get_class()
const override;
352 bool add_method(std::shared_ptr<bpp_method> method);
358 std::vector<std::shared_ptr<bpp_method>>
get_methods()
const;
365 std::shared_ptr<bpp_method>
get_method(
const std::string&
name, std::shared_ptr<bpp_entity> context);
367 std::shared_ptr<bpp_datamember>
get_datamember(
const std::string&
name, std::shared_ptr<bpp_entity> context);
369 void inherit(std::shared_ptr<bpp_class> parent)
override;
385 std::shared_ptr<bpp_class>
type;
393 void set_class(std::shared_ptr<bpp_class> object_class);
405 std::shared_ptr<bpp_class>
get_class()
const;
455 bool add_class(std::shared_ptr<bpp_class> class_)
override;
498 std::string
get_code()
const override;
577 std::string
get_code()
const override;
597 void add_case(
const std::string& case_);
695 std::shared_ptr<bpp::bpp_class>
get_cast_to()
const;
A pattern for a case statement in Bash++.
Definition: bpp.h:611
std::string pattern
Definition: bpp.h:613
void set_containing_case(std::shared_ptr< bpp::bash_case > containing_case)
Definition: bash_case_pattern.cpp:19
const std::string & get_pattern() const
Definition: bash_case_pattern.cpp:23
void set_pattern(const std::string &pattern)
Definition: bash_case_pattern.cpp:15
bash_case_pattern()
Definition: bash_case_pattern.cpp:13
std::shared_ptr< bpp::bash_case > containing_case
Definition: bpp.h:614
std::shared_ptr< bpp::bash_case > get_containing_case() const
Definition: bash_case_pattern.cpp:27
A case statement in Bash++.
Definition: bpp.h:591
std::string cases
Definition: bpp.h:593
bash_case()
Definition: bash_case.cpp:13
const std::string & get_cases() const
Definition: bash_case.cpp:19
void add_case(const std::string &case_)
Definition: bash_case.cpp:15
A for loop in Bash++.
Definition: bpp.h:634
const std::string & get_header_post_code() const
Definition: bash_for.cpp:31
bash_for()
Definition: bash_for.cpp:13
void set_header_post_code(const std::string &post_code)
Definition: bash_for.cpp:19
const std::string & get_header_pre_code() const
Definition: bash_for.cpp:27
void set_header_code(const std::string &code)
Definition: bash_for.cpp:23
std::string header_code
Definition: bpp.h:638
std::string header_pre_code
Definition: bpp.h:636
void set_header_pre_code(const std::string &pre_code)
Definition: bash_for.cpp:15
std::string header_post_code
Definition: bpp.h:637
const std::string & get_header_code() const
Definition: bash_for.cpp:35
A branch of an if statement in Bash++.
Definition: bpp.h:568
void set_if_statement(std::shared_ptr< bpp::bash_if > if_statement)
Definition: bash_if_branch.cpp:15
std::shared_ptr< bpp::bash_if > get_if_statement() const
Definition: bash_if_branch.cpp:19
bash_if_branch()
Definition: bash_if_branch.cpp:13
std::string get_pre_code() const override
Return the contents of the pre-code buffer as a string.
Definition: bash_if_branch.cpp:27
std::string get_post_code() const override
Return the contents of the post-code buffer as a string.
Definition: bash_if_branch.cpp:35
std::string get_code() const override
Return the contents of the main code buffer as a string.
Definition: bash_if_branch.cpp:23
std::shared_ptr< bpp::bash_if > if_statement
Definition: bpp.h:570
An if statement in Bash++.
Definition: bpp.h:540
std::vector< std::pair< std::string, std::string > > conditional_branches
Definition: bpp.h:544
void add_conditional_branch_post_code(const std::string &post_code)
Definition: bash_if.cpp:19
void new_branch()
Definition: bash_if.cpp:23
std::string conditional_branch_pre_code
Definition: bpp.h:542
void add_branch_code(const std::string &branch_code)
Definition: bash_if.cpp:31
void add_condition_code(const std::string &condition_code)
Definition: bash_if.cpp:27
std::string get_conditional_branch_post_code() const
Definition: bash_if.cpp:39
bash_if()
Definition: bash_if.cpp:13
const std::vector< std::pair< std::string, std::string > > & get_conditional_branches() const
Definition: bash_if.cpp:43
std::string conditional_branch_post_code
Definition: bpp.h:543
void add_conditional_branch_pre_code(const std::string &pre_code)
Definition: bash_if.cpp:15
std::string get_conditional_branch_pre_code() const
Definition: bash_if.cpp:35
The condition for a while loop in Bash++.
Definition: bpp.h:510
bash_while_condition()
Definition: bash_while_condition.cpp:13
std::vector< std::string > supershell_function_calls
Definition: bpp.h:513
int supershell_count
Definition: bpp.h:512
void increment_supershell_count()
Definition: bash_while_condition.cpp:15
std::vector< std::string > get_supershell_function_calls() const
Definition: bash_while_condition.cpp:23
void add_supershell_function_call(const std::string &function_call)
Definition: bash_while_condition.cpp:19
A while loop in Bash++.
Definition: bpp.h:489
std::string get_post_code() const override
Return the contents of the post-code buffer as a string.
Definition: bash_while_loop.cpp:35
void set_while_condition(std::shared_ptr< bpp::bash_while_condition > while_condition)
Definition: bash_while_loop.cpp:15
std::shared_ptr< bpp::bash_while_condition > while_condition
Definition: bpp.h:491
std::string get_code() const override
Return the contents of the main code buffer as a string.
Definition: bash_while_loop.cpp:23
bash_while_loop()
Definition: bash_while_loop.cpp:13
std::string get_pre_code() const override
Return the contents of the pre-code buffer as a string.
Definition: bash_while_loop.cpp:27
std::shared_ptr< bpp::bash_while_condition > get_while_condition() const
Definition: bash_while_loop.cpp:19
A class in Bash++.
Definition: bpp.h:330
void set_name(const std::string &name)
Definition: bpp_class.cpp:64
bool set_constructor(std::shared_ptr< bpp_constructor > constructor)
Definition: bpp_class.cpp:132
bool set_containing_class(std::weak_ptr< bpp::bpp_class > containing_class) override
Definition: bpp_class.cpp:60
std::string get_name() const
Definition: bpp_class.cpp:150
std::shared_ptr< bpp_destructor > get_destructor() const
Definition: bpp_class.cpp:166
bool destructor_set
Definition: bpp.h:338
bpp_class()
Definition: bpp_class.cpp:13
bool set_destructor(std::shared_ptr< bpp_destructor > destructor)
Definition: bpp_class.cpp:141
std::string name
Definition: bpp.h:332
void inherit(std::shared_ptr< bpp_class > parent) override
Inherit from a parent class.
Definition: bpp_class.cpp:276
bool add_method(std::shared_ptr< bpp_method > method)
Add a method to the class.
Definition: bpp_class.cpp:73
std::weak_ptr< bpp_class > get_containing_class() const override
Get the class which contains this entity.
Definition: bpp_class.cpp:52
std::shared_ptr< bpp_destructor > destructor
Definition: bpp.h:336
std::vector< std::shared_ptr< bpp_datamember > > get_datamembers() const
Definition: bpp_class.cpp:158
void add_default_toPrimitive()
Add the default toPrimitive method.
Definition: bpp_class.cpp:39
bool has_destructor() const
Definition: bpp_class.cpp:174
std::vector< std::shared_ptr< bpp_datamember > > datamembers
Definition: bpp.h:334
std::shared_ptr< bpp_class > get_class() const override
Definition: bpp_class.cpp:56
std::shared_ptr< bpp_datamember > get_datamember(const std::string &name, std::shared_ptr< bpp_entity > context)
Get a datamember by name.
Definition: bpp_class.cpp:246
std::shared_ptr< bpp_constructor > get_constructor() const
Definition: bpp_class.cpp:162
bool has_custom_toPrimitive
Definition: bpp.h:339
bool has_constructor() const
Definition: bpp_class.cpp:170
void remove_default_toPrimitive()
Remove the default toPrimitive method.
Definition: bpp_class.cpp:21
std::shared_ptr< bpp::bpp_class > get_parent()
Definition: bpp_class.cpp:332
std::shared_ptr< bpp_method > get_method(const std::string &name, std::shared_ptr< bpp_entity > context)
Get a method by name.
Definition: bpp_class.cpp:191
std::shared_ptr< bpp_constructor > constructor
Definition: bpp.h:335
std::shared_ptr< bpp_method > get_method_UNSAFE(const std::string &name)
Get a method by name without checking the context.
Definition: bpp_class.cpp:224
bool constructor_set
Definition: bpp.h:337
std::vector< std::shared_ptr< bpp_method > > get_methods() const
Definition: bpp_class.cpp:154
bool add_datamember(std::shared_ptr< bpp_datamember > datamember)
Add a datamember to the class.
Definition: bpp_class.cpp:113
std::vector< std::shared_ptr< bpp_method > > methods
Definition: bpp.h:333
An entity which can contain code.
Definition: bpp.h:151
virtual void add_code_to_next_line(const std::string &code)
Add code to the code entity's post-code buffer.
Definition: bpp_code_entity.cpp:60
bpp_code_entity()
Definition: bpp_code_entity.cpp:13
std::shared_ptr< std::ostream > code
Definition: bpp.h:153
std::string postline_buffer
Definition: bpp.h:155
virtual void flush_code_buffers()
Definition: bpp_code_entity.cpp:85
virtual void add_code_to_previous_line(const std::string &code)
Add code to the code entity's pre-code buffer.
Definition: bpp_code_entity.cpp:52
virtual void flush_postline_buffer()
Definition: bpp_code_entity.cpp:75
virtual std::string get_post_code() const
Return the contents of the post-code buffer as a string.
Definition: bpp_code_entity.cpp:168
bool add_object(std::shared_ptr< bpp_object > object) override
Add an object to the code entity.
Definition: bpp_code_entity.cpp:111
virtual std::string get_pre_code() const
Return the contents of the pre-code buffer as a string.
Definition: bpp_code_entity.cpp:161
virtual void flush_nextline_buffer()
Definition: bpp_code_entity.cpp:65
virtual ~bpp_code_entity()=default
virtual void clear_all_buffers()
Definition: bpp_code_entity.cpp:91
virtual void add_code(const std::string &code, bool add_newline=true)
Add code to the code entity.
Definition: bpp_code_entity.cpp:25
virtual std::string get_code() const
Return the contents of the main code buffer as a string.
Definition: bpp_code_entity.cpp:150
std::string nextline_buffer
Definition: bpp.h:154
bool buffers_flushed
Definition: bpp.h:156
A constructor in a class.
Definition: bpp.h:289
bpp_constructor()
Definition: bpp_constructor.cpp:13
bool add_parameter(std::shared_ptr< bpp_method_parameter > parameter) override
Add a parameter to the method.
Definition: bpp_constructor.cpp:15
A data member in a class.
Definition: bpp.h:418
bool is_array() const
Definition: bpp_datamember.cpp:39
bool array
Definition: bpp.h:422
void set_scope(bpp_scope scope)
Definition: bpp_datamember.cpp:19
std::string get_default_value() const
Definition: bpp_datamember.cpp:31
void set_default_value(const std::string &default_value)
Definition: bpp_datamember.cpp:15
std::string get_address() const override
Definition: bpp_datamember.cpp:27
bpp_scope scope
Definition: bpp.h:421
std::string default_value
Definition: bpp.h:420
bpp_scope get_scope() const
Definition: bpp_datamember.cpp:35
bpp_datamember()
Definition: bpp_datamember.cpp:13
void set_array(bool is_array)
Definition: bpp_datamember.cpp:23
A delete statement in Bash++.
Definition: bpp.h:662
std::shared_ptr< bpp::bpp_object > get_object_to_delete() const
Definition: bpp_delete_statement.cpp:21
void set_force_pointer(bool force_pointer)
Definition: bpp_delete_statement.cpp:17
void set_object_to_delete(std::shared_ptr< bpp::bpp_object > object)
Definition: bpp_delete_statement.cpp:13
bool force_pointer() const
Definition: bpp_delete_statement.cpp:25
bool force_ptr
Definition: bpp.h:665
std::shared_ptr< bpp::bpp_object > object_to_delete
Definition: bpp.h:664
bpp_delete_statement()=default
A destructor in a class.
Definition: bpp.h:300
bool add_parameter(std::shared_ptr< bpp_method_parameter > parameter) override
Add a parameter to the method.
Definition: bpp_destructor.cpp:15
bpp_destructor()
Definition: bpp_destructor.cpp:13
A dynamic_cast statement in Bash++.
Definition: bpp.h:686
std::string cast_address
Definition: bpp.h:689
std::shared_ptr< bpp::bpp_class > get_cast_to() const
Definition: bpp_dynamic_cast_statement.cpp:23
void set_cast_address(const std::string &cast_address)
Definition: bpp_dynamic_cast_statement.cpp:19
bpp_dynamic_cast_statement()
Definition: bpp_dynamic_cast_statement.cpp:13
std::shared_ptr< bpp::bpp_class > cast_to
Definition: bpp.h:688
void set_cast_to(std::shared_ptr< bpp::bpp_class > cast_to)
Definition: bpp_dynamic_cast_statement.cpp:15
std::string get_cast_address() const
Definition: bpp_dynamic_cast_statement.cpp:27
The base class for all entities in the Bash++ compiler.
Definition: bpp.h:92
virtual std::unordered_map< std::string, std::shared_ptr< bpp_object > > get_objects() const
Definition: bpp_entity.cpp:103
virtual std::shared_ptr< bpp_class > get_class() const
Definition: bpp_entity.cpp:48
std::unordered_map< std::string, std::shared_ptr< bpp_class > > classes
A map of class names to class objects within this entity.
Definition: bpp.h:98
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.
Definition: bpp.h:110
virtual bool add_object(std::shared_ptr< bpp_object > object)
Add an object to this entity's list of objects.
Definition: bpp_entity.cpp:32
virtual ~bpp_entity()=default
virtual std::unordered_map< std::string, std::shared_ptr< bpp_class > > get_classes() const
Definition: bpp_entity.cpp:99
std::vector< std::shared_ptr< bpp_class > > parents
Definition: bpp.h:113
virtual std::shared_ptr< bpp_object > get_object(const std::string &name)
Definition: bpp_entity.cpp:118
std::shared_ptr< bpp_class > type
Definition: bpp.h:111
virtual std::string get_address() const
Definition: bpp_entity.cpp:52
virtual std::weak_ptr< bpp::bpp_class > get_containing_class() const
Get the class which contains this entity.
Definition: bpp_entity.cpp:65
std::unordered_map< std::string, std::shared_ptr< bpp_object > > objects
A map of object names to bpp_objects within this entity.
Definition: bpp.h:104
std::weak_ptr< bpp_class > containing_class
Definition: bpp.h:112
virtual bool set_containing_class(std::weak_ptr< bpp::bpp_class > containing_class)
Definition: bpp_entity.cpp:69
virtual std::string get_name() const
Definition: bpp_entity.cpp:56
virtual void inherit(std::shared_ptr< bpp_entity > parent)
Inherit from a parent entity.
Definition: bpp_entity.cpp:81
virtual bool add_class(std::shared_ptr< bpp_class > class_)
Add a class to this entity's list of classes.
Definition: bpp_entity.cpp:18
A parameter in a method.
Definition: bpp.h:312
std::shared_ptr< bpp_class > get_type() const
Definition: bpp_method_parameter.cpp:23
bpp_method_parameter(const std::string &name)
Definition: bpp_method_parameter.cpp:13
std::shared_ptr< bpp_class > type
Definition: bpp.h:314
void set_type(std::shared_ptr< bpp_class >)
Definition: bpp_method_parameter.cpp:15
std::string name
Definition: bpp.h:315
std::string get_name() const
Definition: bpp_method_parameter.cpp:19
A method in a class.
Definition: bpp.h:257
bool inherited
Definition: bpp.h:263
bool add_object_as_parameter(std::shared_ptr< bpp_object > object)
Add a non-primitive object as a parameter to the method.
Definition: bpp_method.cpp:23
virtual bool add_parameter(std::shared_ptr< bpp_method_parameter > parameter)
Add a parameter to the method.
Definition: bpp_method.cpp:45
bool is_virtual() const
Definition: bpp_method.cpp:96
std::string name
Definition: bpp.h:259
void set_scope(bpp_scope scope)
Definition: bpp_method.cpp:72
bpp_scope scope
Definition: bpp.h:261
std::vector< std::shared_ptr< bpp_method_parameter > > get_parameters() const
Definition: bpp_method.cpp:88
bpp_method()
Definition: bpp_method.cpp:13
void set_virtual(bool is_virtual)
Definition: bpp_method.cpp:76
bpp_scope get_scope() const
Definition: bpp_method.cpp:92
std::string get_name() const
Definition: bpp_method.cpp:84
void set_inherited(bool is_inherited)
Definition: bpp_method.cpp:80
void set_name(const std::string &name)
Definition: bpp_method.cpp:68
std::vector< std::shared_ptr< bpp_method_parameter > > parameters
Definition: bpp.h:260
bool is_inherited() const
Definition: bpp_method.cpp:100
bool m_is_virtual
Definition: bpp.h:262
void destruct_local_objects()
Destruct all local objects.
Definition: bpp_method.cpp:111
A statement which takes the address of an object in Bash++.
Definition: bpp.h:812
bpp_object_address()=default
An object assignment statement in Bash++.
Definition: bpp.h:753
void set_rvalue_array(bool is_array)
Definition: bpp_object_assignment.cpp:43
bool rvalue_array
Definition: bpp.h:762
bool rvalue_is_array() const
Definition: bpp_object_assignment.cpp:75
void set_adding(bool is_adding)
Definition: bpp_object_assignment.cpp:39
bool adding
Definition: bpp.h:761
std::shared_ptr< bpp_entity > lvalue_object
Definition: bpp.h:759
void set_rvalue_nonprimitive(bool is_nonprimitive)
Definition: bpp_object_assignment.cpp:27
bool rvalue_nonprimitive
Definition: bpp.h:758
bpp_object_assignment()
Definition: bpp_object_assignment.cpp:13
std::shared_ptr< bpp_entity > get_lvalue_object() const
Definition: bpp_object_assignment.cpp:63
void set_lvalue(const std::string &lvalue)
Definition: bpp_object_assignment.cpp:15
bool rvalue_is_nonprimitive() const
Definition: bpp_object_assignment.cpp:59
void set_lvalue_object(std::shared_ptr< bpp_entity > object)
Definition: bpp_object_assignment.cpp:31
std::string get_rvalue() const
Definition: bpp_object_assignment.cpp:51
std::string get_lvalue() const
Definition: bpp_object_assignment.cpp:47
void set_lvalue_nonprimitive(bool is_nonprimitive)
Definition: bpp_object_assignment.cpp:23
void set_rvalue(const std::string &rvalue)
Definition: bpp_object_assignment.cpp:19
std::shared_ptr< bpp_entity > rvalue_object
Definition: bpp.h:760
std::string lvalue
Definition: bpp.h:755
bool lvalue_is_nonprimitive() const
Definition: bpp_object_assignment.cpp:55
std::string rvalue
Definition: bpp.h:756
bool lvalue_nonprimitive
Definition: bpp.h:757
bool is_adding() const
Definition: bpp_object_assignment.cpp:71
std::shared_ptr< bpp_entity > get_rvalue_object() const
Definition: bpp_object_assignment.cpp:67
void set_rvalue_object(std::shared_ptr< bpp_entity > object)
Definition: bpp_object_assignment.cpp:35
An object reference in Bash++.
Definition: bpp.h:792
void set_array_index(const std::string &array_index)
Definition: bpp_object_reference.cpp:19
bpp::reference_type get_reference_type() const
Definition: bpp_object_reference.cpp:23
bpp::reference_type reference_type
Definition: bpp.h:794
bpp_object_reference()
Definition: bpp_object_reference.cpp:13
std::string array_index
Definition: bpp.h:795
std::string get_array_index() const
Definition: bpp_object_reference.cpp:27
void set_reference_type(bpp::reference_type reference_type)
Definition: bpp_object_reference.cpp:15
An object in Bash++.
Definition: bpp.h:378
std::string get_pre_access_code() const
Definition: bpp_object.cpp:69
bool is_pointer() const
Definition: bpp_object.cpp:77
void set_pre_access_code(const std::string &pre_access_code)
Definition: bpp_object.cpp:39
void set_pointer(bool is_pointer)
Definition: bpp_object.cpp:23
void set_address(const std::string &address)
Definition: bpp_object.cpp:31
virtual std::string get_address() const
Definition: bpp_object.cpp:57
std::string address
Definition: bpp.h:381
void set_post_access_code(const std::string &post_access_code)
Definition: bpp_object.cpp:43
std::string get_post_access_code() const
Definition: bpp_object.cpp:73
std::string get_assignment_value() const
Definition: bpp_object.cpp:61
std::shared_ptr< bpp_class > get_class() const
Definition: bpp_object.cpp:65
void set_assignment_value(const std::string &assignment_value)
Definition: bpp_object.cpp:35
std::string pre_access_code
Definition: bpp.h:383
void set_nullptr()
Definition: bpp_object.cpp:47
std::shared_ptr< bpp_class > type
Definition: bpp.h:385
std::string post_access_code
Definition: bpp.h:384
bpp_object()
Definition: bpp_object.cpp:13
bool m_is_pointer
Definition: bpp.h:386
std::string assignment_value
Definition: bpp.h:382
std::shared_ptr< bpp::bpp_object > get_copy_from() const
Definition: bpp_object.cpp:81
void set_name(const std::string &name)
Definition: bpp_object.cpp:27
std::string name
Definition: bpp.h:380
void set_class(std::shared_ptr< bpp_class > object_class)
Definition: bpp_object.cpp:19
std::shared_ptr< bpp::bpp_object > copy_from
Definition: bpp.h:387
std::string get_name() const
Definition: bpp_object.cpp:53
A pointer dereference in Bash++.
Definition: bpp.h:706
bpp_pointer_dereference()
Definition: bpp_pointer_dereference.cpp:13
std::shared_ptr< bpp::bpp_value_assignment > value_assignment
Definition: bpp.h:708
std::shared_ptr< bpp::bpp_value_assignment > get_value_assignment() const
Definition: bpp_pointer_dereference.cpp:19
void set_value_assignment(std::shared_ptr< bpp::bpp_value_assignment > value_assignment)
Definition: bpp_pointer_dereference.cpp:15
The main program.
Definition: bpp.h:441
uint64_t get_dynamic_cast_counter() const
Definition: bpp_program.cpp:225
uint64_t assignment_counter
Definition: bpp.h:445
std::shared_ptr< bpp_class > primitive_class
Definition: bpp.h:443
uint64_t dynamic_cast_counter
Definition: bpp.h:447
bool set_containing_class(std::weak_ptr< bpp_class > containing_class) override
Definition: bpp_program.cpp:26
uint64_t get_supershell_counter() const
Definition: bpp_program.cpp:189
void increment_function_counter()
Definition: bpp_program.cpp:201
uint64_t get_assignment_counter() const
Definition: bpp_program.cpp:197
uint64_t object_counter
Definition: bpp.h:448
std::shared_ptr< bpp_class > get_primitive_class() const
Definition: bpp_program.cpp:34
uint64_t supershell_counter
Definition: bpp.h:444
uint64_t get_function_counter() const
Definition: bpp_program.cpp:211
uint64_t function_counter
Definition: bpp.h:446
bool add_class(std::shared_ptr< bpp_class > class_) override
Add a class to the program.
Definition: bpp_program.cpp:43
uint64_t get_object_counter() const
Definition: bpp_program.cpp:233
void increment_dynamic_cast_counter()
Definition: bpp_program.cpp:215
bpp_program()
Definition: bpp_program.cpp:14
void increment_supershell_counter()
Definition: bpp_program.cpp:180
void increment_assignment_counter()
Definition: bpp_program.cpp:193
void set_output_stream(std::shared_ptr< std::ostream > output_stream)
Definition: bpp_program.cpp:30
void increment_object_counter()
Definition: bpp_program.cpp:229
The practical difference between bpp_code_entity and bpp_string is how we handle the code buffers.
Definition: bpp.h:239
std::string get_pre_code() const override
Return the contents of the pre-code buffer as a string.
Definition: bpp_string.cpp:43
void add_code(const std::string &code, bool add_newline=true) override
Add code to the primary buffer.
Definition: bpp_string.cpp:21
void add_code_to_previous_line(const std::string &code) override
Add code to the pre-code buffer.
Definition: bpp_string.cpp:28
void add_code_to_next_line(const std::string &code) override
Add code to the post-code buffer.
Definition: bpp_string.cpp:35
bpp_string()
Definition: bpp_string.cpp:13
std::string get_code() const override
Return the contents of the main code buffer as a string.
Definition: bpp_string.cpp:39
std::string get_post_code() const override
Return the contents of the post-code buffer as a string.
Definition: bpp_string.cpp:51
A value assignment statement in Bash++.
Definition: bpp.h:723
bool is_array_assignment() const
Definition: bpp_value_assignment.cpp:47
std::shared_ptr< bpp_entity > nonprimitive_object
Definition: bpp.h:726
bool nonprimitive_assignment
Definition: bpp.h:725
bool is_nonprimitive_assignment() const
Definition: bpp_value_assignment.cpp:35
bpp_value_assignment()
Definition: bpp_value_assignment.cpp:13
bool array_assignment
Definition: bpp.h:728
std::shared_ptr< bpp_entity > get_nonprimitive_object() const
Definition: bpp_value_assignment.cpp:39
bool lvalue_nonprimitive
Definition: bpp.h:727
void set_adding(bool is_adding)
Definition: bpp_value_assignment.cpp:31
void set_lvalue_nonprimitive(bool is_nonprimitive)
Definition: bpp_value_assignment.cpp:23
void set_array_assignment(bool is_array)
Definition: bpp_value_assignment.cpp:27
void set_nonprimitive_assignment(bool is_nonprimitive)
Definition: bpp_value_assignment.cpp:15
bool lvalue_is_nonprimitive() const
Definition: bpp_value_assignment.cpp:43
bool is_adding() const
Definition: bpp_value_assignment.cpp:51
void set_nonprimitive_object(std::shared_ptr< bpp_entity > object)
Definition: bpp_value_assignment.cpp:19
bool adding
Definition: bpp.h:729
Definition: bash_case.cpp:11
static const std::shared_ptr< bpp_method > inaccessible_method
A placeholder for an inaccessible method of a class (scope handling)
Definition: bpp.h:77
static const std::shared_ptr< bpp_datamember > inaccessible_datamember
A placeholder for an inaccessible data member of a class (scope handling)
Definition: bpp.h:71
static const char bpp_nullptr[]
The secret internal value of '@nullptr' in Bash++.
Definition: bpp.h:83
static const std::shared_ptr< bpp_entity > inaccessible_entity
A placeholder for an inaccessible entity (scope handling)
Definition: bpp.h:65
bpp_scope
Definition: bpp.h:19
@ SCOPE_PUBLIC
Definition: bpp.h:20
@ SCOPE_INACCESSIBLE
Definition: bpp.h:23
@ SCOPE_PRIVATE
Definition: bpp.h:22
@ SCOPE_PROTECTED
Definition: bpp.h:21
reference_type
Definition: bpp.h:26
@ ref_method
Definition: bpp.h:28
@ ref_object
Definition: bpp.h:29
@ ref_primitive
Definition: bpp.h:27