package lrgrep

  1. Overview
  2. Docs
Detailed error messages for Menhir-generated parsers

Install

dune-project
 Dependency

Authors

Maintainers

Sources

lrgrep-0.9.tbz
sha256=e53de12e4c5cbe6bca00643593266b4f9fa2e3f6a138195eeff7a4329f5c1c75
sha512=7fd7c4d11506fea7cc11c9bbf5aea9142d905643553c0c90e1bb16b794106b0c14a266acf89ae91b6929008dc0ba6515f788642873e2e4ba6c3d49bd45d25127

doc/kernel/Kernel/Info/Lr0/index.html

Module Info.Lr0Source

LR(0) state information. LR(0) states represent the "core" of LR(1) states, ignoring lookahead information.

include INDEXED with type 'g n = 'g lr0
Sourcetype 'g n = 'g lr0
Sourceval cardinal : 'g grammar -> 'g n Fix.Indexing.cardinal
Sourceval of_int : 'g grammar -> int -> 'g n Fix.Indexing.index
Sourceval incoming : 'g grammar -> 'g n Fix.Indexing.index -> 'g symbol Fix.Indexing.index option

incoming g s returns the symbol that labels the transition into state s. Returns None for initial states (which have no incoming transition). For non-initial states, returns Some sym where sym is the symbol that was parsed to reach this state.

items g s returns the set of LR(0) items in state s. These are the core items before closure is applied.

Sourceval is_entrypoint : 'g grammar -> 'g n Fix.Indexing.index -> 'g production Fix.Indexing.index option

is_entrypoint g s returns Some prod if s is an initial state corresponding to an entrypoint, where prod is the pseudo (start) production for that entrypoint. Returns None for non-initial states.