Commit c7a0e8a2 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Updated demos/calc-incremental. Messy and incomplete.

parent ff3096be
......@@ -75,7 +75,21 @@ let rec loop linebuf (result : int I.result) =
if true then begin
Printf.fprintf stderr "Stack height: %d\n%!" (height env);
Printf.fprintf stderr "Stack view:\n%s\n%!" (print env)
Printf.fprintf stderr "Stack view:\n%s\n%!" (print env);
begin match Lazy.force (I.view env) with
| I.Nil ->
| I.Cons (I.Element (current, _, _, _), _) ->
Printf.fprintf stderr "Current state: %d\n%!" (Obj.magic current);
let items : (I.production * int) list = Parser.Inspection.items current in
Printf.fprintf stderr "#Items: %d\n%!" (List.length items);
List.iter (fun (prod, index) ->
let _lhs : Parser.Inspection.xsymbol = Parser.Inspection.lhs prod in
let _rhs : Parser.Inspection.xsymbol list = Parser.Inspection.rhs prod in
(* TEMPORARY print item *)
) items
(* The parser needs a token. Request one from the lexer,
and offer it to the parser, which will produce a new
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