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 isCamlinternalMenhirLib.TableFormat.TABLES, she's the only one with a real job π"IT"β type:sig end(yes, thatsig 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 ('avs'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,'aand'b, living their separate lives πval compare_symbols : xsymbol -> xsymbol -> intβ symbols comparing symbols, no polymorphism drama hereval compare_productions : production -> production -> intβ productions vs productions, classicval compare_items : item -> item -> intβ items vs items, the wholeproduction * intpackage 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 notesval 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,'afor the nonterminal and'bfor the terminal. Keep them straight, bestie πval xfirst : xsymbol -> 'a terminal -> boolβ thexsymbolversion of the above, because of course there's anxvariant π
β 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
- arch rolling: ocaml 5.5.0-1 Β· LGPL2.1 AND custom: QPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms