5 #ifndef FORBCC_PARAMETER_H 6 #define FORBCC_PARAMETER_H 9 #include <variable.hpp> 16 enum class direction {
33 parameter() : _direction(direction::IN), _variable() {};
60 direction
dir()
const {
71 return _variable.
name();
82 if (_direction == direction::IN) {
97 #endif //FORBCC_PARAMETER_H const variable & var() const
Returns a reference to the variable used to express the parameter.
Definition: parameter.hpp:65
void print_reference(code_ostream &out) const
Prints the variable declaration, proxy to forbcc::type::print_var_reference, which is a virtual funct...
Definition: variable.hpp:75
Represents the parameter of a forbcc::method, each associated with a direction between either input...
Definition: parameter.hpp:22
direction dir() const
Returns the direction of the parameter.
Definition: parameter.hpp:60
void print_declaration(code_ostream &out) const
Prints the declaration, which may change whether the parameter is IN or OUT/INOUT.
Definition: parameter.hpp:81
void print_declaration(code_ostream &out) const override
Prints the variable declaration, proxy to forbcc::type::print_var_declaration, which is a virtual fun...
Definition: variable.hpp:56
std::string name() const
Returns the name of the given entity.
Definition: entity.hpp:68
parameter(const direction &dir, const variable &var)
Constructs a parameter.
Definition: parameter.hpp:36
This output stream supports indentation of code lines, which are formatted at each std::endl...
Definition: code_ostream.hpp:14
std::string name() const
Returns the name of the parameter.
Definition: parameter.hpp:70
Definition: code_ostream.hpp:11
Represents either an attribute of a forbcc::type_struct class or an automatic variable declared withi...
Definition: variable.hpp:13
parameter()
Empty parameter, used to preallocate variables in arrays or to use later assignment operator...
Definition: parameter.hpp:33