package lrgrep

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

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.