|
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.ModuleAddress; |
|
56 |
| import org.qedeq.kernel.bo.module.ModuleContext; |
|
57 |
| import org.qedeq.kernel.bo.module.ModuleDataException; |
|
58 |
| |
|
59 |
| |
|
60 |
| |
|
61 |
| |
|
62 |
| |
|
63 |
| |
|
64 |
| |
|
65 |
| |
|
66 |
| |
|
67 |
| public class QedeqNotNullTraverser implements QedeqTraverser { |
|
68 |
| |
|
69 |
| |
|
70 |
| private ModuleContext currentContext; |
|
71 |
| |
|
72 |
| |
|
73 |
| |
|
74 |
| |
|
75 |
| |
|
76 |
| private QedeqVisitor visitor; |
|
77 |
| |
|
78 |
| |
|
79 |
| private boolean blocked; |
|
80 |
| |
|
81 |
| |
|
82 |
| |
|
83 |
| |
|
84 |
| |
|
85 |
| |
|
86 |
| |
|
87 |
32493
| public QedeqNotNullTraverser(final ModuleAddress globalContext, final QedeqVisitor visitor) {
|
|
88 |
32493
| currentContext = globalContext.createModuleContext();
|
|
89 |
32493
| this.visitor = visitor;
|
|
90 |
| } |
|
91 |
| |
|
92 |
32491
| public void accept(final Qedeq qedeq) throws ModuleDataException {
|
|
93 |
32491
| getCurrentContext().setLocationWithinModule("");
|
|
94 |
32491
| blocked = false;
|
|
95 |
32491
| if (qedeq == null) {
|
|
96 |
0
| throw new NullPointerException("null QEDEQ module");
|
|
97 |
| } |
|
98 |
32491
| final String context = getCurrentContext().getLocationWithinModule();
|
|
99 |
32491
| visitor.visitEnter(qedeq);
|
|
100 |
32489
| if (qedeq.getHeader() != null) {
|
|
101 |
32489
| getCurrentContext().setLocationWithinModule(context + "getHeader()");
|
|
102 |
32489
| accept(qedeq.getHeader());
|
|
103 |
| } |
|
104 |
32035
| if (qedeq.getChapterList() != null) {
|
|
105 |
32035
| getCurrentContext().setLocationWithinModule(context + "getChapterList()");
|
|
106 |
32035
| accept(qedeq.getChapterList());
|
|
107 |
| } |
|
108 |
614
| if (qedeq.getLiteratureItemList() != null) {
|
|
109 |
241
| getCurrentContext().setLocationWithinModule(context + "getLiteratureItemList()");
|
|
110 |
241
| accept(qedeq.getLiteratureItemList());
|
|
111 |
| } |
|
112 |
444
| setLocationWithinModule(context);
|
|
113 |
444
| visitor.visitLeave(qedeq);
|
|
114 |
444
| setLocationWithinModule(context);
|
|
115 |
| } |
|
116 |
| |
|
117 |
32489
| public void accept(final Header header) throws ModuleDataException {
|
|
118 |
32489
| if (blocked || header == null) {
|
|
119 |
0
| return;
|
|
120 |
| } |
|
121 |
32489
| final String context = getCurrentContext().getLocationWithinModule();
|
|
122 |
32489
| visitor.visitEnter(header);
|
|
123 |
32465
| if (header.getSpecification() != null) {
|
|
124 |
32465
| setLocationWithinModule(context + ".getSpecification()");
|
|
125 |
32465
| accept(header.getSpecification());
|
|
126 |
| } |
|
127 |
32360
| if (header.getTitle() != null) {
|
|
128 |
32360
| setLocationWithinModule(context + ".getTitle()");
|
|
129 |
32360
| accept(header.getTitle());
|
|
130 |
| } |
|
131 |
32314
| if (header.getSummary() != null) {
|
|
132 |
32314
| setLocationWithinModule(context + ".getSummary()");
|
|
133 |
32314
| accept(header.getSummary());
|
|
134 |
| } |
|
135 |
32268
| if (header.getAuthorList() != null) {
|
|
136 |
32268
| setLocationWithinModule(context + ".getAuthorList()");
|
|
137 |
32268
| accept(header.getAuthorList());
|
|
138 |
| } |
|
139 |
32196
| if (header.getImportList() != null) {
|
|
140 |
24209
| setLocationWithinModule(context + ".getImportList()");
|
|
141 |
24209
| accept(header.getImportList());
|
|
142 |
| } |
|
143 |
32090
| if (header.getUsedByList() != null) {
|
|
144 |
7915
| setLocationWithinModule(context + ".getUsedByList()");
|
|
145 |
7915
| accept(header.getUsedByList());
|
|
146 |
| } |
|
147 |
32035
| setLocationWithinModule(context);
|
|
148 |
32035
| visitor.visitLeave(header);
|
|
149 |
32035
| setLocationWithinModule(context);
|
|
150 |
| } |
|
151 |
| |
|
152 |
7915
| public void accept(final UsedByList usedByList) throws ModuleDataException {
|
|
153 |
7915
| if (blocked || usedByList == null) {
|
|
154 |
7758
| return;
|
|
155 |
| } |
|
156 |
157
| final String context = getCurrentContext().getLocationWithinModule();
|
|
157 |
157
| visitor.visitEnter(usedByList);
|
|
158 |
147
| for (int i = 0; i < usedByList.size(); i++) {
|
|
159 |
147
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
160 |
147
| accept(usedByList.get(i));
|
|
161 |
| } |
|
162 |
102
| setLocationWithinModule(context);
|
|
163 |
102
| visitor.visitLeave(usedByList);
|
|
164 |
102
| setLocationWithinModule(context);
|
|
165 |
| } |
|
166 |
| |
|
167 |
24209
| public void accept(final ImportList importList) throws ModuleDataException {
|
|
168 |
24209
| if (blocked || importList == null) {
|
|
169 |
23782
| return;
|
|
170 |
| } |
|
171 |
427
| final String context = getCurrentContext().getLocationWithinModule();
|
|
172 |
427
| visitor.visitEnter(importList);
|
|
173 |
415
| for (int i = 0; i < importList.size(); i++) {
|
|
174 |
545
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
175 |
545
| accept(importList.get(i));
|
|
176 |
| } |
|
177 |
321
| setLocationWithinModule(context);
|
|
178 |
321
| visitor.visitLeave(importList);
|
|
179 |
321
| setLocationWithinModule(context);
|
|
180 |
| } |
|
181 |
| |
|
182 |
545
| public void accept(final Import imp) throws ModuleDataException {
|
|
183 |
545
| if (blocked || imp == null) {
|
|
184 |
44
| return;
|
|
185 |
| } |
|
186 |
501
| final String context = getCurrentContext().getLocationWithinModule();
|
|
187 |
501
| visitor.visitEnter(imp);
|
|
188 |
481
| if (imp.getSpecification() != null) {
|
|
189 |
481
| setLocationWithinModule(context + ".getSpecification()");
|
|
190 |
481
| accept(imp.getSpecification());
|
|
191 |
| } |
|
192 |
407
| setLocationWithinModule(context);
|
|
193 |
407
| visitor.visitLeave(imp);
|
|
194 |
407
| setLocationWithinModule(context);
|
|
195 |
| } |
|
196 |
| |
|
197 |
33093
| public void accept(final Specification specification) throws ModuleDataException {
|
|
198 |
33093
| if (blocked || specification == null) {
|
|
199 |
31581
| return;
|
|
200 |
| } |
|
201 |
1512
| final String context = getCurrentContext().getLocationWithinModule();
|
|
202 |
1512
| visitor.visitEnter(specification);
|
|
203 |
1420
| if (specification.getLocationList() != null) {
|
|
204 |
1420
| setLocationWithinModule(context + ".getLocationList()");
|
|
205 |
1420
| accept(specification.getLocationList());
|
|
206 |
| } |
|
207 |
1288
| setLocationWithinModule(context);
|
|
208 |
1288
| visitor.visitLeave(specification);
|
|
209 |
1288
| setLocationWithinModule(context);
|
|
210 |
| } |
|
211 |
| |
|
212 |
1420
| public void accept(final LocationList locationList) throws ModuleDataException {
|
|
213 |
1420
| if (blocked || locationList == null) {
|
|
214 |
325
| return;
|
|
215 |
| } |
|
216 |
1095
| final String context = getCurrentContext().getLocationWithinModule();
|
|
217 |
1095
| visitor.visitEnter(locationList);
|
|
218 |
1047
| for (int i = 0; i < locationList.size(); i++) {
|
|
219 |
1228
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
220 |
1228
| accept(locationList.get(i));
|
|
221 |
| } |
|
222 |
963
| setLocationWithinModule(context);
|
|
223 |
963
| visitor.visitLeave(locationList);
|
|
224 |
963
| setLocationWithinModule(context);
|
|
225 |
| } |
|
226 |
| |
|
227 |
1228
| public void accept(final Location location) throws ModuleDataException {
|
|
228 |
1228
| if (blocked || location == null) {
|
|
229 |
0
| return;
|
|
230 |
| } |
|
231 |
1228
| final String context = getCurrentContext().getLocationWithinModule();
|
|
232 |
1228
| visitor.visitEnter(location);
|
|
233 |
1144
| setLocationWithinModule(context);
|
|
234 |
1144
| visitor.visitLeave(location);
|
|
235 |
1144
| setLocationWithinModule(context);
|
|
236 |
| } |
|
237 |
| |
|
238 |
32268
| public void accept(final AuthorList authorList) throws ModuleDataException {
|
|
239 |
32268
| if (blocked || authorList == null) {
|
|
240 |
31569
| return;
|
|
241 |
| } |
|
242 |
699
| final String context = getCurrentContext().getLocationWithinModule();
|
|
243 |
699
| visitor.visitEnter(authorList);
|
|
244 |
675
| for (int i = 0; i < authorList.size(); i++) {
|
|
245 |
675
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
246 |
675
| accept(authorList.get(i));
|
|
247 |
| } |
|
248 |
627
| setLocationWithinModule(context);
|
|
249 |
627
| visitor.visitLeave(authorList);
|
|
250 |
627
| setLocationWithinModule(context);
|
|
251 |
| } |
|
252 |
| |
|
253 |
675
| public void accept(final Author author) throws ModuleDataException {
|
|
254 |
675
| if (blocked || author == null) {
|
|
255 |
161
| return;
|
|
256 |
| } |
|
257 |
514
| final String context = getCurrentContext().getLocationWithinModule();
|
|
258 |
514
| visitor.visitEnter(author);
|
|
259 |
479
| if (author.getName() != null) {
|
|
260 |
479
| setLocationWithinModule(context + ".getName()");
|
|
261 |
479
| accept(author.getName());
|
|
262 |
| } |
|
263 |
466
| setLocationWithinModule(context);
|
|
264 |
466
| visitor.visitLeave(author);
|
|
265 |
466
| setLocationWithinModule(context);
|
|
266 |
| } |
|
267 |
| |
|
268 |
32035
| public void accept(final ChapterList chapterList) throws ModuleDataException {
|
|
269 |
32035
| if (blocked || chapterList == null) {
|
|
270 |
40
| return;
|
|
271 |
| } |
|
272 |
31995
| final String context = getCurrentContext().getLocationWithinModule();
|
|
273 |
31995
| visitor.visitEnter(chapterList);
|
|
274 |
31983
| for (int i = 0; i < chapterList.size(); i++) {
|
|
275 |
141567
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
276 |
141567
| accept(chapterList.get(i));
|
|
277 |
| } |
|
278 |
574
| setLocationWithinModule(context);
|
|
279 |
574
| visitor.visitLeave(chapterList);
|
|
280 |
574
| setLocationWithinModule(context);
|
|
281 |
| } |
|
282 |
| |
|
283 |
141567
| public void accept(final Chapter chapter) throws ModuleDataException {
|
|
284 |
141567
| if (blocked || chapter == null) {
|
|
285 |
1260
| return;
|
|
286 |
| } |
|
287 |
140307
| final String context = getCurrentContext().getLocationWithinModule();
|
|
288 |
140307
| visitor.visitEnter(chapter);
|
|
289 |
140165
| if (chapter.getTitle() != null) {
|
|
290 |
140165
| setLocationWithinModule(context + ".getTitle()");
|
|
291 |
140165
| accept(chapter.getTitle());
|
|
292 |
| } |
|
293 |
139919
| if (chapter.getIntroduction() != null) {
|
|
294 |
139696
| setLocationWithinModule(context + ".getIntroduction()");
|
|
295 |
139696
| accept(chapter.getIntroduction());
|
|
296 |
| } |
|
297 |
139681
| if (chapter.getSectionList() != null) {
|
|
298 |
71657
| setLocationWithinModule(context + ".getSectionList()");
|
|
299 |
71657
| accept(chapter.getSectionList());
|
|
300 |
| } |
|
301 |
108898
| setLocationWithinModule(context);
|
|
302 |
108898
| visitor.visitLeave(chapter);
|
|
303 |
108898
| setLocationWithinModule(context);
|
|
304 |
| } |
|
305 |
| |
|
306 |
241
| public void accept(final LiteratureItemList literatureItemList)
|
|
307 |
| throws ModuleDataException { |
|
308 |
241
| if (blocked || literatureItemList == null) {
|
|
309 |
5
| return;
|
|
310 |
| } |
|
311 |
236
| final String context = getCurrentContext().getLocationWithinModule();
|
|
312 |
236
| visitor.visitEnter(literatureItemList);
|
|
313 |
230
| for (int i = 0; i < literatureItemList.size(); i++) {
|
|
314 |
874
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
315 |
874
| accept(literatureItemList.get(i));
|
|
316 |
| } |
|
317 |
66
| setLocationWithinModule(context);
|
|
318 |
66
| visitor.visitLeave(literatureItemList);
|
|
319 |
66
| setLocationWithinModule(context);
|
|
320 |
| } |
|
321 |
| |
|
322 |
874
| public void accept(final LiteratureItem item) throws ModuleDataException {
|
|
323 |
874
| if (blocked || item == null) {
|
|
324 |
0
| return;
|
|
325 |
| } |
|
326 |
874
| final String context = getCurrentContext().getLocationWithinModule();
|
|
327 |
874
| visitor.visitEnter(item);
|
|
328 |
808
| if (item.getItem() != null) {
|
|
329 |
808
| setLocationWithinModule(context + ".getItem()");
|
|
330 |
808
| accept(item.getItem());
|
|
331 |
| } |
|
332 |
710
| setLocationWithinModule(context);
|
|
333 |
710
| visitor.visitLeave(item);
|
|
334 |
710
| setLocationWithinModule(context);
|
|
335 |
| } |
|
336 |
| |
|
337 |
71657
| public void accept(final SectionList sectionList) throws ModuleDataException {
|
|
338 |
71657
| if (blocked || sectionList == null) {
|
|
339 |
40306
| return;
|
|
340 |
| } |
|
341 |
31351
| final String context = getCurrentContext().getLocationWithinModule();
|
|
342 |
31351
| visitor.visitEnter(sectionList);
|
|
343 |
31276
| for (int i = 0; i < sectionList.size(); i++) {
|
|
344 |
76412
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
345 |
76412
| accept(sectionList.get(i));
|
|
346 |
| } |
|
347 |
568
| setLocationWithinModule(context);
|
|
348 |
568
| visitor.visitLeave(sectionList);
|
|
349 |
568
| setLocationWithinModule(context);
|
|
350 |
| } |
|
351 |
| |
|
352 |
76412
| public void accept(final Section section) throws ModuleDataException {
|
|
353 |
76412
| if (blocked || section == null) {
|
|
354 |
0
| return;
|
|
355 |
| } |
|
356 |
76412
| final String context = getCurrentContext().getLocationWithinModule();
|
|
357 |
76412
| visitor.visitEnter(section);
|
|
358 |
76179
| if (section.getTitle() != null) {
|
|
359 |
76179
| setLocationWithinModule(context + ".getTitle()");
|
|
360 |
76179
| accept(section.getTitle());
|
|
361 |
| } |
|
362 |
75699
| if (section.getIntroduction() != null) {
|
|
363 |
75658
| setLocationWithinModule(context + ".getIntroduction()");
|
|
364 |
75658
| accept(section.getIntroduction());
|
|
365 |
| } |
|
366 |
75259
| if (section.getSubsectionList() != null) {
|
|
367 |
63549
| setLocationWithinModule(context + ".getSubsectionList()");
|
|
368 |
63549
| accept(section.getSubsectionList());
|
|
369 |
| } |
|
370 |
45704
| setLocationWithinModule(context);
|
|
371 |
45704
| visitor.visitLeave(section);
|
|
372 |
45704
| setLocationWithinModule(context);
|
|
373 |
| } |
|
374 |
| |
|
375 |
63549
| public void accept(final SubsectionList subsectionList) throws ModuleDataException {
|
|
376 |
63549
| if (blocked || subsectionList == null) {
|
|
377 |
33148
| return;
|
|
378 |
| } |
|
379 |
30401
| final String context = getCurrentContext().getLocationWithinModule();
|
|
380 |
30401
| visitor.visitEnter(subsectionList);
|
|
381 |
30272
| for (int i = 0; i < subsectionList.size(); i++) {
|
|
382 |
150080
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
383 |
| |
|
384 |
150080
| if (subsectionList.get(i) instanceof Subsection) {
|
|
385 |
4369
| accept((Subsection) subsectionList.get(i));
|
|
386 |
145711
| } else if (subsectionList.get(i) instanceof Node) {
|
|
387 |
145711
| 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 |
846
| setLocationWithinModule(context);
|
|
396 |
846
| visitor.visitLeave(subsectionList);
|
|
397 |
846
| setLocationWithinModule(context);
|
|
398 |
| } |
|
399 |
| |
|
400 |
4369
| public void accept(final Subsection subsection) throws ModuleDataException {
|
|
401 |
4369
| if (blocked || subsection == null) {
|
|
402 |
0
| return;
|
|
403 |
| } |
|
404 |
4369
| final String context = getCurrentContext().getLocationWithinModule();
|
|
405 |
4369
| visitor.visitEnter(subsection);
|
|
406 |
4267
| if (subsection.getTitle() != null) {
|
|
407 |
2024
| setLocationWithinModule(context + ".getTitle()");
|
|
408 |
2024
| accept(subsection.getTitle());
|
|
409 |
| } |
|
410 |
4147
| if (subsection.getLatex() != null) {
|
|
411 |
4147
| setLocationWithinModule(context + ".getLatex()");
|
|
412 |
4147
| accept(subsection.getLatex());
|
|
413 |
| } |
|
414 |
3981
| setLocationWithinModule(context);
|
|
415 |
3981
| visitor.visitLeave(subsection);
|
|
416 |
3981
| setLocationWithinModule(context);
|
|
417 |
| } |
|
418 |
| |
|
419 |
145711
| public void accept(final Node node) throws ModuleDataException {
|
|
420 |
145711
| if (blocked || node == null) {
|
|
421 |
0
| return;
|
|
422 |
| } |
|
423 |
145711
| final String context = getCurrentContext().getLocationWithinModule();
|
|
424 |
145711
| visitor.visitEnter(node);
|
|
425 |
144344
| if (node.getName() != null) {
|
|
426 |
74860
| setLocationWithinModule(context + ".getName()");
|
|
427 |
74860
| accept(node.getName());
|
|
428 |
| } |
|
429 |
143546
| if (node.getTitle() != null) {
|
|
430 |
74062
| setLocationWithinModule(context + ".getTitle()");
|
|
431 |
74062
| accept(node.getTitle());
|
|
432 |
| } |
|
433 |
142748
| if (node.getPrecedingText() != null) {
|
|
434 |
138877
| setLocationWithinModule(context + ".getPrecedingText()");
|
|
435 |
138877
| accept(node.getPrecedingText());
|
|
436 |
| } |
|
437 |
141312
| if (node.getNodeType() != null) {
|
|
438 |
141312
| setLocationWithinModule(context + ".getNodeType()");
|
|
439 |
141312
| if (node.getNodeType() instanceof Axiom) {
|
|
440 |
18128
| setLocationWithinModule(context + ".getNodeType().getAxiom()");
|
|
441 |
18128
| accept((Axiom) node.getNodeType());
|
|
442 |
123184
| } else if (node.getNodeType() instanceof PredicateDefinition) {
|
|
443 |
24300
| setLocationWithinModule(context + ".getNodeType().getPredicateDefinition()");
|
|
444 |
24300
| accept((PredicateDefinition) node.getNodeType());
|
|
445 |
98884
| } else if (node.getNodeType() instanceof FunctionDefinition) {
|
|
446 |
22490
| setLocationWithinModule(context + ".getNodeType().getFunctionDefinition()");
|
|
447 |
22490
| accept((FunctionDefinition) node.getNodeType());
|
|
448 |
76394
| } else if (node.getNodeType() instanceof Proposition) {
|
|
449 |
72490
| setLocationWithinModule(context + ".getNodeType().getProposition()");
|
|
450 |
72490
| accept((Proposition) node.getNodeType());
|
|
451 |
3904
| } else if (node.getNodeType() instanceof Rule) {
|
|
452 |
3904
| setLocationWithinModule(context + ".getNodeType().getRule()");
|
|
453 |
3904
| accept((Rule) node.getNodeType());
|
|
454 |
| } else { |
|
455 |
0
| throw new IllegalArgumentException("unexpected node type: "
|
|
456 |
| + node.getNodeType().getClass()); |
|
457 |
| } |
|
458 |
| } |
|
459 |
116957
| if (node.getSucceedingText() != null) {
|
|
460 |
27750
| setLocationWithinModule(context + ".getSucceedingText()");
|
|
461 |
27750
| accept(node.getSucceedingText());
|
|
462 |
| } |
|
463 |
116673
| setLocationWithinModule(context);
|
|
464 |
116673
| visitor.visitLeave(node);
|
|
465 |
116673
| setLocationWithinModule(context);
|
|
466 |
| } |
|
467 |
| |
|
468 |
18128
| public void accept(final Axiom axiom) throws ModuleDataException {
|
|
469 |
18128
| if (blocked || axiom == null) {
|
|
470 |
14915
| return;
|
|
471 |
| } |
|
472 |
3213
| final String context = getCurrentContext().getLocationWithinModule();
|
|
473 |
3213
| visitor.visitEnter(axiom);
|
|
474 |
3088
| if (axiom.getFormula() != null) {
|
|
475 |
3088
| setLocationWithinModule(context + ".getFormula()");
|
|
476 |
3088
| accept(axiom.getFormula());
|
|
477 |
| } |
|
478 |
839
| if (axiom.getDescription() != null) {
|
|
479 |
0
| setLocationWithinModule(context + ".getDescription()");
|
|
480 |
0
| accept(axiom.getDescription());
|
|
481 |
| } |
|
482 |
839
| setLocationWithinModule(context);
|
|
483 |
839
| visitor.visitLeave(axiom);
|
|
484 |
839
| setLocationWithinModule(context);
|
|
485 |
| } |
|
486 |
| |
|
487 |
24300
| public void accept(final PredicateDefinition definition)
|
|
488 |
| throws ModuleDataException { |
|
489 |
24300
| if (blocked || definition == null) {
|
|
490 |
21745
| return;
|
|
491 |
| } |
|
492 |
2555
| final String context = getCurrentContext().getLocationWithinModule();
|
|
493 |
2555
| visitor.visitEnter(definition);
|
|
494 |
2341
| if (definition.getVariableList() != null) {
|
|
495 |
2209
| setLocationWithinModule(context + ".getVariableList()");
|
|
496 |
2209
| accept(definition.getVariableList());
|
|
497 |
| } |
|
498 |
1947
| if (definition.getFormula() != null) {
|
|
499 |
1782
| setLocationWithinModule(context + ".getFormula()");
|
|
500 |
1782
| accept(definition.getFormula());
|
|
501 |
| } |
|
502 |
789
| if (definition.getDescription() != null) {
|
|
503 |
0
| setLocationWithinModule(context + ".getDescription()");
|
|
504 |
0
| accept(definition.getDescription());
|
|
505 |
| } |
|
506 |
789
| setLocationWithinModule(context);
|
|
507 |
789
| visitor.visitLeave(definition);
|
|
508 |
789
| setLocationWithinModule(context);
|
|
509 |
| } |
|
510 |
| |
|
511 |
22490
| public void accept(final FunctionDefinition definition) throws ModuleDataException {
|
|
512 |
22490
| if (blocked || definition == null) {
|
|
513 |
19980
| return;
|
|
514 |
| } |
|
515 |
2510
| final String context = getCurrentContext().getLocationWithinModule();
|
|
516 |
2510
| visitor.visitEnter(definition);
|
|
517 |
2318
| if (definition.getVariableList() != null) {
|
|
518 |
2042
| setLocationWithinModule(context + ".getVariableList()");
|
|
519 |
2042
| accept(definition.getVariableList());
|
|
520 |
| } |
|
521 |
2024
| if (definition.getTerm() != null) {
|
|
522 |
2024
| setLocationWithinModule(context + ".getTerm()");
|
|
523 |
2024
| accept(definition.getTerm());
|
|
524 |
| } |
|
525 |
490
| if (definition.getDescription() != null) {
|
|
526 |
0
| setLocationWithinModule(context + ".getDescription()");
|
|
527 |
0
| accept(definition.getDescription());
|
|
528 |
| } |
|
529 |
490
| setLocationWithinModule(context);
|
|
530 |
490
| visitor.visitLeave(definition);
|
|
531 |
490
| setLocationWithinModule(context);
|
|
532 |
| } |
|
533 |
| |
|
534 |
72490
| public void accept(final Proposition proposition) throws ModuleDataException {
|
|
535 |
72490
| if (blocked || proposition == null) {
|
|
536 |
52732
| return;
|
|
537 |
| } |
|
538 |
19758
| final String context = getCurrentContext().getLocationWithinModule();
|
|
539 |
19758
| visitor.visitEnter(proposition);
|
|
540 |
19412
| if (proposition.getFormula() != null) {
|
|
541 |
19412
| setLocationWithinModule(context + ".getFormula()");
|
|
542 |
19412
| accept(proposition.getFormula());
|
|
543 |
| } |
|
544 |
1932
| if (proposition.getDescription() != null) {
|
|
545 |
88
| setLocationWithinModule(context + ".getDescription()");
|
|
546 |
88
| accept(proposition.getDescription());
|
|
547 |
| } |
|
548 |
1918
| if (proposition.getProofList() != null) {
|
|
549 |
330
| setLocationWithinModule(context + ".getProofList()");
|
|
550 |
330
| accept(proposition.getProofList());
|
|
551 |
| } |
|
552 |
1765
| setLocationWithinModule(context);
|
|
553 |
1765
| visitor.visitLeave(proposition);
|
|
554 |
1765
| setLocationWithinModule(context);
|
|
555 |
| } |
|
556 |
| |
|
557 |
3904
| public void accept(final Rule rule) throws ModuleDataException {
|
|
558 |
3904
| if (blocked || rule == null) {
|
|
559 |
3180
| return;
|
|
560 |
| } |
|
561 |
724
| final String context = getCurrentContext().getLocationWithinModule();
|
|
562 |
724
| visitor.visitEnter(rule);
|
|
563 |
644
| if (rule.getLinkList() != null) {
|
|
564 |
64
| setLocationWithinModule(context + ".getLinkList()");
|
|
565 |
64
| accept(rule.getLinkList());
|
|
566 |
| } |
|
567 |
636
| if (rule.getDescription() != null) {
|
|
568 |
636
| setLocationWithinModule(context + ".getDescription()");
|
|
569 |
636
| accept(rule.getDescription());
|
|
570 |
| } |
|
571 |
522
| if (rule.getProofList() != null) {
|
|
572 |
0
| setLocationWithinModule(context + ".getProofList()");
|
|
573 |
0
| accept(rule.getProofList());
|
|
574 |
| } |
|
575 |
522
| setLocationWithinModule(context);
|
|
576 |
522
| visitor.visitLeave(rule);
|
|
577 |
522
| setLocationWithinModule(context);
|
|
578 |
| } |
|
579 |
| |
|
580 |
64
| public void accept(final LinkList linkList) throws ModuleDataException {
|
|
581 |
64
| if (blocked || linkList == null) {
|
|
582 |
20
| return;
|
|
583 |
| } |
|
584 |
44
| final String context = getCurrentContext().getLocationWithinModule();
|
|
585 |
44
| visitor.visitEnter(linkList);
|
|
586 |
36
| setLocationWithinModule(context);
|
|
587 |
36
| visitor.visitLeave(linkList);
|
|
588 |
36
| setLocationWithinModule(context);
|
|
589 |
| } |
|
590 |
| |
|
591 |
4251
| public void accept(final VariableList variableList) throws ModuleDataException {
|
|
592 |
4251
| if (blocked || variableList == null) {
|
|
593 |
224
| return;
|
|
594 |
| } |
|
595 |
4027
| final String context = getCurrentContext().getLocationWithinModule();
|
|
596 |
4027
| visitor.visitEnter(variableList);
|
|
597 |
3863
| for (int i = 0; i < variableList.size(); i++) {
|
|
598 |
6071
| final String piece = context + ".get(" + i + ")";
|
|
599 |
6071
| setLocationWithinModule(piece);
|
|
600 |
6071
| if (variableList.get(i) != null) {
|
|
601 |
6071
| if (variableList.get(i).isList()) {
|
|
602 |
6071
| setLocationWithinModule(piece + ".getList()");
|
|
603 |
6071
| 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 |
3339
| setLocationWithinModule(context);
|
|
614 |
3339
| visitor.visitLeave(variableList);
|
|
615 |
3339
| setLocationWithinModule(context);
|
|
616 |
| } |
|
617 |
| |
|
618 |
330
| public void accept(final ProofList proofList) throws ModuleDataException {
|
|
619 |
330
| if (blocked || proofList == null) {
|
|
620 |
42
| return;
|
|
621 |
| } |
|
622 |
288
| final String context = getCurrentContext().getLocationWithinModule();
|
|
623 |
288
| visitor.visitEnter(proofList);
|
|
624 |
260
| for (int i = 0; i < proofList.size(); i++) {
|
|
625 |
260
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
626 |
260
| accept(proofList.get(i));
|
|
627 |
| } |
|
628 |
135
| setLocationWithinModule(context);
|
|
629 |
135
| visitor.visitLeave(proofList);
|
|
630 |
135
| setLocationWithinModule(context);
|
|
631 |
| } |
|
632 |
| |
|
633 |
260
| public void accept(final Proof proof) throws ModuleDataException {
|
|
634 |
260
| if (blocked || proof == null) {
|
|
635 |
0
| return;
|
|
636 |
| } |
|
637 |
260
| final String context = getCurrentContext().getLocationWithinModule();
|
|
638 |
260
| visitor.visitEnter(proof);
|
|
639 |
202
| if (proof.getNonFormalProof() != null) {
|
|
640 |
202
| setLocationWithinModule(context + ".getNonFormalProof()");
|
|
641 |
202
| accept(proof.getNonFormalProof());
|
|
642 |
| } |
|
643 |
135
| setLocationWithinModule(context);
|
|
644 |
135
| visitor.visitLeave(proof);
|
|
645 |
135
| setLocationWithinModule(context);
|
|
646 |
| } |
|
647 |
| |
|
648 |
24282
| public void accept(final Formula formula) throws ModuleDataException {
|
|
649 |
24282
| if (blocked || formula == null) {
|
|
650 |
787
| return;
|
|
651 |
| } |
|
652 |
23495
| final String context = getCurrentContext().getLocationWithinModule();
|
|
653 |
23495
| visitor.visitEnter(formula);
|
|
654 |
22967
| if (formula.getElement() != null) {
|
|
655 |
22967
| setLocationWithinModule(context + ".getElement()");
|
|
656 |
22967
| accept(formula.getElement());
|
|
657 |
| } |
|
658 |
2608
| setLocationWithinModule(context);
|
|
659 |
2608
| visitor.visitLeave(formula);
|
|
660 |
2608
| setLocationWithinModule(context);
|
|
661 |
| } |
|
662 |
| |
|
663 |
2024
| public void accept(final Term term) throws ModuleDataException {
|
|
664 |
2024
| if (blocked || term == null) {
|
|
665 |
96
| return;
|
|
666 |
| } |
|
667 |
1928
| final String context = getCurrentContext().getLocationWithinModule();
|
|
668 |
1928
| visitor.visitEnter(term);
|
|
669 |
1832
| if (term.getElement() != null) {
|
|
670 |
1832
| setLocationWithinModule(context + ".getElement()");
|
|
671 |
1832
| accept(term.getElement());
|
|
672 |
| } |
|
673 |
394
| setLocationWithinModule(context);
|
|
674 |
394
| visitor.visitLeave(term);
|
|
675 |
394
| setLocationWithinModule(context);
|
|
676 |
| } |
|
677 |
| |
|
678 |
505622
| public void accept(final Element element) throws ModuleDataException {
|
|
679 |
505622
| if (blocked || element == null) {
|
|
680 |
215197
| return;
|
|
681 |
| } |
|
682 |
290425
| final String context = getCurrentContext().getLocationWithinModule();
|
|
683 |
290425
| if (element.isList()) {
|
|
684 |
235434
| setLocationWithinModule(context + ".getList()");
|
|
685 |
235434
| accept(element.getList());
|
|
686 |
54992
| } else if (element.isAtom()) {
|
|
687 |
54992
| setLocationWithinModule(context + ".getAtom()");
|
|
688 |
54992
| accept(element.getAtom());
|
|
689 |
| } else { |
|
690 |
0
| throw new IllegalArgumentException("unexpected element type: "
|
|
691 |
| + element.toString()); |
|
692 |
| } |
|
693 |
209743
| setLocationWithinModule(context);
|
|
694 |
| } |
|
695 |
| |
|
696 |
54992
| public void accept(final Atom atom) throws ModuleDataException {
|
|
697 |
54992
| if (blocked || atom == null) {
|
|
698 |
0
| return;
|
|
699 |
| } |
|
700 |
54992
| final String context = getCurrentContext().getLocationWithinModule();
|
|
701 |
54992
| visitor.visitEnter(atom);
|
|
702 |
54992
| setLocationWithinModule(context);
|
|
703 |
54992
| visitor.visitLeave(atom);
|
|
704 |
54992
| setLocationWithinModule(context);
|
|
705 |
| } |
|
706 |
| |
|
707 |
241505
| public void accept(final ElementList list) throws ModuleDataException {
|
|
708 |
241505
| if (blocked || list == null) {
|
|
709 |
4006
| return;
|
|
710 |
| } |
|
711 |
237499
| final String context = getCurrentContext().getLocationWithinModule();
|
|
712 |
237499
| visitor.visitEnter(list);
|
|
713 |
215177
| for (int i = 0; i < list.size(); i++) {
|
|
714 |
480822
| setLocationWithinModule(context + ".getElement(" + i + ")");
|
|
715 |
480822
| accept(list.getElement(i));
|
|
716 |
| } |
|
717 |
156293
| setLocationWithinModule(context);
|
|
718 |
156293
| visitor.visitLeave(list);
|
|
719 |
156293
| setLocationWithinModule(context);
|
|
720 |
| } |
|
721 |
| |
|
722 |
819826
| public void accept(final LatexList latexList) throws ModuleDataException {
|
|
723 |
819826
| if (blocked || latexList == null) {
|
|
724 |
628316
| return;
|
|
725 |
| } |
|
726 |
191510
| final String context = getCurrentContext().getLocationWithinModule();
|
|
727 |
191510
| visitor.visitEnter(latexList);
|
|
728 |
188941
| for (int i = 0; i < latexList.size(); i++) {
|
|
729 |
367803
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
730 |
367803
| accept(latexList.get(i));
|
|
731 |
| } |
|
732 |
186119
| setLocationWithinModule(context);
|
|
733 |
186119
| visitor.visitLeave(latexList);
|
|
734 |
186119
| setLocationWithinModule(context);
|
|
735 |
| } |
|
736 |
| |
|
737 |
368281
| public void accept(final Latex latex) throws ModuleDataException {
|
|
738 |
368281
| if (blocked || latex == null) {
|
|
739 |
349229
| return;
|
|
740 |
| } |
|
741 |
19052
| final String context = getCurrentContext().getLocationWithinModule();
|
|
742 |
19052
| visitor.visitEnter(latex);
|
|
743 |
16217
| setLocationWithinModule(context);
|
|
744 |
16217
| visitor.visitLeave(latex);
|
|
745 |
16217
| setLocationWithinModule(context);
|
|
746 |
| } |
|
747 |
| |
|
748 |
| |
|
749 |
| |
|
750 |
| |
|
751 |
| |
|
752 |
| |
|
753 |
5686651
| public void setLocationWithinModule(final String locationWithinModule) {
|
|
754 |
5686638
| getCurrentContext().setLocationWithinModule(locationWithinModule);
|
|
755 |
| } |
|
756 |
| |
|
757 |
| |
|
758 |
| |
|
759 |
| |
|
760 |
| |
|
761 |
| |
|
762 |
| |
|
763 |
10919666
| public final ModuleContext getCurrentContext() {
|
|
764 |
10919644
| return currentContext;
|
|
765 |
| } |
|
766 |
| |
|
767 |
| |
|
768 |
| |
|
769 |
| |
|
770 |
| |
|
771 |
| |
|
772 |
0
| public final boolean getBlocked() {
|
|
773 |
0
| return blocked;
|
|
774 |
| } |
|
775 |
| |
|
776 |
| |
|
777 |
| |
|
778 |
| |
|
779 |
| |
|
780 |
| |
|
781 |
1178892
| public final void setBlocked(final boolean blocked) {
|
|
782 |
1178892
| this.blocked = blocked;
|
|
783 |
| } |
|
784 |
| |
|
785 |
| } |
|
786 |
| |