xo-expression2: + DGlobalSymtab facet support gen + files
This commit is contained in:
parent
fc4bfafa0a
commit
06521e5e79
15 changed files with 400 additions and 5 deletions
|
|
@ -31,6 +31,7 @@ namespace xo {
|
|||
using ACollector = xo::mm::ACollector;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using MemorySizeVisitor = xo::mm::MemorySizeVisitor;
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
|
||||
public:
|
||||
/** @defgroup scm-globalsymtab-ctors constructors **/
|
||||
|
|
@ -91,6 +92,13 @@ namespace xo {
|
|||
std::size_t forward_children(obj<ACollector> gc) noexcept;
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-globalsymtab-printable-facet printable facet **/
|
||||
///@{
|
||||
|
||||
/** pretty-printing support **/
|
||||
bool pretty(const ppindentinfo & ppii) const;
|
||||
|
||||
///@}
|
||||
|
||||
private:
|
||||
/** map symbols -> bindings.
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
#pragma once
|
||||
|
||||
#include "DGlobalSymtab.hpp"
|
||||
//#include "symtab/ISymbolTable_DGlobalSymtab.hpp"
|
||||
//#include "symtab/IGCObject_DGlobalSymtab.hpp"
|
||||
//#include "symtab/IPrintable_DGlobalSymtab.hpp"
|
||||
#include "symtab/ISymbolTable_DGlobalSymtab.hpp"
|
||||
#include "symtab/IGCObject_DGlobalSymtab.hpp"
|
||||
#include "symtab/IPrintable_DGlobalSymtab.hpp"
|
||||
|
||||
/* end GlobalSymtab.hpp */
|
||||
|
|
|
|||
67
include/xo/expression2/symtab/IGCObject_DGlobalSymtab.hpp
Normal file
67
include/xo/expression2/symtab/IGCObject_DGlobalSymtab.hpp
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
/** @file IGCObject_DGlobalSymtab.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IGCObject_DGlobalSymtab.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IGCObject_DGlobalSymtab.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GCObject.hpp"
|
||||
#include <xo/gc/GCObject.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include "DGlobalSymtab.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IGCObject_DGlobalSymtab; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::mm::AGCObject,
|
||||
xo::scm::DGlobalSymtab>
|
||||
{
|
||||
using ImplType = xo::mm::IGCObject_Xfer
|
||||
<xo::scm::DGlobalSymtab,
|
||||
xo::scm::IGCObject_DGlobalSymtab>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IGCObject_DGlobalSymtab
|
||||
**/
|
||||
class IGCObject_DGlobalSymtab {
|
||||
public:
|
||||
/** @defgroup scm-gcobject-dglobalsymtab-type-traits **/
|
||||
///@{
|
||||
using size_type = xo::mm::AGCObject::size_type;
|
||||
using AAllocator = xo::mm::AGCObject::AAllocator;
|
||||
using ACollector = xo::mm::AGCObject::ACollector;
|
||||
using Copaque = xo::mm::AGCObject::Copaque;
|
||||
using Opaque = xo::mm::AGCObject::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-gcobject-dglobalsymtab-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** memory consumption for this instance **/
|
||||
static size_type shallow_size(const DGlobalSymtab & self) noexcept;
|
||||
/** copy instance using allocator **/
|
||||
static Opaque shallow_copy(const DGlobalSymtab & self, obj<AAllocator> mm) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** during GC: forward immdiate children **/
|
||||
static size_type forward_children(DGlobalSymtab & self, obj<ACollector> gc) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
62
include/xo/expression2/symtab/IPrintable_DGlobalSymtab.hpp
Normal file
62
include/xo/expression2/symtab/IPrintable_DGlobalSymtab.hpp
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/** @file IPrintable_DGlobalSymtab.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DGlobalSymtab.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DGlobalSymtab.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DGlobalSymtab.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DGlobalSymtab; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DGlobalSymtab>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DGlobalSymtab,
|
||||
xo::scm::IPrintable_DGlobalSymtab>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DGlobalSymtab
|
||||
**/
|
||||
class IPrintable_DGlobalSymtab {
|
||||
public:
|
||||
/** @defgroup scm-printable-dglobalsymtab-type-traits **/
|
||||
///@{
|
||||
using ppindentinfo = xo::print::APrintable::ppindentinfo;
|
||||
using Copaque = xo::print::APrintable::Copaque;
|
||||
using Opaque = xo::print::APrintable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-printable-dglobalsymtab-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DGlobalSymtab & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
60
include/xo/expression2/symtab/ISymbolTable_DGlobalSymtab.hpp
Normal file
60
include/xo/expression2/symtab/ISymbolTable_DGlobalSymtab.hpp
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/** @file ISymbolTable_DGlobalSymtab.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/ISymbolTable_DGlobalSymtab.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/ISymbolTable_DGlobalSymtab.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SymbolTable.hpp"
|
||||
#include "DGlobalSymtab.hpp"
|
||||
|
||||
namespace xo { namespace scm { class ISymbolTable_DGlobalSymtab; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::ASymbolTable,
|
||||
xo::scm::DGlobalSymtab>
|
||||
{
|
||||
using ImplType = xo::scm::ISymbolTable_Xfer
|
||||
<xo::scm::DGlobalSymtab,
|
||||
xo::scm::ISymbolTable_DGlobalSymtab>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class ISymbolTable_DGlobalSymtab
|
||||
**/
|
||||
class ISymbolTable_DGlobalSymtab {
|
||||
public:
|
||||
/** @defgroup scm-symboltable-dglobalsymtab-type-traits **/
|
||||
///@{
|
||||
using Copaque = xo::scm::ASymbolTable::Copaque;
|
||||
using Opaque = xo::scm::ASymbolTable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-symboltable-dglobalsymtab-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** true iff this is toplevel (global) symbol table. **/
|
||||
static bool is_global_symtab(const DGlobalSymtab & self) noexcept;
|
||||
/** report ingredients needed to address variable at runtime. **/
|
||||
static Binding lookup_binding(const DGlobalSymtab & self, const DUniqueString * sym) noexcept;
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
Loading…
Add table
Add a link
Reference in a new issue