xo-reader2 stack: streamline + mem sizing + bugfixes

This commit is contained in:
Roland Conybeare 2026-02-15 16:16:02 -05:00
commit 9ce05973f4
8 changed files with 210 additions and 136 deletions

View file

@ -23,6 +23,7 @@ namespace xo {
namespace scm {
ParserStateMachine::ParserStateMachine(const ArenaConfig & config,
const ArenaHashMapConfig & symtab_config,
size_type max_stringtable_capacity,
obj<AAllocator> expr_alloc,
obj<AAllocator> aux_alloc)
@ -30,6 +31,7 @@ namespace xo {
parser_alloc_{DArena::map(config)},
expr_alloc_{expr_alloc},
aux_alloc_{aux_alloc},
global_symtab_{DGlobalSymtab::make(expr_alloc, aux_alloc, symtab_config)},
debug_flag_{config.debug_flag_}
{
}
@ -60,6 +62,7 @@ namespace xo {
{
stringtable_.visit_pools(visitor);
parser_alloc_.visit_pools(visitor);
global_symtab_->visit_pools(visitor);
// not counting {expr_alloc_, fixed_alloc_}. We don't consider
// either to be owned by ParserStateMachine

View file

@ -20,13 +20,15 @@ namespace xo {
namespace scm {
// ----- SchematikaParser -----
SchematikaParser::SchematikaParser(const ArenaConfig & config,
size_t max_stringtable_capacity,
SchematikaParser::SchematikaParser(const ParserConfig & cfg,
obj<AAllocator> expr_alloc,
obj<AAllocator> fixed_alloc,
bool debug_flag)
: psm_{config, max_stringtable_capacity, expr_alloc, fixed_alloc},
debug_flag_{debug_flag}
obj<AAllocator> fixed_alloc)
: psm_{cfg.parser_arena_config_,
cfg.symtab_config_,
cfg.max_stringtable_capacity_,
expr_alloc,
fixed_alloc},
debug_flag_{cfg.debug_flag_}
{
}

View file

@ -14,11 +14,12 @@ namespace xo {
obj<AAllocator> fixed_alloc)
: tokenizer_{config.tk_buffer_config_,
config.tk_debug_flag_},
parser_{config.parser_arena_config_,
config.max_stringtable_cap_,
parser_{ParserConfig(config.parser_arena_config_,
config.symtab_config_,
config.max_stringtable_cap_,
config.parser_debug_flag_),
expr_alloc,
fixed_alloc,
config.parser_debug_flag_},
fixed_alloc},
debug_flag_{config.reader_debug_flag_}
{
}