src/Pure/ProofGeneral/pgip_output.ML
author aspinall
Mon, 22 Jan 2007 15:34:15 +0100
changeset 22159 0cf0d3912239
parent 22040 635aaa46b44d
child 22161 b2117f4f2d39
permissions -rw-r--r--
Comment
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
     1
(*  Title:      Pure/ProofGeneral/pgip_output.ML
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
     2
    ID:         $Id$
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
     3
    Author:     David Aspinall
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
     4
21940
fbd068dd4d29 minor tuning;
wenzelm
parents: 21929
diff changeset
     5
PGIP abstraction: output commands.
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
     6
*)
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
     7
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
     8
signature PGIPOUTPUT =
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
     9
sig
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
    10
    (* These are the PGIP messages which the prover emits. *) 
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
    11
    datatype pgipoutput = 
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    12
      Cleardisplay        of { area: PgipTypes.displayarea }
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    13
    | Normalresponse      of { area: PgipTypes.displayarea, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    14
                               urgent: bool, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    15
                               messagecategory: PgipTypes.messagecategory, 
21655
01b2d13153c8 Document structure in pgip_markup.ML. Minor fixes.
aspinall
parents: 21651
diff changeset
    16
                               content: XML.content }
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    17
    | Errorresponse       of { fatality: PgipTypes.fatality, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    18
                               area: PgipTypes.displayarea option, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    19
                               location: PgipTypes.location option, 
21655
01b2d13153c8 Document structure in pgip_markup.ML. Minor fixes.
aspinall
parents: 21651
diff changeset
    20
                               content: XML.content }
22040
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
    21
    | Informfileloaded    of { url: PgipTypes.pgipurl, completed: bool }
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
    22
    | Informfileoutdated  of { url: PgipTypes.pgipurl, completed: bool }
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
    23
    | Informfileretracted of { url: PgipTypes.pgipurl, completed: bool }
21655
01b2d13153c8 Document structure in pgip_markup.ML. Minor fixes.
aspinall
parents: 21651
diff changeset
    24
    | Proofstate          of { pgml: XML.content }
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    25
    | Metainforesponse    of { attrs: XML.attributes, 
21655
01b2d13153c8 Document structure in pgip_markup.ML. Minor fixes.
aspinall
parents: 21651
diff changeset
    26
                               content: XML.content }
01b2d13153c8 Document structure in pgip_markup.ML. Minor fixes.
aspinall
parents: 21651
diff changeset
    27
    | Lexicalstructure    of { content: XML.content }
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    28
    | Proverinfo          of { name: string, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    29
                               version: string, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    30
                               instance: string,
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    31
                               descr: string, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    32
                               url: Url.T, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    33
                               filenameextns: string }
21867
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    34
    | Setids              of { idtables: PgipTypes.idtable list  }
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    35
    | Delids              of { idtables: PgipTypes.idtable list }
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    36
    | Addids              of { idtables: PgipTypes.idtable list }
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    37
    | Hasprefs            of { prefcategory: string option, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    38
                               prefs: PgipTypes.preference list }
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    39
    | Prefval             of { name: string, value: string }
21867
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    40
    | Idvalue             of { name: PgipTypes.objname, 
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    41
			       objtype: PgipTypes.objtype, 
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    42
			       text: XML.content }
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    43
    | Informguise         of { file : PgipTypes.pgipurl option,  
21867
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    44
                               theory: PgipTypes.objname option, 
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    45
                               theorem: PgipTypes.objname option, 
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    46
                               proofpos: int option }
21867
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    47
    | Parseresult         of { attrs: XML.attributes, doc:PgipMarkup.pgipdocument, 
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    48
			       errs: XML.content } (* errs to become PGML *)
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    49
    | Usespgip            of { version: string, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    50
                               pgipelems: (string * bool * string list) list }
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    51
    | Usespgml            of { version: string }
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    52
    | Pgip                of { tag: string option, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    53
                               class: string, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    54
                               seq: int, id: string, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    55
                               destid: string option,
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    56
                               refid: string option,
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    57
                               refseq: int option,
21655
01b2d13153c8 Document structure in pgip_markup.ML. Minor fixes.
aspinall
parents: 21651
diff changeset
    58
                               content: XML.content }
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    59
    | Ready               of { }
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
    60
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    61
    val output : pgipoutput -> XML.tree                                  
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
    62
end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
    63
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
    64
structure PgipOutput : PGIPOUTPUT =
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
    65
struct
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
    66
open PgipTypes
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
    67
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
    68
datatype pgipoutput = 
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    69
         Cleardisplay        of { area: displayarea }
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
    70
       | Normalresponse      of { area: displayarea, urgent: bool, 
21655
01b2d13153c8 Document structure in pgip_markup.ML. Minor fixes.
aspinall
parents: 21651
diff changeset
    71
                                  messagecategory: messagecategory, content: XML.content }
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
    72
       | Errorresponse       of { area: displayarea option, fatality: fatality, 
21655
01b2d13153c8 Document structure in pgip_markup.ML. Minor fixes.
aspinall
parents: 21651
diff changeset
    73
                                  location: location option, content: XML.content }
22040
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
    74
       | Informfileloaded    of { url: Path.T, completed: bool }
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
    75
       | Informfileoutdated  of { url: Path.T, completed: bool }
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
    76
       | Informfileretracted of { url: Path.T, completed: bool }
21655
01b2d13153c8 Document structure in pgip_markup.ML. Minor fixes.
aspinall
parents: 21651
diff changeset
    77
       | Proofstate          of { pgml: XML.content }
01b2d13153c8 Document structure in pgip_markup.ML. Minor fixes.
aspinall
parents: 21651
diff changeset
    78
       | Metainforesponse    of { attrs: XML.attributes, content: XML.content }
01b2d13153c8 Document structure in pgip_markup.ML. Minor fixes.
aspinall
parents: 21651
diff changeset
    79
       | Lexicalstructure    of { content: XML.content }
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    80
       | Proverinfo          of { name: string, version: string, instance: string,
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    81
                                  descr: string, url: Url.T, filenameextns: string }
21867
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    82
       | Setids              of { idtables: PgipTypes.idtable list  }
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    83
       | Delids              of { idtables: PgipTypes.idtable list }
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    84
       | Addids              of { idtables: PgipTypes.idtable list }
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    85
       | Hasprefs            of { prefcategory: string option, prefs: preference list }
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    86
       | Prefval             of { name: string, value: string }
21867
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    87
       | Idvalue             of { name: PgipTypes.objname, 
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    88
				  objtype: PgipTypes.objtype, 
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    89
				  text: XML.content }
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    90
       | Informguise         of { file : PgipTypes.pgipurl option,  
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    91
				  theory: PgipTypes.objname option, 
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    92
				  theorem: PgipTypes.objname option, 
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    93
				  proofpos: int option }
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    94
       | Parseresult         of { attrs: XML.attributes, doc: PgipMarkup.pgipdocument,
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
    95
				  errs: XML.content } (* errs to become PGML *)
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    96
       | Usespgip            of { version: string, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    97
                                  pgipelems: (string * bool * string list) list }
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    98
       | Usespgml            of { version: string }
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
    99
       | Pgip                of { tag: string option, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   100
                                  class: string, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   101
                                  seq: int, id: string, 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   102
                                  destid: string option,
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   103
                                  refid: string option,
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   104
                                  refseq: int option,
21655
01b2d13153c8 Document structure in pgip_markup.ML. Minor fixes.
aspinall
parents: 21651
diff changeset
   105
                                  content: XML.content }
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   106
       | Ready               of { }
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   107
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   108
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   109
(* Construct output XML messages *)
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   110
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   111
fun cleardisplay (Cleardisplay vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   112
    let
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   113
        val area = #area vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   114
    in
21940
fbd068dd4d29 minor tuning;
wenzelm
parents: 21929
diff changeset
   115
        XML.Elem ("cleardisplay", attrs_of_displayarea area, [])
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   116
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   117
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   118
fun normalresponse (Normalresponse vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   119
    let 
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   120
        val area = #area vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   121
        val urgent = #urgent vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   122
        val messagecategory = #messagecategory vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   123
        val content = #content vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   124
    in
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   125
        XML.Elem ("normalresponse", 
21940
fbd068dd4d29 minor tuning;
wenzelm
parents: 21929
diff changeset
   126
                 attrs_of_displayarea area @
21651
99f4a06184dc Fix typo. Some cleanup for XML attributes
aspinall
parents: 21649
diff changeset
   127
                 (if urgent then attr "urgent" "true" else []) @
21940
fbd068dd4d29 minor tuning;
wenzelm
parents: 21929
diff changeset
   128
                 attrs_of_messagecategory messagecategory,
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   129
                 content)
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   130
    end
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   131
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   132
fun errorresponse (Errorresponse vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   133
    let 
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   134
        val area = #area vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   135
        val fatality = #fatality vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   136
        val location = #location vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   137
        val content = #content vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   138
    in
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   139
        XML.Elem ("errorresponse",
21940
fbd068dd4d29 minor tuning;
wenzelm
parents: 21929
diff changeset
   140
                 these (Option.map attrs_of_displayarea area) @
fbd068dd4d29 minor tuning;
wenzelm
parents: 21929
diff changeset
   141
                 attrs_of_fatality fatality @
fbd068dd4d29 minor tuning;
wenzelm
parents: 21929
diff changeset
   142
                 these (Option.map attrs_of_location location),
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   143
                 content)
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   144
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   145
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   146
fun informfileloaded (Informfileloaded vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   147
    let 
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   148
        val url = #url vs
22040
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   149
        val completed = #completed vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   150
    in
22040
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   151
        XML.Elem ("informfileloaded", 
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   152
		  attrs_of_pgipurl url @ 
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   153
		  (attr "completed" (PgipTypes.bool_to_pgstring completed)),
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   154
		  [])
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   155
    end
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   156
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   157
fun informfileoutdated (Informfileoutdated vs) =
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   158
    let 
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   159
        val url = #url vs
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   160
        val completed = #completed vs
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   161
    in
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   162
        XML.Elem ("informfileoutdated", 
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   163
		  attrs_of_pgipurl url @ 
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   164
		  (attr "completed" (PgipTypes.bool_to_pgstring completed)),
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   165
		  [])
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   166
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   167
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   168
fun informfileretracted (Informfileretracted vs) =
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   169
    let 
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   170
        val url = #url vs
22040
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   171
        val completed = #completed vs
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   172
    in
22040
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   173
        XML.Elem ("informfileretracted", 
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   174
		  attrs_of_pgipurl url @ 
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   175
		  (attr "completed" (PgipTypes.bool_to_pgstring completed)),
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   176
		  [])
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   177
    end
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   178
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   179
fun proofstate (Proofstate vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   180
    let
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   181
        val pgml = #pgml vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   182
    in
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   183
        XML.Elem("proofstate", [], pgml)
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   184
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   185
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   186
fun metainforesponse (Metainforesponse vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   187
    let 
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   188
        val attrs = #attrs vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   189
        val content = #content vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   190
    in
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   191
        XML.Elem ("metainforesponse", attrs, content)
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   192
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   193
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   194
fun lexicalstructure (Lexicalstructure vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   195
    let
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   196
        val content = #content vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   197
    in
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   198
        XML.Elem ("lexicalstructure", [], content)
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   199
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   200
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   201
fun proverinfo (Proverinfo vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   202
    let
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   203
        val name = #name vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   204
        val version = #version vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   205
        val instance = #instance vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   206
        val descr = #descr vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   207
        val url = #url vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   208
        val filenameextns = #filenameextns vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   209
    in 
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   210
        XML.Elem ("proverinfo",
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   211
                 [("name", name),
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   212
                  ("version", version),
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   213
                  ("instance", instance), 
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   214
                  ("descr", descr),
21858
05f57309170c avoid conflict with Alice keywords: renamed pack -> implode, unpack -> explode, any -> many, avoided assert;
wenzelm
parents: 21655
diff changeset
   215
                  ("url", Url.implode url),
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   216
                  ("filenameextns", filenameextns)],
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   217
                 [])
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   218
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   219
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   220
fun setids (Setids vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   221
    let
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   222
        val idtables = #idtables vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   223
    in
21867
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
   224
        XML.Elem ("setids",[],map idtable_to_xml idtables)
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   225
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   226
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   227
fun addids (Addids vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   228
    let
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   229
        val idtables = #idtables vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   230
    in
21867
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
   231
        XML.Elem ("addids",[],map idtable_to_xml idtables)
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   232
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   233
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   234
fun delids (Delids vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   235
    let
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   236
        val idtables = #idtables vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   237
    in
21867
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
   238
        XML.Elem ("delids",[],map idtable_to_xml idtables)
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   239
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   240
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   241
fun hasprefs (Hasprefs vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   242
  let 
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   243
      val prefcategory = #prefcategory vs
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   244
      val prefs = #prefs vs
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   245
  in 
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   246
      XML.Elem("hasprefs",opt_attr "prefcategory" prefcategory, map haspref prefs)
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   247
  end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   248
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   249
fun prefval (Prefval vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   250
    let 
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   251
        val name = #name vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   252
        val value = #value vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   253
    in
21651
99f4a06184dc Fix typo. Some cleanup for XML attributes
aspinall
parents: 21649
diff changeset
   254
        XML.Elem("prefval", attr "name" name, [XML.Text value])
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   255
    end 
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   256
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   257
fun idvalue (Idvalue vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   258
    let 
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   259
        val name = #name vs
21867
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
   260
	val objtype_attrs = attrs_of_objtype (#objtype vs)
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   261
        val text = #text vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   262
    in
21867
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
   263
        XML.Elem("idvalue", attr "name" name @ objtype_attrs, text)
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   264
    end
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   265
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   266
fun informguise (Informguise vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   267
  let
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   268
      val file = #file vs
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   269
      val theory = #theory vs
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   270
      val theorem = #theorem vs
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   271
      val proofpos = #proofpos vs
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   272
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   273
      fun elto nm attrfn xo = case xo of NONE=>[] | SOME x=>[XML.Elem(nm,attrfn x,[])]
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   274
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   275
      val guisefile = elto "guisefile" attrs_of_pgipurl file
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   276
      val guisetheory = elto "guisetheory" (single o (pair "thyname")) theory
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   277
      val guiseproof = elto "guiseproof" 
21651
99f4a06184dc Fix typo. Some cleanup for XML attributes
aspinall
parents: 21649
diff changeset
   278
                            (fn thm=>(attr "thmname" thm) @
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   279
                                     (opt_attr "proofpos" (Option.map Int.toString proofpos))) theorem
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   280
  in 
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   281
      XML.Elem("informguise", [], guisefile @ guisetheory @ guiseproof)
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   282
  end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   283
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   284
fun parseresult (Parseresult vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   285
    let
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   286
        val attrs = #attrs vs
21867
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
   287
        val doc = #doc vs
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
   288
        val errs = #errs vs
8750fbc28d5c Add abstraction for objtypes and documents.
aspinall
parents: 21858
diff changeset
   289
	val xmldoc = PgipMarkup.output_doc doc
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   290
    in 
21940
fbd068dd4d29 minor tuning;
wenzelm
parents: 21929
diff changeset
   291
        XML.Elem("parseresult", attrs, errs @ xmldoc)
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   292
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   293
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   294
fun acceptedpgipelems (Usespgip vs) = 
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   295
    let
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   296
        val pgipelems = #pgipelems vs
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   297
        fun async_attrs b = if b then attr "async" "true" else []
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   298
        fun attrs_attrs attrs = if attrs=[] then [] else attr "attributes" (space_implode "," attrs)
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   299
        fun singlepgipelem (e,async,attrs) = 
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   300
            XML.Elem("pgipelem", ((async_attrs async) @ (attrs_attrs attrs)),[XML.Text e])
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   301
                                                      
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   302
    in
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   303
        XML.Elem ("acceptedpgipelems", [],
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   304
                 map singlepgipelem pgipelems)
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   305
    end
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   306
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   307
fun usespgip (Usespgip vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   308
    let
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   309
        val version = #version vs
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   310
        val acceptedelems = acceptedpgipelems (Usespgip vs)
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   311
    in 
21651
99f4a06184dc Fix typo. Some cleanup for XML attributes
aspinall
parents: 21649
diff changeset
   312
        XML.Elem("usespgip", attr "version" version, [acceptedelems])
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   313
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   314
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   315
fun usespgml (Usespgml vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   316
    let
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   317
        val version = #version vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   318
    in 
21651
99f4a06184dc Fix typo. Some cleanup for XML attributes
aspinall
parents: 21649
diff changeset
   319
        XML.Elem("usespgml", attr "version" version, [])
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   320
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   321
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   322
fun pgip (Pgip vs) =
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   323
    let 
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   324
        val tag = #tag vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   325
        val class = #class vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   326
        val seq = #seq vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   327
        val id = #id vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   328
        val destid = #destid vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   329
        val refid = #refid vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   330
        val refseq = #refseq vs
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   331
        val content = #content vs
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   332
    in
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   333
        XML.Elem("pgip",
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   334
                 opt_attr "tag" tag @
21651
99f4a06184dc Fix typo. Some cleanup for XML attributes
aspinall
parents: 21649
diff changeset
   335
                 attr "id" id @
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   336
                 opt_attr "destid" destid @
21651
99f4a06184dc Fix typo. Some cleanup for XML attributes
aspinall
parents: 21649
diff changeset
   337
                 attr "class" class @
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   338
                 opt_attr "refid" refid @
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   339
                 opt_attr_map string_of_int "refseq" refseq @
21651
99f4a06184dc Fix typo. Some cleanup for XML attributes
aspinall
parents: 21649
diff changeset
   340
                 attr "seq" (string_of_int seq),
21649
40e6fdd26f82 Support PGIP communication for preferences in Emacs mode.
aspinall
parents: 21637
diff changeset
   341
                 content)
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   342
    end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   343
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   344
fun ready (Ready vs) = XML.Elem("ready",[],[])
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   345
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   346
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   347
fun output pgipoutput = case pgipoutput of
21929
fb0cd849bc60 Typo in last commit
aspinall
parents: 21902
diff changeset
   348
    Cleardisplay _          => cleardisplay pgipoutput
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   349
  | Normalresponse _        => normalresponse pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   350
  | Errorresponse _         => errorresponse pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   351
  | Informfileloaded _      => informfileloaded pgipoutput
22040
635aaa46b44d Add informfileoutdated and completed flag. This makes the PGIP messages match the Broker states.
aspinall
parents: 21940
diff changeset
   352
  | Informfileoutdated _    => informfileoutdated pgipoutput
21902
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   353
  | Informfileretracted _   => informfileretracted pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   354
  | Proofstate _            => proofstate pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   355
  | Metainforesponse _      => metainforesponse pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   356
  | Lexicalstructure _      => lexicalstructure pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   357
  | Proverinfo _            => proverinfo pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   358
  | Setids _                => setids pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   359
  | Addids _                => addids pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   360
  | Delids _                => delids pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   361
  | Hasprefs _              => hasprefs pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   362
  | Prefval _               => prefval pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   363
  | Idvalue _               => idvalue pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   364
  | Informguise _           => informguise pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   365
  | Parseresult _           => parseresult pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   366
  | Usespgip _              => usespgip pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   367
  | Usespgml _              => usespgml pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   368
  | Pgip _                  => pgip pgipoutput
8e5e2571c716 made SML/NJ happy
haftmann
parents: 21867
diff changeset
   369
  | Ready _                 => ready pgipoutput
21637
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   370
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   371
end
a7b156c404e2 Revamped Proof General interface.
aspinall
parents:
diff changeset
   372