Added syntactic constants for classes (for proper

regexp parsing support).
This commit is contained in:
Burkhart Wolff 2018-05-15 09:11:17 +02:00
parent 2acc4ea222
commit 6aa563df17
5 changed files with 12 additions and 8 deletions

View File

@ -49,7 +49,7 @@ term "@{term ''Bound 0''}"
term "@{thm ''refl''}"
term "@{docitem ''<doc_ref>''}"
type_synonym monitor = "int rexp"
section{*Primitive Markup Generators*}
ML{*
@ -732,11 +732,14 @@ fun add_doc_class_cmd overloaded (raw_params, binding) raw_parent raw_fieldsNdef
else error("no overloading allowed.")
val gen_antiquotation = OntoLinkParser.docitem_ref_antiquotation
val _ = map_filter (check_n_filter thy) fields
val H = Sign.add_consts_cmd [(binding,"monitor",Mixfix.NoSyn)]
in thy |> Record.add_record overloaded (params', binding) parent (tag_attr::fields)
|> DOF_core.define_doc_class_global (params', binding) parent fieldsNterms'
|> (fn thy => gen_antiquotation binding (cid thy) thy)
(* defines the ontology-checked text antiquotation to this document class *)
|> Sign.add_consts_cmd [(binding,"monitor",Mixfix.NoSyn)]
(* defines syntax for monitor regeexpr for this class *)
end;

View File

@ -312,6 +312,7 @@ Thy_Output.output_text: Toplevel.state -> {markdown: bool} -> Input.source -> st
Thy_Output.output : Proof.context -> Pretty.T list -> string;
\<close>
section {* The Nano-Kernel: Contexts, (Theory)-Contexts, (Proof)-Contexts *}
ML{*

View File

@ -27,7 +27,7 @@ doc_class requirement =
doc_class requirement_analysis =
no :: "nat"
where "\<lbrace>requirement_item\<rbrace>\<^sup>+"
where "\<lbrace>requirement\<rbrace>\<^sup>+"
text{*The category @{emph \<open>hypothesis\<close>} is used for assumptions from the
@ -140,8 +140,8 @@ doc_class test_documentation =
no :: "nat"
where "test_specification ~~ \<lbrace>test_case~~test_result\<rbrace>\<^sup>+ ~~ \<lbrace>test_environment||test_tool\<rbrace>\<^sup>+ ~~
\<lbrakk>test_requirement\<rbrakk> ~~ test_adm_role"
where " test_specification ~~\<lbrace>test_case~~test_result\<rbrace>\<^sup>+ ~~ \<lbrace>test_environment||test_tool\<rbrace>\<^sup>+ ~~
\<lbrakk> test_requirement \<rbrakk> ~~ test_adm_role"
where " test_specification ~~ \<lbrace>test_case~~test_result\<rbrace>\<^sup>+ ~~ \<lbrace>test_environment||test_tool\<rbrace>\<^sup>+ ~~
\<lbrakk>test_requirement \<rbrakk> ~~ test_adm_role"

View File

@ -19,10 +19,10 @@ doc_class D = B +
doc_class F =
r :: "thm list"
b :: "(A \<times> C) set" <= "{}"
b :: "(A \<times> C) set" <= "{}"
doc_class M =
trace :: "(A + C + D + F) list"
where "A . (C | D)* . [F]"
where "A ~~ \<lbrace>C || D\<rbrace>\<^sup>* ~~ \<lbrakk>F\<rbrakk>"
end

View File

@ -54,10 +54,10 @@ doc_class figure = text_section +
doc_class example = text_section +
comment :: "string"
doc_class conclusion = text_section +
doc_class "conclusion" = text_section +
main_author :: "author option" <= None
doc_class related_work = conclusion +
doc_class related_work = "conclusion" +
main_author :: "author option" <= None
doc_class bibliography =