Parameter Make.IT

include IncrementalEngine.SYMBOLS
type 'a terminal

The type 'a terminal represents a terminal symbol. Its parameter 'a represents the type of the semantic values associated with this symbol. The concrete definitions of this type is generated.

type 'a nonterminal

The type 'a nonterminal represents a nonterminal symbol. Its parameter 'a represents the type of the semantic values associated with this symbol. The concrete definitions of this type is generated.

type 'a symbol =
  1. | T : 'a terminal -> 'a symbol
  2. | N : 'a nonterminal -> 'a symbol

The type 'a symbol represents a terminal or nonterminal symbol. It is the disjoint union of the types 'a terminal and 'a nonterminal.

type xsymbol =
  1. | X : 'a symbol -> xsymbol

The type xsymbol is an existentially quantified version of the type 'a symbol. This type is useful in situations where 'a is not statically known.

type 'a lr1state = int

The type 'a lr1state describes an LR(1) state. The generated parser defines it internally as int.

Some of the tables that follow use encodings of (terminal and nonterminal) symbols as integers. So, we need functions that map the integer encoding of a symbol to its algebraic encoding.

val terminal : int -> xsymbol

terminal maps an integer code for a terminal symbol to a (terminal) symbol.

val nonterminal : int -> xsymbol

nonterminal maps an integer code for a nonterminal symbol to a (nonterminal) symbol.

The left-hand side of every production already appears in the signature TableFormat.TABLES, so we need not repeat it here.

val rhs : int -> int list

The table rhs provides access to the right-hand side of every production. The encoding of symbols as integers in described in TableBackend.

val lr0_core : int -> int

A mapping of every (non-initial) state to its LR(0) core.

val lr0_items : int -> int list

A mapping of every LR(0) state to its set of LR(0) items. Each item is represented in its packed form (see Item) as an integer.

val lr0_incoming : int -> int

A mapping of every LR(0) state to its incoming symbol, if it has one.

val nullable : int -> int

A table that tells which non-terminal symbols are nullable.

val first : int -> int -> int

A two-table dimensional table, indexed by a nonterminal symbol and by a terminal symbol (other than #), encodes the FIRST sets.