Commit 58bd83c8 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Merge branch 'master' into merr

parents a991d7cb dcc89cc9
......@@ -26,6 +26,7 @@ A [supplier] is a function that produces tokens on demand.
[lexer_lexbuf_to_supplier] turns a lexer and a lexbuf into a supplier.
[loop] is a ready-made made main parsing loop.
[loop_handle] is a variant of [loop] that lets the user do her own error handling.
[number] maps a state of the LR(1) automaton to its number.
Incompatible change of the incremental API: renamed the type ['a result]
......@@ -120,7 +120,7 @@
* Suite des patchs de Frédéric Bour.
API d'inspection complète.
Exposer le nombre d'états (pour la mémoisation) et une conversion état -> entier.
Exposer le nombre d'états (pour la mémoisation).
Idem pour les productions.
Fonctions d'affichage pour les types terminal, nonterminal, etc.?
Fonctions d'isomorphisme entre token et 'a terminal * 'a?
......@@ -2149,6 +2149,14 @@ The index \verb+'a+ is the type of the semantic values associated with $A$.
The role played by \verb+'a+ is clarified in the definition of the
type \verb+element+, which follows.
%% val number
val number: _ lr1state -> int
The states of the LR(1) automaton are numbered (from 0 and up).
%% type element
......@@ -113,6 +113,10 @@ module type INCREMENTAL_ENGINE = sig
type 'a lr1state
(* The states of the LR(1) automaton are numbered (from 0 and up). *)
val number: _ lr1state -> int
(* An element is a pair of a non-initial state [s] and a semantic value [v]
associated with the incoming symbol of this state. The idea is, the value
[v] was pushed onto the stack just before the state [s] was entered. Thus,
......@@ -84,6 +84,10 @@ module type TABLE = sig
type state
(* States are numbered. *)
val number: state -> int
(* The type of tokens. These can be thought of as real tokens, that is,
tokens returned by the lexer. They carry a semantic value. This type
does not include the [error] pseudo-token. *)
......@@ -10,6 +10,9 @@ module T = struct
type state =
let number =
type token =
......@@ -5,6 +5,8 @@ module Make (T : TableFormat.TABLES)
type state =
let number s = s
type token =
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment