Playground

WRITE A GRAMMAR.
WATCH IT TOKENIZE.
AND PARSE.

Lexer rules in P1, parser rules in P2, text in P3. Every edit rescans and reparses. With a parse, the text takes its rules' colours; hover a tree node to see the text it covers.

One rule per line: NAME  regex
MEM
One rule per line: expr -> expr PLUS term; terminals are P1 rules
MEM
MEM
Parsing algorithm