53 val set_printings: (Code_Printer.raw_const_syntax, Code_Printer.tyco_syntax, string, unit, unit, (string * string list)) symbol_attr_decl |
53 val set_printings: (Code_Printer.raw_const_syntax, Code_Printer.tyco_syntax, string, unit, unit, (string * string list)) symbol_attr_decl |
54 -> theory -> theory |
54 -> theory -> theory |
55 val add_reserved: string -> string -> theory -> theory |
55 val add_reserved: string -> string -> theory -> theory |
56 |
56 |
57 val codegen_tool: string (*theory name*) -> string (*export_code expr*) -> unit |
57 val codegen_tool: string (*theory name*) -> string (*export_code expr*) -> unit |
58 |
|
59 val setup: theory -> theory |
|
60 end; |
58 end; |
61 |
59 |
62 structure Code_Target : CODE_TARGET = |
60 structure Code_Target : CODE_TARGET = |
63 struct |
61 struct |
64 |
62 |
490 val thy = Proof_Context.theory_of ctxt; |
488 val thy = Proof_Context.theory_of ctxt; |
491 in (Sign.intern_class thy raw_tyco, Sign.intern_type thy raw_class) end) Class_Instance; |
489 in (Sign.intern_class thy raw_tyco, Sign.intern_type thy raw_class) end) Class_Instance; |
492 |
490 |
493 in |
491 in |
494 |
492 |
495 val antiq_setup = |
493 val _ = Theory.setup |
496 Thy_Output.antiquotation @{binding code_stmts} |
494 (Thy_Output.antiquotation @{binding code_stmts} |
497 (parse_const_terms -- |
495 (parse_const_terms -- |
498 Scan.repeat (parse_consts || parse_types || parse_classes || parse_instances) |
496 Scan.repeat (parse_consts || parse_types || parse_classes || parse_instances) |
499 -- Scan.lift (Args.parens (Args.name -- Scan.option Parse.int))) |
497 -- Scan.lift (Args.parens (Args.name -- Scan.option Parse.int))) |
500 (fn {context = ctxt, ...} => fn ((mk_cs, mk_stmtss), (target_name, some_width)) => |
498 (fn {context = ctxt, ...} => fn ((mk_cs, mk_stmtss), (target_name, some_width)) => |
501 present_code ctxt (mk_cs ctxt) |
499 present_code ctxt (mk_cs ctxt) |
502 (maps (fn f => f ctxt) mk_stmtss) |
500 (maps (fn f => f ctxt) mk_stmtss) |
503 target_name some_width "Example" []); |
501 target_name some_width "Example" [])); |
504 |
502 |
505 end; |
503 end; |
506 |
504 |
507 |
505 |
508 (** serializer configuration **) |
506 (** serializer configuration **) |