Commit ec58844d authored by Bednárek David RNDr. Ph.D.'s avatar Bednárek David RNDr. Ph.D.
Browse files

fmwk: enum/struct open/close

parent d8d9ac29
......@@ -463,17 +463,22 @@ namespace cecko {
return globtable_->declare_struct_type(n, module_->getContext());
}
}
CKStructTypeObs CKContext::find_struct_type(const CIName& n)
CKStructTypeObs CKContext::define_struct_type_open(const CIName& n)
{
if (!!loctable_)
{
return loctable_->find_struct_type(n);
return loctable_->declare_struct_type_here(n, module_->getContext());
}
else
{
return globtable_->find_struct_type(n);
return globtable_->declare_struct_type_here(n, module_->getContext());
}
}
void CKContext::define_struct_type_close(CKStructTypeObs type, const CKStructItemArray& items)
{
type->finalize(items);
}
CKEnumTypeObs CKContext::declare_enum_type(const CIName& n)
{
if (!!loctable_)
......@@ -485,17 +490,22 @@ namespace cecko {
return globtable_->declare_enum_type(n, get_int_type());
}
}
CKEnumTypeObs CKContext::find_enum_type(const CIName& n)
CKEnumTypeObs CKContext::define_enum_type_open(const CIName& n)
{
if (!!loctable_)
{
return loctable_->find_enum_type(n);
return loctable_->declare_enum_type_here(n, get_int_type());
}
else
{
return globtable_->find_enum_type(n);
return globtable_->declare_enum_type_here(n, get_int_type());
}
}
void CKContext::define_enum_type_close(CKEnumTypeObs type, CKConstantObsVector items)
{
type->finalize(std::move(items));
}
CKTypedefConstObs CKContext::define_typedef(const std::string& name, const CKTypeRefPack& type_pack)
{
if (!!loctable_)
......
......@@ -914,13 +914,15 @@ namespace cecko {
/// @name Named struct types
/// @{
CKStructTypeObs declare_struct_type(const CIName& n);
CKStructTypeObs find_struct_type(const CIName& n);
CKStructTypeObs define_struct_type_open(const CIName& n);
void define_struct_type_close(CKStructTypeObs type, const CKStructItemArray& items);
/// @}
/// @name Named enum types
/// @{
CKEnumTypeObs declare_enum_type(const CIName& n);
CKEnumTypeObs find_enum_type(const CIName& n);
CKEnumTypeObs define_enum_type_open(const CIName& n);
void define_enum_type_close(CKEnumTypeObs type, CKConstantObsVector items);
/// @}
/// @name Variables
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment