Theory Param_Tests
theory Param_Tests
imports TIGER_Grammar.LR_Prec_Parse Parser_Check
begin
section ‹Templates and operators›
text ‹Templates ‹P(X, …)› and the operators ‹* + ?› desugar to ordinary nonterminals
before elaboration (🗏‹../grammar_expand.ML›): nothing new in HOL. The tests
compare each against the grammar written by hand.›
fun toks :: ‹nat ⇒ 'tok list ⇒ ('tok, unit) token list› where
‹toks i [] = []›
| ‹toks i (x # xs) = ⦇tok = x, span = span.make 0 i i 1 []⦈ # toks (Suc (Suc i)) xs›