Files
ViperC/App/lib/core/CompilerFactory.vp

32 lines
1.2 KiB
Plaintext

import memhub
# CompilerFactory - compiler struct factory (aligned with TPC Translator assembly).
novirtual class CompilerFactory:
"""Compiler struct factory holding shared objects such as the main and permanent pools."""
Pool: memhub.MemBuddy* # Main memory pool (transient data; reclaimed by mark/reset)
PermPool: memhub.MemBuddy* # Permanent memory pool (persistent data; never reset)
# ---- REnum variant registry (compile-time singleton; same lifetime as perm_pool struct entries)----
RenumClassNames: sizet*
RenumClassVariantCounts: sizet*
RenumVariantNames: sizet*
RenumVariantTags: sizet*
RenumClassCount: int
# ---- REnum variant field alias table (same lifetime; _bind_variant_fields resolves real field types)----
RenumAliasClass: sizet*
RenumAliasField: sizet*
RenumAliasIndex: sizet*
RenumAliasTy: sizet*
RenumAliasVariant: sizet*
RenumAliasCount: int
def __init__(self, pool: memhub.MemBuddy*, perm_pool: memhub.MemBuddy*):
if self is None: return
self.Pool = pool
self.PermPool = perm_pool
# Global factory singleton
factory: CompilerFactory* = None