Put a document
on the table.
Both benches call the library compiled from these sources to JavaScript and loaded beside this page. Nothing here is a recording.
Drag the rule to cut the document anywhere. At each cut the reader says whether it is waiting for more, and what it would say if the text ended there — the two answers a parser has to give when its text arrives in pieces. Delete a bracket and watch the expectation change.
The tree is what make_expr_parser built from the table:
precedence and associativity are visible in its shape, not asserted
afterwards. A boxed operator is a node, the lines under it are its
operands, and the left-to-right order is the order the text was read in.
cut(text, at) and expression(text), both taking a
string and returning a string. Everything the page draws is computed by the
library at the moment you type — the refusals, the positions, the
expectations, and the tree.