Introduce a procedure type
This commit is contained in:
@ -55,8 +55,8 @@ namespace elna::source
|
||||
return m_type;
|
||||
}
|
||||
|
||||
constant_info::constant_info(const std::int32_t value)
|
||||
: m_value(value)
|
||||
constant_info::constant_info(const std::shared_ptr<const class type> type, const std::int32_t value)
|
||||
: m_type(type), m_value(value)
|
||||
{
|
||||
}
|
||||
|
||||
@ -64,6 +64,11 @@ namespace elna::source
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<const class type> constant_info::type() const noexcept
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
std::int32_t constant_info::value() const noexcept
|
||||
{
|
||||
return m_value;
|
||||
@ -97,17 +102,27 @@ namespace elna::source
|
||||
return m_type;
|
||||
}
|
||||
|
||||
intrinsic_info::intrinsic_info(const class procedure_type& type)
|
||||
: m_type(std::make_shared<procedure_type>(type))
|
||||
{
|
||||
}
|
||||
|
||||
intrinsic_info::~intrinsic_info()
|
||||
{
|
||||
}
|
||||
|
||||
std::size_t intrinsic_info::parameter_stack_size() const noexcept
|
||||
std::shared_ptr<const class procedure_type> intrinsic_info::type() const noexcept
|
||||
{
|
||||
return this->parameter_infos.size() * sizeof(std::int32_t);
|
||||
return m_type;
|
||||
}
|
||||
|
||||
procedure_info::procedure_info(std::shared_ptr<symbol_table> outer_scope)
|
||||
: local_table(std::make_shared<symbol_table>(outer_scope))
|
||||
std::size_t intrinsic_info::parameter_stack_size() const noexcept
|
||||
{
|
||||
return type()->arguments.size() * sizeof(std::int32_t);
|
||||
}
|
||||
|
||||
procedure_info::procedure_info(const class procedure_type& type, std::shared_ptr<symbol_table> outer_scope)
|
||||
: intrinsic_info(type), local_table(std::make_shared<symbol_table>(outer_scope))
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user