package lrgrep
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=e53de12e4c5cbe6bca00643593266b4f9fa2e3f6a138195eeff7a4329f5c1c75
sha512=7fd7c4d11506fea7cc11c9bbf5aea9142d905643553c0c90e1bb16b794106b0c14a266acf89ae91b6929008dc0ba6515f788642873e2e4ba6c3d49bd45d25127
doc/kernel/Kernel/Info/index.html
Module Kernel.InfoSource
Grammar information interface
This module exports data structures and operations for handling grammar information. It provides indexed representations of grammars with type-level cardinalities for type-safe access.
Main components:
- The
Load_grammarfunctor takes Menhir's grammar representation and computes all index structures for the grammar.
- Types for grammar elements with their indices:
terminal,nonterminal,symbol,production,itemlr0,lr1: LR(0) and LR(1) statesgoto_transition,shift_transition,transition: Transitionsreduction: Reductions
- Module interfaces for each grammar element:
Terminal,Nonterminal,Symbol,Production,ItemLr0,Lr1,Transition,Reduction
Each module provides:
cardinal: The size of the index setof_int: Construct an index from an integer- Type-specific functions for accessing properties
Explicit representation of LR(0) items. An item is a production with a dot position: A -> α . β. Items are indexed globally across all productions for efficient set operations. The dot position ranges from 0 (before all RHS symbols) to length (after all).
LR(0) state information. LR(0) states represent the "core" of LR(1) states, ignoring lookahead information.
LR(1) state information. LR(1) states extend LR(0) cores with lookahead information, determining when reductions should be performed.
Reduction information. A reduction represents a (state, production, lookahead set) triple, meaning that in the given state, when the lookahead terminal is in the set, the parser should reduce by the given production.