# `Grammar.Native.GLR`
[🔗](https://github.com/joetjen/ichor/blob/v0.3.0/lib/grammar/native/glr.ex#L1)

The compile-time codegen backend for `@engine glr` grammars: builds
the SLR(1) table via `Grammar.LRTable` once, at Elixir-compile-time
(conflicts are *expected* here, never rejected -- that's
`Grammar.Native.LR`'s job), and compiles the action/goto lookup into
per-state generated function clauses instead of the interpreted
`Grammar.GLR`'s `Map.get`s.

The graph-structured stack itself (`Grammar.GLR.GSS`: node merging,
multi-path reduce enumeration) is inherently a runtime, input-driven
data structure -- it can't compile away no matter which engine drives
it, so `Grammar.GLR.Runtime.run/6` (already shared with the
interpreted `Grammar.GLR`) is reused here completely unchanged, just
handed `&glr_action/2`/`&glr_goto/2` -- compiled function references --
in place of the closures-over-maps the interpreted path builds.

# `generate`

```elixir
@spec generate(Aether.Grammar.t(), module()) :: Macro.t()
```

Generates the full quoted body (lexer + compiled GLR action/goto lookup + `parse/1,2` + `run/1,2`) for `grammar`, dispatching to `actions_module`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
