Camlinternal...erpreter.Make(3)

πŸ’– NAME πŸ’–

CamlinternalMenhirLib.InspectionTableInterpreter.Make β€” no description 😭 (yeah bestie, that's literally all it says, we got crumbs and we're gonna make a whole feast out of 'em)

This page lives in the OCaml library manual β€” welcome to the Camlinternal...erpreter.Make(3) corner of the universe πŸ¦‹


πŸŽ€ Module πŸŽ€

Module CamlinternalMenhirLib.InspectionTableInterpreter.Make

Like, that's the whole module path. Say it with your chest. πŸ“£


✨ Documentation ✨

Okay so here's the functor signature, and bestie, she's got four parameters and gives you back sig end. Iconic minimalism honestly πŸ‘‘

Module Make
 : (TT : TableFormat.TABLES) (IT : sig end) (ET : sig end) (E : sig end)
-> sig end

🌸 Parameters 🌸

Four of them. Count 'em. No, there are not more. Yes, three of them are literally the empty signature, and no, I will not be explaining that further because the docs don't πŸ’€

  • "TT" β€” this one's type is CamlinternalMenhirLib.TableFormat.TABLES, she's the only one with a real job πŸ’…
  • "IT" β€” type: sig end (yes, that sig end)
  • "ET" β€” type: sig end (again. same energy. 🫢)
  • "E" β€” type: sig end (third time's the charm ✨)

🌈 The Actual Contents 🌈

First thing's first, we're pulling in a whole module:

include CamlinternalMenhirLib.IncrementalEngine.SYMBOLS

So everything from there is just, like, in here now. Slay. Inheritance but make it functorial.

Then the types:

type 'a lr1state
type production
type item = production * int

item is a pair β€” a production and an int. That's it. That's the whole vibe. πŸ“


🌟 Comparisons (the "who's first" committee) 🌟

  • val compare_terminals : 'a terminal -> 'b terminal -> int β€” note the type variables are different ('a vs 'b), bestie, that's not a typo on my end, that's exactly how she's written πŸ‘€
  • val compare_nonterminals : 'a nonterminal -> 'b nonterminal -> int β€” same deal, 'a and 'b, living their separate lives πŸ’œ
  • val compare_symbols : xsymbol -> xsymbol -> int β€” symbols comparing symbols, no polymorphism drama here
  • val compare_productions : production -> production -> int β€” productions vs productions, classic
  • val compare_items : item -> item -> int β€” items vs items, the whole production * int package deal 🎁

🧚 Looking Things Up 🧚

  • val incoming_symbol : 'a lr1state -> 'a symbol β€” give it a state, get a symbol back, matching type variable and all ✨
  • val items : 'a lr1state -> item list β€” give it a state, get a whole list of items. We love a list. We stan a list. πŸ“‹

πŸ¦‹ Productions, Dissected πŸ¦‹

  • val lhs : production -> xsymbol β€” the left-hand side, singular, one symbol, no notes
  • val rhs : production -> xsymbol list β€” the right-hand side, and she's a list because obviously πŸ’…

πŸ”₯ Nullable / First (the grammar girlies) πŸ”₯

  • val nullable : 'a nonterminal -> bool β€” can this nonterminal vanish into the void? This function knows πŸ‘»
  • val first : 'a nonterminal -> 'b terminal -> bool β€” again with the two different type variables, 'a for the nonterminal and 'b for the terminal. Keep them straight, bestie 😌
  • val xfirst : xsymbol -> 'a terminal -> bool β€” the xsymbol version of the above, because of course there's an x variant πŸ™ˆ

⭐ foreach_terminal & Friends ⭐

  • val foreach_terminal : (xsymbol -> 'a -> 'a) -> 'a -> 'a β€” takes a function (xsymbol -> 'a -> 'a), takes an 'a, hands you back an 'a. Folder energy, we love her 🫢
  • val foreach_terminal_but_error : (xsymbol -> 'a -> 'a) -> 'a -> 'a β€” same shape exactly, but with "but_error" in the name, so like… the error one is excluded, iykyk πŸ’€
Ngl the doc doesn't spell out any more than that, so I'm not gonna invent lore. The name says it all: everybody except the error one. Periodt.

πŸ‘‘ The Environment & feed πŸ‘‘

type 'a env

Then the star of the show, and she has a lot of arrows:

val feed : 'a symbol -> CamlinternalMenhirLib.IncrementalEngine.position
-> 'a -> CamlinternalMenhirLib.IncrementalEngine.position -> 'b env ->
'b env

So it's: a 'a symbol, then a CamlinternalMenhirLib.IncrementalEngine.position, then an 'a, then another CamlinternalMenhirLib.IncrementalEngine.position, then a 'b env, and out comes a 'b env. Two positions. They're both fully qualified. Every single character matters here, do not abbreviate them, I'm begging πŸ₯Ί


<div align="center">πŸŽ€ πŸ¦‹ 🌸 πŸ¦‹ πŸŽ€</div>

Okay that's the whole page, bestie β€” every type, every val, every fully-qualified CamlinternalMenhirLib.IncrementalEngine.position, all of it, untouched. Go forth and interpret those inspection tables πŸ’–πŸ”₯

This page was brought to you by OCamldoc, dated 2026-06-22, and the footer herself: Camlinternal...erpreter.Make(3). Stan the ellipsis, she's doing her best πŸ’…βœ¨
πŸ“¦ where this page comes from