|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| |
|
18 |
| package org.qedeq.kernel.bo.visitor; |
|
19 |
| |
|
20 |
| import org.qedeq.kernel.base.list.Atom; |
|
21 |
| import org.qedeq.kernel.base.list.Element; |
|
22 |
| import org.qedeq.kernel.base.list.ElementList; |
|
23 |
| import org.qedeq.kernel.base.module.Author; |
|
24 |
| import org.qedeq.kernel.base.module.AuthorList; |
|
25 |
| import org.qedeq.kernel.base.module.Axiom; |
|
26 |
| import org.qedeq.kernel.base.module.Chapter; |
|
27 |
| import org.qedeq.kernel.base.module.ChapterList; |
|
28 |
| import org.qedeq.kernel.base.module.Formula; |
|
29 |
| import org.qedeq.kernel.base.module.FunctionDefinition; |
|
30 |
| import org.qedeq.kernel.base.module.Header; |
|
31 |
| import org.qedeq.kernel.base.module.Import; |
|
32 |
| import org.qedeq.kernel.base.module.ImportList; |
|
33 |
| import org.qedeq.kernel.base.module.Latex; |
|
34 |
| import org.qedeq.kernel.base.module.LatexList; |
|
35 |
| import org.qedeq.kernel.base.module.LinkList; |
|
36 |
| import org.qedeq.kernel.base.module.LiteratureItem; |
|
37 |
| import org.qedeq.kernel.base.module.LiteratureItemList; |
|
38 |
| import org.qedeq.kernel.base.module.Location; |
|
39 |
| import org.qedeq.kernel.base.module.LocationList; |
|
40 |
| import org.qedeq.kernel.base.module.Node; |
|
41 |
| import org.qedeq.kernel.base.module.PredicateDefinition; |
|
42 |
| import org.qedeq.kernel.base.module.Proof; |
|
43 |
| import org.qedeq.kernel.base.module.ProofList; |
|
44 |
| import org.qedeq.kernel.base.module.Proposition; |
|
45 |
| import org.qedeq.kernel.base.module.Qedeq; |
|
46 |
| import org.qedeq.kernel.base.module.Rule; |
|
47 |
| import org.qedeq.kernel.base.module.Section; |
|
48 |
| import org.qedeq.kernel.base.module.SectionList; |
|
49 |
| import org.qedeq.kernel.base.module.Specification; |
|
50 |
| import org.qedeq.kernel.base.module.Subsection; |
|
51 |
| import org.qedeq.kernel.base.module.SubsectionList; |
|
52 |
| import org.qedeq.kernel.base.module.Term; |
|
53 |
| import org.qedeq.kernel.base.module.UsedByList; |
|
54 |
| import org.qedeq.kernel.base.module.VariableList; |
|
55 |
| import org.qedeq.kernel.bo.module.ModuleContext; |
|
56 |
| import org.qedeq.kernel.bo.module.ModuleDataException; |
|
57 |
| |
|
58 |
| |
|
59 |
| |
|
60 |
| |
|
61 |
| |
|
62 |
| |
|
63 |
| |
|
64 |
| |
|
65 |
| |
|
66 |
| public class QedeqNotNullTransverser implements QedeqTransverser { |
|
67 |
| |
|
68 |
| |
|
69 |
| private ModuleContext currentContext; |
|
70 |
| |
|
71 |
| |
|
72 |
| |
|
73 |
| |
|
74 |
| |
|
75 |
| private QedeqVisitor visitor; |
|
76 |
| |
|
77 |
| |
|
78 |
| private boolean blocked; |
|
79 |
| |
|
80 |
| |
|
81 |
| |
|
82 |
| |
|
83 |
| |
|
84 |
| |
|
85 |
| |
|
86 |
29019
| public QedeqNotNullTransverser(final String globalContext, final QedeqVisitor visitor) {
|
|
87 |
29019
| currentContext = new ModuleContext(globalContext);
|
|
88 |
29019
| this.visitor = visitor;
|
|
89 |
| } |
|
90 |
| |
|
91 |
| |
|
92 |
29017
| public void accept(final Qedeq qedeq) throws ModuleDataException {
|
|
93 |
29017
| getCurrentContext().setLocationWithinModule("");
|
|
94 |
29017
| blocked = false;
|
|
95 |
29017
| if (qedeq == null) {
|
|
96 |
0
| return;
|
|
97 |
| } |
|
98 |
29017
| final String context = getCurrentContext().getLocationWithinModule();
|
|
99 |
29017
| visitor.visitEnter(qedeq);
|
|
100 |
29015
| if (qedeq.getHeader() != null) {
|
|
101 |
29015
| getCurrentContext().setLocationWithinModule(context + "getHeader()");
|
|
102 |
29015
| accept(qedeq.getHeader());
|
|
103 |
| } |
|
104 |
28551
| if (qedeq.getChapterList() != null) {
|
|
105 |
28551
| getCurrentContext().setLocationWithinModule(context + "getChapterList()");
|
|
106 |
28551
| accept(qedeq.getChapterList());
|
|
107 |
| } |
|
108 |
223
| if (qedeq.getLiteratureItemList() != null) {
|
|
109 |
192
| getCurrentContext().setLocationWithinModule(context + "getLiteratureItemList()");
|
|
110 |
192
| accept(qedeq.getLiteratureItemList());
|
|
111 |
| } |
|
112 |
53
| setLocationWithinModule(context);
|
|
113 |
53
| visitor.visitLeave(qedeq);
|
|
114 |
53
| setLocationWithinModule(context);
|
|
115 |
| } |
|
116 |
| |
|
117 |
29015
| public void accept(final Header header) throws ModuleDataException {
|
|
118 |
29015
| if (blocked || header == null) {
|
|
119 |
0
| return;
|
|
120 |
| } |
|
121 |
29015
| final String context = getCurrentContext().getLocationWithinModule();
|
|
122 |
29015
| visitor.visitEnter(header);
|
|
123 |
28991
| if (header.getSpecification() != null) {
|
|
124 |
28991
| setLocationWithinModule(context + ".getSpecification()");
|
|
125 |
28991
| accept(header.getSpecification());
|
|
126 |
| } |
|
127 |
28886
| if (header.getTitle() != null) {
|
|
128 |
28886
| setLocationWithinModule(context + ".getTitle()");
|
|
129 |
28886
| accept(header.getTitle());
|
|
130 |
| } |
|
131 |
28840
| if (header.getSummary() != null) {
|
|
132 |
28840
| setLocationWithinModule(context + ".getSummary()");
|
|
133 |
28840
| accept(header.getSummary());
|
|
134 |
| } |
|
135 |
28794
| if (header.getAuthorList() != null) {
|
|
136 |
28794
| setLocationWithinModule(context + ".getAuthorList()");
|
|
137 |
28794
| accept(header.getAuthorList());
|
|
138 |
| } |
|
139 |
28722
| if (header.getImportList() != null) {
|
|
140 |
23948
| setLocationWithinModule(context + ".getImportList()");
|
|
141 |
23948
| accept(header.getImportList());
|
|
142 |
| } |
|
143 |
28606
| if (header.getUsedByList() != null) {
|
|
144 |
4756
| setLocationWithinModule(context + ".getUsedByList()");
|
|
145 |
4756
| accept(header.getUsedByList());
|
|
146 |
| } |
|
147 |
28551
| setLocationWithinModule(context);
|
|
148 |
28551
| visitor.visitLeave(header);
|
|
149 |
28551
| setLocationWithinModule(context);
|
|
150 |
| } |
|
151 |
| |
|
152 |
4756
| public void accept(final UsedByList usedByList) throws ModuleDataException {
|
|
153 |
4756
| if (blocked || usedByList == null) {
|
|
154 |
4677
| return;
|
|
155 |
| } |
|
156 |
79
| final String context = getCurrentContext().getLocationWithinModule();
|
|
157 |
79
| visitor.visitEnter(usedByList);
|
|
158 |
69
| for (int i = 0; i < usedByList.size(); i++) {
|
|
159 |
69
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
160 |
69
| accept(usedByList.get(i));
|
|
161 |
| } |
|
162 |
24
| setLocationWithinModule(context);
|
|
163 |
24
| visitor.visitLeave(usedByList);
|
|
164 |
24
| setLocationWithinModule(context);
|
|
165 |
| } |
|
166 |
| |
|
167 |
23948
| public void accept(final ImportList importList) throws ModuleDataException {
|
|
168 |
23948
| if (blocked || importList == null) {
|
|
169 |
23769
| return;
|
|
170 |
| } |
|
171 |
179
| final String context = getCurrentContext().getLocationWithinModule();
|
|
172 |
179
| visitor.visitEnter(importList);
|
|
173 |
167
| for (int i = 0; i < importList.size(); i++) {
|
|
174 |
252
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
175 |
252
| accept(importList.get(i));
|
|
176 |
| } |
|
177 |
63
| setLocationWithinModule(context);
|
|
178 |
63
| visitor.visitLeave(importList);
|
|
179 |
63
| setLocationWithinModule(context);
|
|
180 |
| } |
|
181 |
| |
|
182 |
252
| public void accept(final Import imp) throws ModuleDataException {
|
|
183 |
252
| if (blocked || imp == null) {
|
|
184 |
66
| return;
|
|
185 |
| } |
|
186 |
186
| final String context = getCurrentContext().getLocationWithinModule();
|
|
187 |
186
| visitor.visitEnter(imp);
|
|
188 |
160
| if (imp.getSpecification() != null) {
|
|
189 |
160
| setLocationWithinModule(context + ".getSpecification()");
|
|
190 |
160
| accept(imp.getSpecification());
|
|
191 |
| } |
|
192 |
82
| setLocationWithinModule(context);
|
|
193 |
82
| visitor.visitLeave(imp);
|
|
194 |
82
| setLocationWithinModule(context);
|
|
195 |
| } |
|
196 |
| |
|
197 |
29220
| public void accept(final Specification specification) throws ModuleDataException {
|
|
198 |
29220
| if (blocked || specification == null) {
|
|
199 |
28526
| return;
|
|
200 |
| } |
|
201 |
694
| final String context = getCurrentContext().getLocationWithinModule();
|
|
202 |
694
| visitor.visitEnter(specification);
|
|
203 |
594
| if (specification.getLocationList() != null) {
|
|
204 |
594
| setLocationWithinModule(context + ".getLocationList()");
|
|
205 |
594
| accept(specification.getLocationList());
|
|
206 |
| } |
|
207 |
466
| setLocationWithinModule(context);
|
|
208 |
466
| visitor.visitLeave(specification);
|
|
209 |
466
| setLocationWithinModule(context);
|
|
210 |
| } |
|
211 |
| |
|
212 |
594
| public void accept(final LocationList locationList) throws ModuleDataException {
|
|
213 |
594
| if (blocked || locationList == null) {
|
|
214 |
335
| return;
|
|
215 |
| } |
|
216 |
259
| final String context = getCurrentContext().getLocationWithinModule();
|
|
217 |
259
| visitor.visitEnter(locationList);
|
|
218 |
207
| for (int i = 0; i < locationList.size(); i++) {
|
|
219 |
207
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
220 |
207
| accept(locationList.get(i));
|
|
221 |
| } |
|
222 |
131
| setLocationWithinModule(context);
|
|
223 |
131
| visitor.visitLeave(locationList);
|
|
224 |
131
| setLocationWithinModule(context);
|
|
225 |
| } |
|
226 |
| |
|
227 |
207
| public void accept(final Location location) throws ModuleDataException {
|
|
228 |
207
| if (blocked || location == null) {
|
|
229 |
0
| return;
|
|
230 |
| } |
|
231 |
207
| final String context = getCurrentContext().getLocationWithinModule();
|
|
232 |
207
| visitor.visitEnter(location);
|
|
233 |
131
| setLocationWithinModule(context);
|
|
234 |
131
| visitor.visitLeave(location);
|
|
235 |
131
| setLocationWithinModule(context);
|
|
236 |
| } |
|
237 |
| |
|
238 |
28794
| public void accept(final AuthorList authorList) throws ModuleDataException {
|
|
239 |
28794
| if (blocked || authorList == null) {
|
|
240 |
28490
| return;
|
|
241 |
| } |
|
242 |
304
| final String context = getCurrentContext().getLocationWithinModule();
|
|
243 |
304
| visitor.visitEnter(authorList);
|
|
244 |
280
| for (int i = 0; i < authorList.size(); i++) {
|
|
245 |
280
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
246 |
280
| accept(authorList.get(i));
|
|
247 |
| } |
|
248 |
232
| setLocationWithinModule(context);
|
|
249 |
232
| visitor.visitLeave(authorList);
|
|
250 |
232
| setLocationWithinModule(context);
|
|
251 |
| } |
|
252 |
| |
|
253 |
280
| public void accept(final Author author) throws ModuleDataException {
|
|
254 |
280
| if (blocked || author == null) {
|
|
255 |
171
| return;
|
|
256 |
| } |
|
257 |
109
| final String context = getCurrentContext().getLocationWithinModule();
|
|
258 |
109
| visitor.visitEnter(author);
|
|
259 |
74
| if (author.getName() != null) {
|
|
260 |
74
| setLocationWithinModule(context + ".getName()");
|
|
261 |
74
| accept(author.getName());
|
|
262 |
| } |
|
263 |
61
| setLocationWithinModule(context);
|
|
264 |
61
| visitor.visitLeave(author);
|
|
265 |
61
| setLocationWithinModule(context);
|
|
266 |
| } |
|
267 |
| |
|
268 |
28551
| public void accept(final ChapterList chapterList) throws ModuleDataException {
|
|
269 |
28551
| if (blocked || chapterList == null) {
|
|
270 |
0
| return;
|
|
271 |
| } |
|
272 |
28551
| final String context = getCurrentContext().getLocationWithinModule();
|
|
273 |
28551
| visitor.visitEnter(chapterList);
|
|
274 |
28539
| for (int i = 0; i < chapterList.size(); i++) {
|
|
275 |
121145
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
276 |
121145
| accept(chapterList.get(i));
|
|
277 |
| } |
|
278 |
223
| setLocationWithinModule(context);
|
|
279 |
223
| visitor.visitLeave(chapterList);
|
|
280 |
223
| setLocationWithinModule(context);
|
|
281 |
| } |
|
282 |
| |
|
283 |
121145
| public void accept(final Chapter chapter) throws ModuleDataException {
|
|
284 |
121145
| if (blocked || chapter == null) {
|
|
285 |
1260
| return;
|
|
286 |
| } |
|
287 |
119885
| final String context = getCurrentContext().getLocationWithinModule();
|
|
288 |
119885
| visitor.visitEnter(chapter);
|
|
289 |
119743
| if (chapter.getTitle() != null) {
|
|
290 |
119743
| setLocationWithinModule(context + ".getTitle()");
|
|
291 |
119743
| accept(chapter.getTitle());
|
|
292 |
| } |
|
293 |
119497
| if (chapter.getIntroduction() != null) {
|
|
294 |
119492
| setLocationWithinModule(context + ".getIntroduction()");
|
|
295 |
119492
| accept(chapter.getIntroduction());
|
|
296 |
| } |
|
297 |
119261
| if (chapter.getSectionList() != null) {
|
|
298 |
60829
| setLocationWithinModule(context + ".getSectionList()");
|
|
299 |
60829
| accept(chapter.getSectionList());
|
|
300 |
| } |
|
301 |
91569
| setLocationWithinModule(context);
|
|
302 |
91569
| visitor.visitLeave(chapter);
|
|
303 |
91569
| setLocationWithinModule(context);
|
|
304 |
| } |
|
305 |
| |
|
306 |
192
| public void accept(final LiteratureItemList literatureItemList)
|
|
307 |
| throws ModuleDataException { |
|
308 |
192
| if (blocked || literatureItemList == null) {
|
|
309 |
0
| return;
|
|
310 |
| } |
|
311 |
192
| final String context = getCurrentContext().getLocationWithinModule();
|
|
312 |
192
| visitor.visitEnter(literatureItemList);
|
|
313 |
186
| for (int i = 0; i < literatureItemList.size(); i++) {
|
|
314 |
622
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
315 |
622
| accept(literatureItemList.get(i));
|
|
316 |
| } |
|
317 |
22
| setLocationWithinModule(context);
|
|
318 |
22
| visitor.visitLeave(literatureItemList);
|
|
319 |
22
| setLocationWithinModule(context);
|
|
320 |
| } |
|
321 |
| |
|
322 |
622
| public void accept(final LiteratureItem item) throws ModuleDataException {
|
|
323 |
622
| if (blocked || item == null) {
|
|
324 |
0
| return;
|
|
325 |
| } |
|
326 |
622
| final String context = getCurrentContext().getLocationWithinModule();
|
|
327 |
622
| visitor.visitEnter(item);
|
|
328 |
556
| if (item.getItem() != null) {
|
|
329 |
556
| setLocationWithinModule(context + ".getItem()");
|
|
330 |
556
| accept(item.getItem());
|
|
331 |
| } |
|
332 |
458
| setLocationWithinModule(context);
|
|
333 |
458
| visitor.visitLeave(item);
|
|
334 |
458
| setLocationWithinModule(context);
|
|
335 |
| } |
|
336 |
| |
|
337 |
60829
| public void accept(final SectionList sectionList) throws ModuleDataException {
|
|
338 |
60829
| if (blocked || sectionList == null) {
|
|
339 |
32966
| return;
|
|
340 |
| } |
|
341 |
27863
| final String context = getCurrentContext().getLocationWithinModule();
|
|
342 |
27863
| visitor.visitEnter(sectionList);
|
|
343 |
27788
| for (int i = 0; i < sectionList.size(); i++) {
|
|
344 |
69823
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
345 |
69823
| accept(sectionList.get(i));
|
|
346 |
| } |
|
347 |
171
| setLocationWithinModule(context);
|
|
348 |
171
| visitor.visitLeave(sectionList);
|
|
349 |
171
| setLocationWithinModule(context);
|
|
350 |
| } |
|
351 |
| |
|
352 |
69823
| public void accept(final Section section) throws ModuleDataException {
|
|
353 |
69823
| if (blocked || section == null) {
|
|
354 |
0
| return;
|
|
355 |
| } |
|
356 |
69823
| final String context = getCurrentContext().getLocationWithinModule();
|
|
357 |
69823
| visitor.visitEnter(section);
|
|
358 |
69590
| if (section.getTitle() != null) {
|
|
359 |
69590
| setLocationWithinModule(context + ".getTitle()");
|
|
360 |
69590
| accept(section.getTitle());
|
|
361 |
| } |
|
362 |
69110
| if (section.getIntroduction() != null) {
|
|
363 |
69105
| setLocationWithinModule(context + ".getIntroduction()");
|
|
364 |
69105
| accept(section.getIntroduction());
|
|
365 |
| } |
|
366 |
68678
| if (section.getSubsectionList() != null) {
|
|
367 |
57308
| setLocationWithinModule(context + ".getSubsectionList()");
|
|
368 |
57308
| accept(section.getSubsectionList());
|
|
369 |
| } |
|
370 |
42206
| setLocationWithinModule(context);
|
|
371 |
42206
| visitor.visitLeave(section);
|
|
372 |
42206
| setLocationWithinModule(context);
|
|
373 |
| } |
|
374 |
| |
|
375 |
57308
| public void accept(final SubsectionList subsectionList) throws ModuleDataException {
|
|
376 |
57308
| if (blocked || subsectionList == null) {
|
|
377 |
30574
| return;
|
|
378 |
| } |
|
379 |
26734
| final String context = getCurrentContext().getLocationWithinModule();
|
|
380 |
26734
| visitor.visitEnter(subsectionList);
|
|
381 |
26621
| for (int i = 0; i < subsectionList.size(); i++) {
|
|
382 |
139832
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
383 |
| |
|
384 |
139832
| if (subsectionList.get(i) instanceof Subsection) {
|
|
385 |
3574
| accept((Subsection) subsectionList.get(i));
|
|
386 |
136258
| } else if (subsectionList.get(i) instanceof Node) {
|
|
387 |
136258
| accept((Node) subsectionList.get(i));
|
|
388 |
0
| } else if (subsectionList.get(i) == null) {
|
|
389 |
| |
|
390 |
| } else { |
|
391 |
0
| throw new IllegalArgumentException("unexpected subsection type: "
|
|
392 |
| + subsectionList.get(i).getClass()); |
|
393 |
| } |
|
394 |
| } |
|
395 |
262
| setLocationWithinModule(context);
|
|
396 |
262
| visitor.visitLeave(subsectionList);
|
|
397 |
262
| setLocationWithinModule(context);
|
|
398 |
| } |
|
399 |
| |
|
400 |
3574
| public void accept(final Subsection subsection) throws ModuleDataException {
|
|
401 |
3574
| if (blocked || subsection == null) {
|
|
402 |
0
| return;
|
|
403 |
| } |
|
404 |
3574
| final String context = getCurrentContext().getLocationWithinModule();
|
|
405 |
3574
| visitor.visitEnter(subsection);
|
|
406 |
3480
| if (subsection.getTitle() != null) {
|
|
407 |
1614
| setLocationWithinModule(context + ".getTitle()");
|
|
408 |
1614
| accept(subsection.getTitle());
|
|
409 |
| } |
|
410 |
3360
| if (subsection.getLatex() != null) {
|
|
411 |
3360
| setLocationWithinModule(context + ".getLatex()");
|
|
412 |
3360
| accept(subsection.getLatex());
|
|
413 |
| } |
|
414 |
3210
| setLocationWithinModule(context);
|
|
415 |
3210
| visitor.visitLeave(subsection);
|
|
416 |
3210
| setLocationWithinModule(context);
|
|
417 |
| } |
|
418 |
| |
|
419 |
136258
| public void accept(final Node node) throws ModuleDataException {
|
|
420 |
136258
| if (blocked || node == null) {
|
|
421 |
0
| return;
|
|
422 |
| } |
|
423 |
136258
| final String context = getCurrentContext().getLocationWithinModule();
|
|
424 |
136258
| visitor.visitEnter(node);
|
|
425 |
135035
| if (node.getName() != null) {
|
|
426 |
66700
| setLocationWithinModule(context + ".getName()");
|
|
427 |
66700
| accept(node.getName());
|
|
428 |
| } |
|
429 |
134357
| if (node.getTitle() != null) {
|
|
430 |
66022
| setLocationWithinModule(context + ".getTitle()");
|
|
431 |
66022
| accept(node.getTitle());
|
|
432 |
| } |
|
433 |
133679
| if (node.getPrecedingText() != null) {
|
|
434 |
132652
| setLocationWithinModule(context + ".getPrecedingText()");
|
|
435 |
132652
| accept(node.getPrecedingText());
|
|
436 |
| } |
|
437 |
132299
| if (node.getNodeType() != null) {
|
|
438 |
132299
| setLocationWithinModule(context + ".getNodeType()");
|
|
439 |
132299
| if (node.getNodeType() instanceof Axiom) {
|
|
440 |
15883
| setLocationWithinModule(context + ".getNodeType().getAxiom()");
|
|
441 |
15883
| accept((Axiom) node.getNodeType());
|
|
442 |
116416
| } else if (node.getNodeType() instanceof PredicateDefinition) {
|
|
443 |
21453
| setLocationWithinModule(context + ".getNodeType().getPredicateDefinition()");
|
|
444 |
21453
| accept((PredicateDefinition) node.getNodeType());
|
|
445 |
94963
| } else if (node.getNodeType() instanceof FunctionDefinition) {
|
|
446 |
22266
| setLocationWithinModule(context + ".getNodeType().getFunctionDefinition()");
|
|
447 |
22266
| accept((FunctionDefinition) node.getNodeType());
|
|
448 |
72697
| } else if (node.getNodeType() instanceof Proposition) {
|
|
449 |
69689
| setLocationWithinModule(context + ".getNodeType().getProposition()");
|
|
450 |
69689
| accept((Proposition) node.getNodeType());
|
|
451 |
3008
| } else if (node.getNodeType() instanceof Rule) {
|
|
452 |
3008
| setLocationWithinModule(context + ".getNodeType().getRule()");
|
|
453 |
3008
| accept((Rule) node.getNodeType());
|
|
454 |
| } else { |
|
455 |
0
| throw new IllegalArgumentException("unexpected node type: "
|
|
456 |
| + node.getNodeType().getClass()); |
|
457 |
| } |
|
458 |
| } |
|
459 |
110539
| if (node.getSucceedingText() != null) {
|
|
460 |
27219
| setLocationWithinModule(context + ".getSucceedingText()");
|
|
461 |
27219
| accept(node.getSucceedingText());
|
|
462 |
| } |
|
463 |
110263
| setLocationWithinModule(context);
|
|
464 |
110263
| visitor.visitLeave(node);
|
|
465 |
110263
| setLocationWithinModule(context);
|
|
466 |
| } |
|
467 |
| |
|
468 |
15883
| public void accept(final Axiom axiom) throws ModuleDataException {
|
|
469 |
15883
| if (blocked || axiom == null) {
|
|
470 |
13515
| return;
|
|
471 |
| } |
|
472 |
2368
| final String context = getCurrentContext().getLocationWithinModule();
|
|
473 |
2368
| visitor.visitEnter(axiom);
|
|
474 |
2267
| if (axiom.getFormula() != null) {
|
|
475 |
2267
| setLocationWithinModule(context + ".getFormula()");
|
|
476 |
2267
| accept(axiom.getFormula());
|
|
477 |
| } |
|
478 |
285
| if (axiom.getDescription() != null) {
|
|
479 |
0
| setLocationWithinModule(context + ".getDescription()");
|
|
480 |
0
| accept(axiom.getDescription());
|
|
481 |
| } |
|
482 |
285
| setLocationWithinModule(context);
|
|
483 |
285
| visitor.visitLeave(axiom);
|
|
484 |
285
| setLocationWithinModule(context);
|
|
485 |
| } |
|
486 |
| |
|
487 |
21453
| public void accept(final PredicateDefinition definition)
|
|
488 |
| throws ModuleDataException { |
|
489 |
21453
| if (blocked || definition == null) {
|
|
490 |
19908
| return;
|
|
491 |
| } |
|
492 |
1545
| final String context = getCurrentContext().getLocationWithinModule();
|
|
493 |
1545
| visitor.visitEnter(definition);
|
|
494 |
1381
| if (definition.getVariableList() != null) {
|
|
495 |
1309
| setLocationWithinModule(context + ".getVariableList()");
|
|
496 |
1309
| accept(definition.getVariableList());
|
|
497 |
| } |
|
498 |
1111
| if (definition.getFormula() != null) {
|
|
499 |
1055
| setLocationWithinModule(context + ".getFormula()");
|
|
500 |
1055
| accept(definition.getFormula());
|
|
501 |
| } |
|
502 |
249
| if (definition.getDescription() != null) {
|
|
503 |
0
| setLocationWithinModule(context + ".getDescription()");
|
|
504 |
0
| accept(definition.getDescription());
|
|
505 |
| } |
|
506 |
249
| setLocationWithinModule(context);
|
|
507 |
249
| visitor.visitLeave(definition);
|
|
508 |
249
| setLocationWithinModule(context);
|
|
509 |
| } |
|
510 |
| |
|
511 |
22266
| public void accept(final FunctionDefinition definition) throws ModuleDataException {
|
|
512 |
22266
| if (blocked || definition == null) {
|
|
513 |
19980
| return;
|
|
514 |
| } |
|
515 |
2286
| final String context = getCurrentContext().getLocationWithinModule();
|
|
516 |
2286
| visitor.visitEnter(definition);
|
|
517 |
2094
| if (definition.getVariableList() != null) {
|
|
518 |
1860
| setLocationWithinModule(context + ".getVariableList()");
|
|
519 |
1860
| accept(definition.getVariableList());
|
|
520 |
| } |
|
521 |
1800
| if (definition.getTerm() != null) {
|
|
522 |
1800
| setLocationWithinModule(context + ".getTerm()");
|
|
523 |
1800
| accept(definition.getTerm());
|
|
524 |
| } |
|
525 |
266
| if (definition.getDescription() != null) {
|
|
526 |
0
| setLocationWithinModule(context + ".getDescription()");
|
|
527 |
0
| accept(definition.getDescription());
|
|
528 |
| } |
|
529 |
266
| setLocationWithinModule(context);
|
|
530 |
266
| visitor.visitLeave(definition);
|
|
531 |
266
| setLocationWithinModule(context);
|
|
532 |
| } |
|
533 |
| |
|
534 |
69689
| public void accept(final Proposition proposition) throws ModuleDataException {
|
|
535 |
69689
| if (blocked || proposition == null) {
|
|
536 |
52642
| return;
|
|
537 |
| } |
|
538 |
17047
| final String context = getCurrentContext().getLocationWithinModule();
|
|
539 |
17047
| visitor.visitEnter(proposition);
|
|
540 |
16719
| if (proposition.getFormula() != null) {
|
|
541 |
16719
| setLocationWithinModule(context + ".getFormula()");
|
|
542 |
16719
| accept(proposition.getFormula());
|
|
543 |
| } |
|
544 |
985
| if (proposition.getDescription() != null) {
|
|
545 |
74
| setLocationWithinModule(context + ".getDescription()");
|
|
546 |
74
| accept(proposition.getDescription());
|
|
547 |
| } |
|
548 |
971
| if (proposition.getProofList() != null) {
|
|
549 |
235
| setLocationWithinModule(context + ".getProofList()");
|
|
550 |
235
| accept(proposition.getProofList());
|
|
551 |
| } |
|
552 |
818
| setLocationWithinModule(context);
|
|
553 |
818
| visitor.visitLeave(proposition);
|
|
554 |
818
| setLocationWithinModule(context);
|
|
555 |
| } |
|
556 |
| |
|
557 |
3008
| public void accept(final Rule rule) throws ModuleDataException {
|
|
558 |
3008
| if (blocked || rule == null) {
|
|
559 |
2776
| return;
|
|
560 |
| } |
|
561 |
232
| final String context = getCurrentContext().getLocationWithinModule();
|
|
562 |
232
| visitor.visitEnter(rule);
|
|
563 |
182
| if (rule.getLinkList() != null) {
|
|
564 |
50
| setLocationWithinModule(context + ".getLinkList()");
|
|
565 |
50
| accept(rule.getLinkList());
|
|
566 |
| } |
|
567 |
174
| if (rule.getDescription() != null) {
|
|
568 |
174
| setLocationWithinModule(context + ".getDescription()");
|
|
569 |
174
| accept(rule.getDescription());
|
|
570 |
| } |
|
571 |
100
| if (rule.getProofList() != null) {
|
|
572 |
0
| setLocationWithinModule(context + ".getProofList()");
|
|
573 |
0
| accept(rule.getProofList());
|
|
574 |
| } |
|
575 |
100
| setLocationWithinModule(context);
|
|
576 |
100
| visitor.visitLeave(rule);
|
|
577 |
100
| setLocationWithinModule(context);
|
|
578 |
| } |
|
579 |
| |
|
580 |
50
| public void accept(final LinkList linkList) throws ModuleDataException {
|
|
581 |
50
| if (blocked || linkList == null) {
|
|
582 |
19
| return;
|
|
583 |
| } |
|
584 |
31
| final String context = getCurrentContext().getLocationWithinModule();
|
|
585 |
31
| visitor.visitEnter(linkList);
|
|
586 |
23
| setLocationWithinModule(context);
|
|
587 |
23
| visitor.visitLeave(linkList);
|
|
588 |
23
| setLocationWithinModule(context);
|
|
589 |
| } |
|
590 |
| |
|
591 |
3169
| public void accept(final VariableList variableList) throws ModuleDataException {
|
|
592 |
3169
| if (blocked || variableList == null) {
|
|
593 |
124
| return;
|
|
594 |
| } |
|
595 |
3045
| final String context = getCurrentContext().getLocationWithinModule();
|
|
596 |
3045
| visitor.visitEnter(variableList);
|
|
597 |
2901
| for (int i = 0; i < variableList.size(); i++) {
|
|
598 |
4012
| final String piece = context + ".get(" + i + ")";
|
|
599 |
4012
| setLocationWithinModule(piece);
|
|
600 |
4012
| if (variableList.get(i) != null) {
|
|
601 |
4012
| if (variableList.get(i).isList()) {
|
|
602 |
4012
| setLocationWithinModule(piece + ".getList()");
|
|
603 |
4012
| accept(variableList.get(i).getList());
|
|
604 |
0
| } else if (variableList.get(i).isAtom()) {
|
|
605 |
0
| setLocationWithinModule(piece + ".getAtom()");
|
|
606 |
0
| accept(variableList.get(i).getAtom());
|
|
607 |
| } else { |
|
608 |
0
| throw new IllegalArgumentException("unexpected element type: "
|
|
609 |
| + variableList.get(i).toString()); |
|
610 |
| } |
|
611 |
| } |
|
612 |
| } |
|
613 |
2481
| setLocationWithinModule(context);
|
|
614 |
2481
| visitor.visitLeave(variableList);
|
|
615 |
2481
| setLocationWithinModule(context);
|
|
616 |
| } |
|
617 |
| |
|
618 |
235
| public void accept(final ProofList proofList) throws ModuleDataException {
|
|
619 |
235
| if (blocked || proofList == null) {
|
|
620 |
39
| return;
|
|
621 |
| } |
|
622 |
196
| final String context = getCurrentContext().getLocationWithinModule();
|
|
623 |
196
| visitor.visitEnter(proofList);
|
|
624 |
168
| for (int i = 0; i < proofList.size(); i++) {
|
|
625 |
168
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
626 |
168
| accept(proofList.get(i));
|
|
627 |
| } |
|
628 |
43
| setLocationWithinModule(context);
|
|
629 |
43
| visitor.visitLeave(proofList);
|
|
630 |
43
| setLocationWithinModule(context);
|
|
631 |
| } |
|
632 |
| |
|
633 |
168
| public void accept(final Proof proof) throws ModuleDataException {
|
|
634 |
168
| if (blocked || proof == null) {
|
|
635 |
0
| return;
|
|
636 |
| } |
|
637 |
168
| final String context = getCurrentContext().getLocationWithinModule();
|
|
638 |
168
| visitor.visitEnter(proof);
|
|
639 |
110
| if (proof.getNonFormalProof() != null) {
|
|
640 |
110
| setLocationWithinModule(context + ".getNonFormalProof()");
|
|
641 |
110
| accept(proof.getNonFormalProof());
|
|
642 |
| } |
|
643 |
43
| setLocationWithinModule(context);
|
|
644 |
43
| visitor.visitLeave(proof);
|
|
645 |
43
| setLocationWithinModule(context);
|
|
646 |
| } |
|
647 |
| |
|
648 |
20041
| public void accept(final Formula formula) throws ModuleDataException {
|
|
649 |
20041
| if (blocked || formula == null) {
|
|
650 |
529
| return;
|
|
651 |
| } |
|
652 |
19512
| final String context = getCurrentContext().getLocationWithinModule();
|
|
653 |
19512
| visitor.visitEnter(formula);
|
|
654 |
19028
| if (formula.getElement() != null) {
|
|
655 |
19028
| setLocationWithinModule(context + ".getElement()");
|
|
656 |
19028
| accept(formula.getElement());
|
|
657 |
| } |
|
658 |
934
| setLocationWithinModule(context);
|
|
659 |
934
| visitor.visitLeave(formula);
|
|
660 |
934
| setLocationWithinModule(context);
|
|
661 |
| } |
|
662 |
| |
|
663 |
1800
| public void accept(final Term term) throws ModuleDataException {
|
|
664 |
1800
| if (blocked || term == null) {
|
|
665 |
80
| return;
|
|
666 |
| } |
|
667 |
1720
| final String context = getCurrentContext().getLocationWithinModule();
|
|
668 |
1720
| visitor.visitEnter(term);
|
|
669 |
1624
| if (term.getElement() != null) {
|
|
670 |
1624
| setLocationWithinModule(context + ".getElement()");
|
|
671 |
1624
| accept(term.getElement());
|
|
672 |
| } |
|
673 |
186
| setLocationWithinModule(context);
|
|
674 |
186
| visitor.visitLeave(term);
|
|
675 |
186
| setLocationWithinModule(context);
|
|
676 |
| } |
|
677 |
| |
|
678 |
397568
| public void accept(final Element element) throws ModuleDataException {
|
|
679 |
397568
| if (blocked || element == null) {
|
|
680 |
192653
| return;
|
|
681 |
| } |
|
682 |
204915
| final String context = getCurrentContext().getLocationWithinModule();
|
|
683 |
204915
| if (element.isList()) {
|
|
684 |
178133
| setLocationWithinModule(context + ".getList()");
|
|
685 |
178133
| accept(element.getList());
|
|
686 |
26782
| } else if (element.isAtom()) {
|
|
687 |
26782
| setLocationWithinModule(context + ".getAtom()");
|
|
688 |
26782
| accept(element.getAtom());
|
|
689 |
| } else { |
|
690 |
0
| throw new IllegalArgumentException("unexpected element type: "
|
|
691 |
| + element.toString()); |
|
692 |
| } |
|
693 |
133286
| setLocationWithinModule(context);
|
|
694 |
| } |
|
695 |
| |
|
696 |
26782
| public void accept(final Atom atom) throws ModuleDataException {
|
|
697 |
26782
| if (blocked || atom == null) {
|
|
698 |
0
| return;
|
|
699 |
| } |
|
700 |
26782
| final String context = getCurrentContext().getLocationWithinModule();
|
|
701 |
26782
| visitor.visitEnter(atom);
|
|
702 |
26782
| setLocationWithinModule(context);
|
|
703 |
26782
| visitor.visitLeave(atom);
|
|
704 |
26782
| setLocationWithinModule(context);
|
|
705 |
| } |
|
706 |
| |
|
707 |
182145
| public void accept(final ElementList list) throws ModuleDataException {
|
|
708 |
182145
| if (blocked || list == null) {
|
|
709 |
3154
| return;
|
|
710 |
| } |
|
711 |
178991
| final String context = getCurrentContext().getLocationWithinModule();
|
|
712 |
178991
| visitor.visitEnter(list);
|
|
713 |
159039
| for (int i = 0; i < list.size(); i++) {
|
|
714 |
376914
| setLocationWithinModule(context + ".getElement(" + i + ")");
|
|
715 |
376914
| accept(list.getElement(i));
|
|
716 |
| } |
|
717 |
106942
| setLocationWithinModule(context);
|
|
718 |
106942
| visitor.visitLeave(list);
|
|
719 |
106942
| setLocationWithinModule(context);
|
|
720 |
| } |
|
721 |
| |
|
722 |
734137
| public void accept(final LatexList latexList) throws ModuleDataException {
|
|
723 |
734137
| if (blocked || latexList == null) {
|
|
724 |
574455
| return;
|
|
725 |
| } |
|
726 |
159682
| final String context = getCurrentContext().getLocationWithinModule();
|
|
727 |
159682
| visitor.visitEnter(latexList);
|
|
728 |
157293
| for (int i = 0; i < latexList.size(); i++) {
|
|
729 |
307448
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
730 |
307448
| accept(latexList.get(i));
|
|
731 |
| } |
|
732 |
154661
| setLocationWithinModule(context);
|
|
733 |
154661
| visitor.visitLeave(latexList);
|
|
734 |
154661
| setLocationWithinModule(context);
|
|
735 |
| } |
|
736 |
| |
|
737 |
307522
| public void accept(final Latex latex) throws ModuleDataException {
|
|
738 |
307522
| if (blocked || latex == null) {
|
|
739 |
297381
| return;
|
|
740 |
| } |
|
741 |
10141
| final String context = getCurrentContext().getLocationWithinModule();
|
|
742 |
10141
| visitor.visitEnter(latex);
|
|
743 |
7496
| setLocationWithinModule(context);
|
|
744 |
7496
| visitor.visitLeave(latex);
|
|
745 |
7496
| setLocationWithinModule(context);
|
|
746 |
| } |
|
747 |
| |
|
748 |
| |
|
749 |
| |
|
750 |
| |
|
751 |
| |
|
752 |
| |
|
753 |
4762035
| public void setLocationWithinModule(final String locationWithinModule) {
|
|
754 |
4762035
| getCurrentContext().setLocationWithinModule(locationWithinModule);
|
|
755 |
| } |
|
756 |
| |
|
757 |
| |
|
758 |
| |
|
759 |
| |
|
760 |
| |
|
761 |
| |
|
762 |
9314953
| public final ModuleContext getCurrentContext() {
|
|
763 |
9314953
| return currentContext;
|
|
764 |
| } |
|
765 |
| |
|
766 |
| |
|
767 |
| |
|
768 |
| |
|
769 |
| |
|
770 |
| |
|
771 |
0
| public final boolean getBlocked() {
|
|
772 |
0
| return blocked;
|
|
773 |
| } |
|
774 |
| |
|
775 |
| |
|
776 |
| |
|
777 |
| |
|
778 |
| |
|
779 |
| |
|
780 |
1047076
| public final void setBlocked(final boolean blocked) {
|
|
781 |
1047076
| this.blocked = blocked;
|
|
782 |
| } |
|
783 |
| |
|
784 |
| } |
|
785 |
| |