PEGO

G180: Typed Frame Layouts

Matching direct capture layouts to the general emitter enables bodies whose structural walk would omit or reorder required slots.

Mechanism and Invariants

LR uses authoritative Node-rule capture metadata. Independent Operators Rule and owned repetition scopes collect names with the same build mode, predicate visibility, projection and order as the general emitter. Dead syntax contributes known nil slots. Required slots can widen frames or pool classes.

Scope and State

Applied by default only to eligible generated typed Go bodies. Node parsing/recognition, closure, VMs and TypeScript retain their separate routes.

Reference Control

No generation option selects an alternative for this mechanism. Typed Go output comes from the Flow IR printer, and its generated parsers are compared with the engine oracle in the internal/engine tests.

Evidence and Implementation

Record 082 measures large same-source LR/Operators Rule inputs at 0.904–0.945 of the structural-discovery reference. Small matching and generation-time ranges overlap parity. Layout collection can widen frames despite unchanged allocations in these fixtures. The result concerns newly eligible layouts and does not establish zero memory cost for every grammar.

Evidence records: 082.

Source owners: typed structural emitter, framed body emission.

The comparison policy distinguishes same-source controls, historical changes and full checkpoints.

Related mechanisms: G150, G160, G200.

Optimization Catalog