xo-interpreter2: scaffold repl + alloc measurement frameowkr
This commit is contained in:
parent
7028fa49f8
commit
f6aae4190e
42 changed files with 1398 additions and 198 deletions
|
|
@ -36,6 +36,7 @@ namespace xo {
|
|||
using AAllocator = xo::mm::AAllocator;
|
||||
using ArenaConfig = xo::mm::ArenaConfig;
|
||||
using DArena = xo::mm::DArena;
|
||||
using MemorySizeInfo = xo::mm::MemorySizeInfo;
|
||||
using size_type = std::size_t;
|
||||
|
||||
public:
|
||||
|
|
@ -61,6 +62,11 @@ namespace xo {
|
|||
/** top of parser stack **/
|
||||
obj<ASyntaxStateMachine> top_ssm() const;
|
||||
|
||||
/** number of distinct memory pools owned by PS **/
|
||||
std::size_t _n_store() const noexcept;
|
||||
/** memory consumption for i'th memory pool **/
|
||||
MemorySizeInfo _store_info(std::size_t i) const noexcept;
|
||||
|
||||
///@}
|
||||
|
||||
/** @defgroup scm-parserstatemachine-bookkeeping bookkeeping methods **/
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@ namespace xo {
|
|||
using token_type = Token;
|
||||
using ArenaConfig = xo::mm::ArenaConfig;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using MemorySizeInfo = xo::mm::MemorySizeInfo;
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
using size_type = std::size_t;
|
||||
|
||||
|
|
@ -192,6 +193,11 @@ namespace xo {
|
|||
/** top of parser stack **/
|
||||
obj<ASyntaxStateMachine> top_ssm() const;
|
||||
|
||||
/** number of distinct memory pools owned by PS **/
|
||||
std::size_t _n_store() const noexcept;
|
||||
/** memory consumption for i'th memory pool **/
|
||||
MemorySizeInfo _store_info(std::size_t i) const noexcept;
|
||||
|
||||
///@}
|
||||
/** scm-schematikaparser-general-methods **/
|
||||
///@{
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ namespace xo {
|
|||
class SchematikaReader {
|
||||
public:
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using MemorySizeInfo = xo::mm::MemorySizeInfo;
|
||||
using span_type = xo::mm::span<const char>;
|
||||
using size_type = std::size_t;
|
||||
|
||||
|
|
@ -43,6 +44,9 @@ namespace xo {
|
|||
SchematikaReader(const ReaderConfig & config,
|
||||
obj<AAllocator> expr_alloc);
|
||||
|
||||
std::size_t _n_store() const noexcept;
|
||||
MemorySizeInfo _store_info(std::size_t i) const noexcept;
|
||||
|
||||
/** true iff parser is at top-level.
|
||||
* false iff parser is working on incomplete expression
|
||||
**/
|
||||
|
|
@ -53,6 +57,11 @@ namespace xo {
|
|||
**/
|
||||
void begin_interactive_session();
|
||||
|
||||
/** prepare batch session
|
||||
* (limits expression types at toplevel)
|
||||
**/
|
||||
void begin_batch_session();
|
||||
|
||||
/** consume input @p input_cstr **/
|
||||
const ReaderResult & read_expr(span_type input_span, bool eof);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue