63 for (elem <- elems) { |
63 for (elem <- elems) { |
64 elem match { |
64 elem match { |
65 //{{{ |
65 //{{{ |
66 // command status |
66 // command status |
67 case XML.Elem(Markup.FINISHED, _, _) => |
67 case XML.Elem(Markup.FINISHED, _, _) => |
68 st.phase = Command.Phase.FINISHED |
68 st.status = Command.Status.FINISHED |
69 command_change(st) |
69 command_change(st) |
70 case XML.Elem(Markup.UNPROCESSED, _, _) => |
70 case XML.Elem(Markup.UNPROCESSED, _, _) => |
71 st.phase = Command.Phase.UNPROCESSED |
71 st.status = Command.Status.UNPROCESSED |
72 command_change(st) |
72 command_change(st) |
73 case XML.Elem(Markup.FAILED, _, _) => |
73 case XML.Elem(Markup.FAILED, _, _) => |
74 st.phase = Command.Phase.FAILED |
74 st.status = Command.Status.FAILED |
75 command_change(st) |
75 command_change(st) |
76 case XML.Elem(Markup.DISPOSED, _, _) => |
76 case XML.Elem(Markup.DISPOSED, _, _) => |
77 document.prover.commands.removeKey(st.id) |
77 document.prover.commands.removeKey(st.id) |
78 st.phase = Command.Phase.REMOVED |
78 st.status = Command.Status.REMOVED |
79 command_change(st) |
79 command_change(st) |
80 |
80 |
81 // command and keyword declarations |
81 // command and keyword declarations |
82 case XML.Elem(Markup.COMMAND_DECL, (Markup.NAME, name) :: _, _) => |
82 case XML.Elem(Markup.COMMAND_DECL, (Markup.NAME, name) :: _, _) => |
83 command_decls += name |
83 command_decls += name |
105 case _ => |
105 case _ => |
106 } |
106 } |
107 //}}} |
107 //}}} |
108 |
108 |
109 case IsabelleProcess.Kind.ERROR if st != null => |
109 case IsabelleProcess.Kind.ERROR if st != null => |
110 if (st.phase != Command.Phase.REMOVED && st.phase != Command.Phase.REMOVE) |
110 if (st.status != Command.Status.REMOVED && st.status != Command.Status.REMOVE) |
111 st.phase = Command.Phase.FAILED |
111 st.status = Command.Status.FAILED |
112 st.add_result(tree) |
112 st.add_result(tree) |
113 command_change(st) |
113 command_change(st) |
114 |
114 |
115 case IsabelleProcess.Kind.WRITELN | IsabelleProcess.Kind.PRIORITY |
115 case IsabelleProcess.Kind.WRITELN | IsabelleProcess.Kind.PRIORITY |
116 | IsabelleProcess.Kind.WARNING if st != null => |
116 | IsabelleProcess.Kind.WARNING if st != null => |
151 activated.event(()) |
151 activated.event(()) |
152 } |
152 } |
153 } |
153 } |
154 |
154 |
155 private def send(cmd: Command) { |
155 private def send(cmd: Command) { |
156 cmd.phase = Command.Phase.UNPROCESSED |
156 cmd.status = Command.Status.UNPROCESSED |
157 commands.put(cmd.id, cmd) |
157 commands.put(cmd.id, cmd) |
158 |
158 |
159 val props = new Properties |
159 val props = new Properties |
160 props.setProperty(Markup.ID, cmd.id) |
160 props.setProperty(Markup.ID, cmd.id) |
161 props.setProperty(Markup.OFFSET, "1") |
161 props.setProperty(Markup.OFFSET, "1") |
164 process.create_command(props, content) |
164 process.create_command(props, content) |
165 process.insert_command(if (cmd.previous == null) "" else cmd.previous.id, cmd.id) |
165 process.insert_command(if (cmd.previous == null) "" else cmd.previous.id, cmd.id) |
166 } |
166 } |
167 |
167 |
168 def remove(cmd: Command) { |
168 def remove(cmd: Command) { |
169 cmd.phase = Command.Phase.REMOVE |
169 cmd.status = Command.Status.REMOVE |
170 process.remove_command(cmd.id) |
170 process.remove_command(cmd.id) |
171 } |
171 } |
172 } |
172 } |