Repository is here: https://github.com/tomjridge/tjr_simple_earley This commentary refers to commit 0dc99ad ocamldoc is available OCaml source code in src/ Main file: tjr_simple_earley.ml https://github.com/tomjridge/tjr_simple_earley/blob/master/src/tjr_simple_earley.ml Config and Misc are utility modules. Earley_intf has the main interfaces. Earley_base is the first implementation. General comments about the code: In order to run fast, we want every representation (of terminal, nonterminal, symbol, list of symbols, etc) to be an integer. Thus, we try to keep everything independent of the exact representation. Unfortunately this code was written about 5 years ago and I think I could do a better job today. Earley_intf https://github.com/tomjridge/tjr_simple_earley/blob/master/src/earley_intf.ml Starts with a general input type. Introduces nonterminals nt and terminals tm (symbols). A (simple) grammar is a function from nt to a list of (a list of symbols). A variation ...