705 (******************************** outer syntax ********************************) |
705 (******************************** outer syntax ********************************) |
706 (******************************************************************************) |
706 (******************************************************************************) |
707 |
707 |
708 local |
708 local |
709 |
709 |
710 structure P = OuterParse and K = OuterKeyword |
|
711 |
|
712 val parse_domain_iso : |
710 val parse_domain_iso : |
713 (string list * binding * mixfix * string * (binding * binding) option) |
711 (string list * binding * mixfix * string * (binding * binding) option) |
714 parser = |
712 parser = |
715 (P.type_args -- P.binding -- P.opt_mixfix -- (P.$$$ "=" |-- P.typ) -- |
713 (Parse.type_args -- Parse.binding -- Parse.opt_mixfix -- (Parse.$$$ "=" |-- Parse.typ) -- |
716 Scan.option (P.$$$ "morphisms" |-- P.!!! (P.binding -- P.binding))) |
714 Scan.option (Parse.$$$ "morphisms" |-- Parse.!!! (Parse.binding -- Parse.binding))) |
717 >> (fn ((((vs, t), mx), rhs), morphs) => (vs, t, mx, rhs, morphs)); |
715 >> (fn ((((vs, t), mx), rhs), morphs) => (vs, t, mx, rhs, morphs)); |
718 |
716 |
719 val parse_domain_isos = P.and_list1 parse_domain_iso; |
717 val parse_domain_isos = Parse.and_list1 parse_domain_iso; |
720 |
718 |
721 in |
719 in |
722 |
720 |
723 val _ = |
721 val _ = |
724 OuterSyntax.command "domain_isomorphism" "define domain isomorphisms (HOLCF)" K.thy_decl |
722 Outer_Syntax.command "domain_isomorphism" "define domain isomorphisms (HOLCF)" |
|
723 Keyword.thy_decl |
725 (parse_domain_isos >> (Toplevel.theory o domain_isomorphism_cmd)); |
724 (parse_domain_isos >> (Toplevel.theory o domain_isomorphism_cmd)); |
726 |
725 |
727 end; |
726 end; |
728 |
727 |
729 end; |
728 end; |