src/HOL/Codatatype/Tools/bnf_def.ML
changeset 49277 aee77001243f
parent 49236 632f68beff2a
child 49279 2fcfc11374ed
equal deleted inserted replaced
49276:59fa53ed7507 49277:aee77001243f
  1220   Outer_Syntax.improper_command @{command_spec "print_bnfs"} "print all BNFs"
  1220   Outer_Syntax.improper_command @{command_spec "print_bnfs"} "print all BNFs"
  1221     (Scan.succeed (Toplevel.keep (print_bnfs o Toplevel.context_of)));
  1221     (Scan.succeed (Toplevel.keep (print_bnfs o Toplevel.context_of)));
  1222 
  1222 
  1223 val _ =
  1223 val _ =
  1224   Outer_Syntax.local_theory_to_proof @{command_spec "bnf_def"} "define a BNF for an existing type"
  1224   Outer_Syntax.local_theory_to_proof @{command_spec "bnf_def"} "define a BNF for an existing type"
  1225     (((Parse.binding --| Parse.$$$ "=") -- Parse.term --
  1225     (((Parse.binding --| @{keyword "="}) -- Parse.term --
  1226        (Parse.$$$ "[" |-- Parse.list Parse.term --| Parse.$$$ "]") -- Parse.term --
  1226        (@{keyword "["} |-- Parse.list Parse.term --| @{keyword "]"}) -- Parse.term --
  1227        (Parse.$$$ "[" |-- Parse.list Parse.term --| Parse.$$$ "]")) >> bnf_def_cmd);
  1227        (@{keyword "["} |-- Parse.list Parse.term --| @{keyword "]"})) >> bnf_def_cmd);
  1228 
  1228 
  1229 end;
  1229 end;