Theory Diag_Tests
theory Diag_Tests
imports TIGER_Grammar.LR_Parser Parser_Check
begin
section ‹Diagnostics of rejected words›
definition tu :: ‹nat ⇒ 'tok ⇒ char list ⇒ ('tok, unit) token› where
‹tu i x u = ⦇tok = x, span = span.make 0 i 0 (length u) []⦈›
subsection ‹The simple driver: ‹lay››
text ‹The grammar ‹lay› of ‹Regression_Tests›, with two parsers: ‹lay_plain›
without the option and ‹lay_parse› with it. The option adds ‹lay_parse_diag›,
which runs a word once and returns the tree or the error, ‹lay_parse_terminals›,
‹lay_parse_info› and ‹lay_parse_render› for the messages (section ∗‹Messages›)
and the fact ‹lay_parse_diag.Inr_iff›, and leaves the code equations of the
parser and its tables as they are (checked below).›