|
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.ModuleDataException; |
|
56 |
| import org.qedeq.kernel.context.ModuleContext; |
|
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 |
| |
|
79 |
| |
|
80 |
| |
|
81 |
| |
|
82 |
| |
|
83 |
10
| public QedeqNotNullTransverser(final String globalContext, final QedeqVisitor visitor) {
|
|
84 |
10
| currentContext = new ModuleContext(globalContext);
|
|
85 |
10
| this.visitor = visitor;
|
|
86 |
| } |
|
87 |
| |
|
88 |
| |
|
89 |
10
| public void accept(final Qedeq qedeq) throws ModuleDataException {
|
|
90 |
10
| getCurrentContext().setLocationWithinModule("");
|
|
91 |
10
| if (qedeq == null) {
|
|
92 |
0
| return;
|
|
93 |
| } |
|
94 |
10
| visitor.visitEnter(qedeq);
|
|
95 |
10
| final String context = getCurrentContext().getLocationWithinModule();
|
|
96 |
10
| if (qedeq.getHeader() != null) {
|
|
97 |
10
| getCurrentContext().setLocationWithinModule(context + "getHeader()");
|
|
98 |
10
| accept(qedeq.getHeader());
|
|
99 |
| } |
|
100 |
10
| if (qedeq.getChapterList() != null) {
|
|
101 |
10
| getCurrentContext().setLocationWithinModule(context + "getChapterList()");
|
|
102 |
10
| accept(qedeq.getChapterList());
|
|
103 |
| } |
|
104 |
10
| if (qedeq.getLiteratureItemList() != null) {
|
|
105 |
4
| getCurrentContext().setLocationWithinModule(context + "getLiteratureItemList()");
|
|
106 |
4
| accept(qedeq.getLiteratureItemList());
|
|
107 |
| } |
|
108 |
10
| setLocationWithinModule(context);
|
|
109 |
10
| visitor.visitLeave(qedeq);
|
|
110 |
| } |
|
111 |
| |
|
112 |
10
| public void accept(final Header header) throws ModuleDataException {
|
|
113 |
10
| if (header == null) {
|
|
114 |
0
| return;
|
|
115 |
| } |
|
116 |
10
| visitor.visitEnter(header);
|
|
117 |
10
| final String context = getCurrentContext().getLocationWithinModule();
|
|
118 |
10
| if (header.getSpecification() != null) {
|
|
119 |
10
| setLocationWithinModule(context + ".getSpecification()");
|
|
120 |
10
| accept(header.getSpecification());
|
|
121 |
| } |
|
122 |
10
| if (header.getTitle() != null) {
|
|
123 |
10
| setLocationWithinModule(context + ".getTitle()");
|
|
124 |
10
| accept(header.getTitle());
|
|
125 |
| } |
|
126 |
10
| if (header.getSummary() != null) {
|
|
127 |
10
| setLocationWithinModule(context + ".getSummary()");
|
|
128 |
10
| accept(header.getSummary());
|
|
129 |
| } |
|
130 |
10
| if (header.getAuthorList() != null) {
|
|
131 |
10
| setLocationWithinModule(context + ".getAuthorList()");
|
|
132 |
10
| accept(header.getAuthorList());
|
|
133 |
| } |
|
134 |
10
| if (header.getImportList() != null) {
|
|
135 |
4
| setLocationWithinModule(context + ".getImportList()");
|
|
136 |
4
| accept(header.getImportList());
|
|
137 |
| } |
|
138 |
10
| if (header.getUsedByList() != null) {
|
|
139 |
2
| setLocationWithinModule(context + ".getUsedByList()");
|
|
140 |
2
| accept(header.getUsedByList());
|
|
141 |
| } |
|
142 |
10
| setLocationWithinModule(context);
|
|
143 |
10
| visitor.visitLeave(header);
|
|
144 |
| } |
|
145 |
| |
|
146 |
2
| public void accept(final UsedByList usedByList) throws ModuleDataException {
|
|
147 |
2
| if (usedByList == null) {
|
|
148 |
0
| return;
|
|
149 |
| } |
|
150 |
2
| visitor.visitEnter(usedByList);
|
|
151 |
2
| final String context = getCurrentContext().getLocationWithinModule();
|
|
152 |
2
| for (int i = 0; i < usedByList.size(); i++) {
|
|
153 |
2
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
154 |
2
| accept(usedByList.get(i));
|
|
155 |
| } |
|
156 |
2
| setLocationWithinModule(context);
|
|
157 |
2
| visitor.visitLeave(usedByList);
|
|
158 |
| } |
|
159 |
| |
|
160 |
4
| public void accept(final ImportList importList) throws ModuleDataException {
|
|
161 |
4
| if (importList == null) {
|
|
162 |
0
| return;
|
|
163 |
| } |
|
164 |
4
| visitor.visitEnter(importList);
|
|
165 |
4
| final String context = getCurrentContext().getLocationWithinModule();
|
|
166 |
4
| for (int i = 0; i < importList.size(); i++) {
|
|
167 |
6
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
168 |
6
| accept(importList.get(i));
|
|
169 |
| } |
|
170 |
4
| setLocationWithinModule(context);
|
|
171 |
4
| visitor.visitLeave(importList);
|
|
172 |
| } |
|
173 |
| |
|
174 |
6
| public void accept(final Import imp) throws ModuleDataException {
|
|
175 |
6
| if (imp == null) {
|
|
176 |
0
| return;
|
|
177 |
| } |
|
178 |
6
| visitor.visitEnter(imp);
|
|
179 |
6
| final String context = getCurrentContext().getLocationWithinModule();
|
|
180 |
6
| if (imp.getSpecification() != null) {
|
|
181 |
6
| setLocationWithinModule(context + ".getSpecification()");
|
|
182 |
6
| accept(imp.getSpecification());
|
|
183 |
| } |
|
184 |
6
| setLocationWithinModule(context);
|
|
185 |
6
| visitor.visitLeave(imp);
|
|
186 |
| } |
|
187 |
| |
|
188 |
18
| public void accept(final Specification specification) throws ModuleDataException {
|
|
189 |
18
| if (specification == null) {
|
|
190 |
0
| return;
|
|
191 |
| } |
|
192 |
18
| visitor.visitEnter(specification);
|
|
193 |
18
| final String context = getCurrentContext().getLocationWithinModule();
|
|
194 |
18
| if (specification.getLocationList() != null) {
|
|
195 |
18
| setLocationWithinModule(context + ".getLocationList()");
|
|
196 |
18
| accept(specification.getLocationList());
|
|
197 |
| } |
|
198 |
18
| setLocationWithinModule(context);
|
|
199 |
18
| visitor.visitLeave(specification);
|
|
200 |
| } |
|
201 |
| |
|
202 |
18
| public void accept(final LocationList locationList) throws ModuleDataException {
|
|
203 |
18
| if (locationList == null) {
|
|
204 |
0
| return;
|
|
205 |
| } |
|
206 |
18
| visitor.visitEnter(locationList);
|
|
207 |
18
| final String context = getCurrentContext().getLocationWithinModule();
|
|
208 |
18
| for (int i = 0; i < locationList.size(); i++) {
|
|
209 |
18
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
210 |
18
| accept(locationList.get(i));
|
|
211 |
| } |
|
212 |
18
| setLocationWithinModule(context);
|
|
213 |
18
| visitor.visitLeave(locationList);
|
|
214 |
| } |
|
215 |
| |
|
216 |
18
| public void accept(final Location location) throws ModuleDataException {
|
|
217 |
18
| if (location == null) {
|
|
218 |
0
| return;
|
|
219 |
| } |
|
220 |
18
| visitor.visitEnter(location);
|
|
221 |
18
| visitor.visitLeave(location);
|
|
222 |
| } |
|
223 |
| |
|
224 |
10
| public void accept(final AuthorList authorList) throws ModuleDataException {
|
|
225 |
10
| if (authorList == null) {
|
|
226 |
0
| return;
|
|
227 |
| } |
|
228 |
10
| visitor.visitEnter(authorList);
|
|
229 |
10
| final String context = getCurrentContext().getLocationWithinModule();
|
|
230 |
10
| for (int i = 0; i < authorList.size(); i++) {
|
|
231 |
10
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
232 |
10
| accept(authorList.get(i));
|
|
233 |
| } |
|
234 |
10
| setLocationWithinModule(context);
|
|
235 |
10
| visitor.visitLeave(authorList);
|
|
236 |
| } |
|
237 |
| |
|
238 |
10
| public void accept(final Author author) throws ModuleDataException {
|
|
239 |
10
| if (author == null) {
|
|
240 |
0
| return;
|
|
241 |
| } |
|
242 |
10
| visitor.visitEnter(author);
|
|
243 |
10
| final String context = getCurrentContext().getLocationWithinModule();
|
|
244 |
10
| if (author.getName() != null) {
|
|
245 |
10
| setLocationWithinModule(context + ".getName()");
|
|
246 |
10
| accept(author.getName());
|
|
247 |
| } |
|
248 |
10
| setLocationWithinModule(context);
|
|
249 |
10
| visitor.visitLeave(author);
|
|
250 |
| } |
|
251 |
| |
|
252 |
10
| public void accept(final ChapterList chapterList) throws ModuleDataException {
|
|
253 |
10
| if (chapterList == null) {
|
|
254 |
0
| return;
|
|
255 |
| } |
|
256 |
10
| visitor.visitEnter(chapterList);
|
|
257 |
10
| final String context = getCurrentContext().getLocationWithinModule();
|
|
258 |
10
| for (int i = 0; i < chapterList.size(); i++) {
|
|
259 |
50
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
260 |
50
| accept(chapterList.get(i));
|
|
261 |
| } |
|
262 |
10
| setLocationWithinModule(context);
|
|
263 |
10
| visitor.visitLeave(chapterList);
|
|
264 |
| } |
|
265 |
| |
|
266 |
50
| public void accept(final Chapter chapter) throws ModuleDataException {
|
|
267 |
50
| if (chapter == null) {
|
|
268 |
0
| return;
|
|
269 |
| } |
|
270 |
50
| visitor.visitEnter(chapter);
|
|
271 |
50
| final String context = getCurrentContext().getLocationWithinModule();
|
|
272 |
50
| if (chapter.getTitle() != null) {
|
|
273 |
50
| setLocationWithinModule(context + ".getTitle()");
|
|
274 |
50
| accept(chapter.getTitle());
|
|
275 |
| } |
|
276 |
50
| if (chapter.getIntroduction() != null) {
|
|
277 |
50
| setLocationWithinModule(context + ".getIntroduction()");
|
|
278 |
50
| accept(chapter.getIntroduction());
|
|
279 |
| } |
|
280 |
50
| if (chapter.getSectionList() != null) {
|
|
281 |
28
| setLocationWithinModule(context + ".getSectionList()");
|
|
282 |
28
| accept(chapter.getSectionList());
|
|
283 |
| } |
|
284 |
50
| setLocationWithinModule(context);
|
|
285 |
50
| visitor.visitLeave(chapter);
|
|
286 |
| } |
|
287 |
| |
|
288 |
4
| public void accept(final LiteratureItemList literatureItemList)
|
|
289 |
| throws ModuleDataException { |
|
290 |
4
| if (literatureItemList == null) {
|
|
291 |
0
| return;
|
|
292 |
| } |
|
293 |
4
| visitor.visitEnter(literatureItemList);
|
|
294 |
4
| final String context = getCurrentContext().getLocationWithinModule();
|
|
295 |
4
| for (int i = 0; i < literatureItemList.size(); i++) {
|
|
296 |
18
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
297 |
18
| accept(literatureItemList.get(i));
|
|
298 |
| } |
|
299 |
4
| setLocationWithinModule(context);
|
|
300 |
4
| visitor.visitLeave(literatureItemList);
|
|
301 |
| } |
|
302 |
| |
|
303 |
18
| public void accept(final LiteratureItem item) throws ModuleDataException {
|
|
304 |
18
| if (item == null) {
|
|
305 |
0
| return;
|
|
306 |
| } |
|
307 |
18
| visitor.visitEnter(item);
|
|
308 |
18
| final String context = getCurrentContext().getLocationWithinModule();
|
|
309 |
18
| if (item.getItem() != null) {
|
|
310 |
18
| setLocationWithinModule(context + ".getItem()");
|
|
311 |
18
| accept(item.getItem());
|
|
312 |
| } |
|
313 |
18
| setLocationWithinModule(context);
|
|
314 |
18
| visitor.visitLeave(item);
|
|
315 |
| } |
|
316 |
| |
|
317 |
28
| public void accept(final SectionList sectionList) throws ModuleDataException {
|
|
318 |
28
| if (sectionList == null) {
|
|
319 |
0
| return;
|
|
320 |
| } |
|
321 |
28
| visitor.visitEnter(sectionList);
|
|
322 |
28
| final String context = getCurrentContext().getLocationWithinModule();
|
|
323 |
28
| for (int i = 0; i < sectionList.size(); i++) {
|
|
324 |
84
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
325 |
84
| accept(sectionList.get(i));
|
|
326 |
| } |
|
327 |
28
| setLocationWithinModule(context);
|
|
328 |
28
| visitor.visitLeave(sectionList);
|
|
329 |
| } |
|
330 |
| |
|
331 |
84
| public void accept(final Section section) throws ModuleDataException {
|
|
332 |
84
| if (section == null) {
|
|
333 |
0
| return;
|
|
334 |
| } |
|
335 |
84
| visitor.visitEnter(section);
|
|
336 |
84
| final String context = getCurrentContext().getLocationWithinModule();
|
|
337 |
84
| if (section.getTitle() != null) {
|
|
338 |
84
| setLocationWithinModule(context + ".getTitle()");
|
|
339 |
84
| accept(section.getTitle());
|
|
340 |
| } |
|
341 |
84
| if (section.getIntroduction() != null) {
|
|
342 |
84
| setLocationWithinModule(context + ".getIntroduction()");
|
|
343 |
84
| accept(section.getIntroduction());
|
|
344 |
| } |
|
345 |
84
| if (section.getSubsectionList() != null) {
|
|
346 |
40
| setLocationWithinModule(context + ".getSubsectionList()");
|
|
347 |
40
| accept(section.getSubsectionList());
|
|
348 |
| } |
|
349 |
84
| setLocationWithinModule(context);
|
|
350 |
84
| visitor.visitLeave(section);
|
|
351 |
| } |
|
352 |
| |
|
353 |
40
| public void accept(final SubsectionList subsectionList) throws ModuleDataException {
|
|
354 |
40
| if (subsectionList == null) {
|
|
355 |
0
| return;
|
|
356 |
| } |
|
357 |
40
| visitor.visitEnter(subsectionList);
|
|
358 |
40
| final String context = getCurrentContext().getLocationWithinModule();
|
|
359 |
40
| for (int i = 0; i < subsectionList.size(); i++) {
|
|
360 |
248
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
361 |
| |
|
362 |
248
| if (subsectionList.get(i) instanceof Subsection) {
|
|
363 |
48
| accept((Subsection) subsectionList.get(i));
|
|
364 |
200
| } else if (subsectionList.get(i) instanceof Node) {
|
|
365 |
200
| accept((Node) subsectionList.get(i));
|
|
366 |
0
| } else if (subsectionList.get(i) == null) {
|
|
367 |
| |
|
368 |
| } else { |
|
369 |
0
| throw new IllegalArgumentException("unexpected subsection type: "
|
|
370 |
| + subsectionList.get(i).getClass()); |
|
371 |
| } |
|
372 |
| } |
|
373 |
40
| setLocationWithinModule(context);
|
|
374 |
40
| visitor.visitLeave(subsectionList);
|
|
375 |
| } |
|
376 |
| |
|
377 |
48
| public void accept(final Subsection subsection) throws ModuleDataException {
|
|
378 |
48
| if (subsection == null) {
|
|
379 |
0
| return;
|
|
380 |
| } |
|
381 |
48
| visitor.visitEnter(subsection);
|
|
382 |
48
| final String context = getCurrentContext().getLocationWithinModule();
|
|
383 |
48
| if (subsection.getTitle() != null) {
|
|
384 |
42
| setLocationWithinModule(context + ".getTitle()");
|
|
385 |
42
| accept(subsection.getTitle());
|
|
386 |
| } |
|
387 |
48
| if (subsection.getLatex() != null) {
|
|
388 |
48
| setLocationWithinModule(context + ".getLatex()");
|
|
389 |
48
| accept(subsection.getLatex());
|
|
390 |
| } |
|
391 |
48
| setLocationWithinModule(context);
|
|
392 |
48
| visitor.visitLeave(subsection);
|
|
393 |
| } |
|
394 |
| |
|
395 |
200
| public void accept(final Node node) throws ModuleDataException {
|
|
396 |
200
| if (node == null) {
|
|
397 |
0
| return;
|
|
398 |
| } |
|
399 |
200
| visitor.visitEnter(node);
|
|
400 |
200
| final String context = getCurrentContext().getLocationWithinModule();
|
|
401 |
200
| if (node.getName() != null) {
|
|
402 |
92
| setLocationWithinModule(context + ".getName()");
|
|
403 |
92
| accept(node.getName());
|
|
404 |
| } |
|
405 |
200
| if (node.getTitle() != null) {
|
|
406 |
92
| setLocationWithinModule(context + ".getTitle()");
|
|
407 |
92
| accept(node.getTitle());
|
|
408 |
| } |
|
409 |
200
| if (node.getPrecedingText() != null) {
|
|
410 |
200
| setLocationWithinModule(context + ".getPrecedingText()");
|
|
411 |
200
| accept(node.getPrecedingText());
|
|
412 |
| } |
|
413 |
200
| if (node.getNodeType() != null) {
|
|
414 |
200
| setLocationWithinModule(context + ".getNodeType()");
|
|
415 |
200
| if (node.getNodeType() instanceof Axiom) {
|
|
416 |
32
| setLocationWithinModule(context + ".getNodeType().getAxiom()");
|
|
417 |
32
| accept((Axiom) node.getNodeType());
|
|
418 |
168
| } else if (node.getNodeType() instanceof PredicateDefinition) {
|
|
419 |
24
| setLocationWithinModule(context + ".getNodeType().getPredicateDefinition()");
|
|
420 |
24
| accept((PredicateDefinition) node.getNodeType());
|
|
421 |
144
| } else if (node.getNodeType() instanceof FunctionDefinition) {
|
|
422 |
32
| setLocationWithinModule(context + ".getNodeType().getFunctionDefinition()");
|
|
423 |
32
| accept((FunctionDefinition) node.getNodeType());
|
|
424 |
112
| } else if (node.getNodeType() instanceof Proposition) {
|
|
425 |
108
| setLocationWithinModule(context + ".getNodeType().getProposition()");
|
|
426 |
108
| accept((Proposition) node.getNodeType());
|
|
427 |
4
| } else if (node.getNodeType() instanceof Rule) {
|
|
428 |
4
| setLocationWithinModule(context + ".getNodeType().getRule()");
|
|
429 |
4
| accept((Rule) node.getNodeType());
|
|
430 |
| } else { |
|
431 |
0
| throw new IllegalArgumentException("unexpected node type: "
|
|
432 |
| + node.getNodeType().getClass()); |
|
433 |
| } |
|
434 |
| } |
|
435 |
200
| if (node.getSucceedingText() != null) {
|
|
436 |
40
| setLocationWithinModule(context + ".getSucceedingText()");
|
|
437 |
40
| accept(node.getSucceedingText());
|
|
438 |
| } |
|
439 |
200
| setLocationWithinModule(context);
|
|
440 |
200
| visitor.visitLeave(node);
|
|
441 |
| } |
|
442 |
| |
|
443 |
32
| public void accept(final Axiom axiom) throws ModuleDataException {
|
|
444 |
32
| if (axiom == null) {
|
|
445 |
0
| return;
|
|
446 |
| } |
|
447 |
32
| visitor.visitEnter(axiom);
|
|
448 |
32
| final String context = getCurrentContext().getLocationWithinModule();
|
|
449 |
32
| if (axiom.getFormula() != null) {
|
|
450 |
32
| setLocationWithinModule(context + ".getFormula()");
|
|
451 |
32
| accept(axiom.getFormula());
|
|
452 |
| } |
|
453 |
32
| if (axiom.getDescription() != null) {
|
|
454 |
0
| setLocationWithinModule(context + ".getDescription()");
|
|
455 |
0
| accept(axiom.getDescription());
|
|
456 |
| } |
|
457 |
32
| setLocationWithinModule(context);
|
|
458 |
32
| visitor.visitLeave(axiom);
|
|
459 |
| } |
|
460 |
| |
|
461 |
24
| public void accept(final PredicateDefinition definition)
|
|
462 |
| throws ModuleDataException { |
|
463 |
24
| if (definition == null) {
|
|
464 |
0
| return;
|
|
465 |
| } |
|
466 |
24
| visitor.visitEnter(definition);
|
|
467 |
24
| final String context = getCurrentContext().getLocationWithinModule();
|
|
468 |
24
| if (definition.getVariableList() != null) {
|
|
469 |
24
| setLocationWithinModule(context + ".getVariableList()");
|
|
470 |
24
| accept(definition.getVariableList());
|
|
471 |
| } |
|
472 |
24
| if (definition.getFormula() != null) {
|
|
473 |
20
| setLocationWithinModule(context + ".getFormula()");
|
|
474 |
20
| accept(definition.getFormula());
|
|
475 |
| } |
|
476 |
24
| if (definition.getDescription() != null) {
|
|
477 |
0
| setLocationWithinModule(context + ".getDescription()");
|
|
478 |
0
| accept(definition.getDescription());
|
|
479 |
| } |
|
480 |
24
| setLocationWithinModule(context);
|
|
481 |
24
| visitor.visitLeave(definition);
|
|
482 |
| } |
|
483 |
| |
|
484 |
32
| public void accept(final FunctionDefinition definition) throws ModuleDataException {
|
|
485 |
32
| if (definition == null) {
|
|
486 |
0
| return;
|
|
487 |
| } |
|
488 |
32
| visitor.visitEnter(definition);
|
|
489 |
32
| final String context = getCurrentContext().getLocationWithinModule();
|
|
490 |
32
| if (definition.getVariableList() != null) {
|
|
491 |
26
| setLocationWithinModule(context + ".getVariableList()");
|
|
492 |
26
| accept(definition.getVariableList());
|
|
493 |
| } |
|
494 |
32
| if (definition.getTerm() != null) {
|
|
495 |
32
| setLocationWithinModule(context + ".getTerm()");
|
|
496 |
32
| accept(definition.getTerm());
|
|
497 |
| } |
|
498 |
32
| if (definition.getDescription() != null) {
|
|
499 |
0
| setLocationWithinModule(context + ".getDescription()");
|
|
500 |
0
| accept(definition.getDescription());
|
|
501 |
| } |
|
502 |
32
| setLocationWithinModule(context);
|
|
503 |
32
| visitor.visitLeave(definition);
|
|
504 |
| } |
|
505 |
| |
|
506 |
108
| public void accept(final Proposition proposition) throws ModuleDataException {
|
|
507 |
108
| if (proposition == null) {
|
|
508 |
0
| return;
|
|
509 |
| } |
|
510 |
108
| visitor.visitEnter(proposition);
|
|
511 |
108
| final String context = getCurrentContext().getLocationWithinModule();
|
|
512 |
108
| if (proposition.getFormula() != null) {
|
|
513 |
108
| setLocationWithinModule(context + ".getFormula()");
|
|
514 |
108
| accept(proposition.getFormula());
|
|
515 |
| } |
|
516 |
108
| if (proposition.getDescription() != null) {
|
|
517 |
2
| setLocationWithinModule(context + ".getDescription()");
|
|
518 |
2
| accept(proposition.getDescription());
|
|
519 |
| } |
|
520 |
108
| if (proposition.getProofList() != null) {
|
|
521 |
10
| setLocationWithinModule(context + ".getProofList()");
|
|
522 |
10
| accept(proposition.getProofList());
|
|
523 |
| } |
|
524 |
108
| setLocationWithinModule(context);
|
|
525 |
108
| visitor.visitLeave(proposition);
|
|
526 |
| } |
|
527 |
| |
|
528 |
4
| public void accept(final Rule rule) throws ModuleDataException {
|
|
529 |
4
| if (rule == null) {
|
|
530 |
0
| return;
|
|
531 |
| } |
|
532 |
4
| visitor.visitEnter(rule);
|
|
533 |
4
| final String context = getCurrentContext().getLocationWithinModule();
|
|
534 |
4
| if (rule.getLinkList() != null) {
|
|
535 |
2
| setLocationWithinModule(context + ".getLinkList()");
|
|
536 |
2
| accept(rule.getLinkList());
|
|
537 |
| } |
|
538 |
4
| if (rule.getDescription() != null) {
|
|
539 |
4
| setLocationWithinModule(context + ".getDescription()");
|
|
540 |
4
| accept(rule.getDescription());
|
|
541 |
| } |
|
542 |
4
| if (rule.getProofList() != null) {
|
|
543 |
0
| setLocationWithinModule(context + ".getProofList()");
|
|
544 |
0
| accept(rule.getProofList());
|
|
545 |
| } |
|
546 |
4
| setLocationWithinModule(context);
|
|
547 |
4
| visitor.visitLeave(rule);
|
|
548 |
| } |
|
549 |
| |
|
550 |
2
| public void accept(final LinkList linkList) throws ModuleDataException {
|
|
551 |
2
| if (linkList == null) {
|
|
552 |
0
| return;
|
|
553 |
| } |
|
554 |
2
| visitor.visitEnter(linkList);
|
|
555 |
2
| visitor.visitLeave(linkList);
|
|
556 |
| } |
|
557 |
| |
|
558 |
50
| public void accept(final VariableList variableList) throws ModuleDataException {
|
|
559 |
50
| if (variableList == null) {
|
|
560 |
0
| return;
|
|
561 |
| } |
|
562 |
50
| visitor.visitEnter(variableList);
|
|
563 |
50
| final String context = getCurrentContext().getLocationWithinModule();
|
|
564 |
50
| for (int i = 0; i < variableList.size(); i++) {
|
|
565 |
74
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
566 |
74
| if (variableList.get(i) != null) {
|
|
567 |
74
| setLocationWithinModule(context + ".getElement()");
|
|
568 |
74
| if (variableList.get(i).isList()) {
|
|
569 |
74
| accept(variableList.get(i).getList());
|
|
570 |
0
| } else if (variableList.get(i).isAtom()) {
|
|
571 |
0
| accept(variableList.get(i).getAtom());
|
|
572 |
| } else { |
|
573 |
0
| throw new IllegalArgumentException("unexpected element type: "
|
|
574 |
| + variableList.get(i).toString()); |
|
575 |
| } |
|
576 |
| } |
|
577 |
| } |
|
578 |
50
| setLocationWithinModule(context);
|
|
579 |
50
| visitor.visitLeave(variableList);
|
|
580 |
| } |
|
581 |
| |
|
582 |
10
| public void accept(final ProofList proofList) throws ModuleDataException {
|
|
583 |
10
| if (proofList == null) {
|
|
584 |
0
| return;
|
|
585 |
| } |
|
586 |
10
| visitor.visitEnter(proofList);
|
|
587 |
10
| final String context = getCurrentContext().getLocationWithinModule();
|
|
588 |
10
| for (int i = 0; i < proofList.size(); i++) {
|
|
589 |
10
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
590 |
10
| accept(proofList.get(i));
|
|
591 |
| } |
|
592 |
10
| setLocationWithinModule(context);
|
|
593 |
10
| visitor.visitLeave(proofList);
|
|
594 |
| } |
|
595 |
| |
|
596 |
10
| public void accept(final Proof proof) throws ModuleDataException {
|
|
597 |
10
| if (proof == null) {
|
|
598 |
0
| return;
|
|
599 |
| } |
|
600 |
10
| visitor.visitEnter(proof);
|
|
601 |
10
| final String context = getCurrentContext().getLocationWithinModule();
|
|
602 |
10
| if (proof.getNonFormalProof() != null) {
|
|
603 |
10
| setLocationWithinModule(context + ".getNonFormalProof()");
|
|
604 |
10
| accept(proof.getNonFormalProof());
|
|
605 |
| } |
|
606 |
10
| setLocationWithinModule(context);
|
|
607 |
10
| visitor.visitLeave(proof);
|
|
608 |
| } |
|
609 |
| |
|
610 |
160
| public void accept(final Formula formula) throws ModuleDataException {
|
|
611 |
160
| if (formula == null) {
|
|
612 |
0
| return;
|
|
613 |
| } |
|
614 |
160
| visitor.visitEnter(formula);
|
|
615 |
160
| final String context = getCurrentContext().getLocationWithinModule();
|
|
616 |
160
| if (formula.getElement() != null) {
|
|
617 |
160
| setLocationWithinModule(context + ".getElement()");
|
|
618 |
160
| accept(formula.getElement());
|
|
619 |
| } |
|
620 |
160
| setLocationWithinModule(context);
|
|
621 |
160
| visitor.visitLeave(formula);
|
|
622 |
| } |
|
623 |
| |
|
624 |
32
| public void accept(final Term term) throws ModuleDataException {
|
|
625 |
32
| if (term == null) {
|
|
626 |
0
| return;
|
|
627 |
| } |
|
628 |
32
| visitor.visitEnter(term);
|
|
629 |
32
| final String context = getCurrentContext().getLocationWithinModule();
|
|
630 |
32
| if (term.getElement() != null) {
|
|
631 |
32
| setLocationWithinModule(context + ".getElement()");
|
|
632 |
32
| accept(term.getElement());
|
|
633 |
| } |
|
634 |
32
| setLocationWithinModule(context);
|
|
635 |
32
| visitor.visitLeave(term);
|
|
636 |
| } |
|
637 |
| |
|
638 |
5530
| public void accept(final Element element) throws ModuleDataException {
|
|
639 |
5530
| if (element == null) {
|
|
640 |
0
| return;
|
|
641 |
| } |
|
642 |
5530
| final String context = getCurrentContext().getLocationWithinModule();
|
|
643 |
5530
| if (element.isList()) {
|
|
644 |
2998
| setLocationWithinModule(context + ".getList()");
|
|
645 |
2998
| accept(element.getList());
|
|
646 |
2532
| } else if (element.isAtom()) {
|
|
647 |
2532
| setLocationWithinModule(context + ".getAtom()");
|
|
648 |
2532
| accept(element.getAtom());
|
|
649 |
| } else { |
|
650 |
0
| throw new IllegalArgumentException("unexpected element type: "
|
|
651 |
| + element.toString()); |
|
652 |
| } |
|
653 |
5530
| setLocationWithinModule(context);
|
|
654 |
| } |
|
655 |
| |
|
656 |
2532
| public void accept(final Atom atom) throws ModuleDataException {
|
|
657 |
2532
| if (atom == null) {
|
|
658 |
0
| return;
|
|
659 |
| } |
|
660 |
2532
| visitor.visitEnter(atom);
|
|
661 |
2532
| visitor.visitLeave(atom);
|
|
662 |
| } |
|
663 |
| |
|
664 |
3072
| public void accept(final ElementList list) throws ModuleDataException {
|
|
665 |
3072
| if (list == null) {
|
|
666 |
0
| return;
|
|
667 |
| } |
|
668 |
3072
| visitor.visitEnter(list);
|
|
669 |
3072
| final String context = getCurrentContext().getLocationWithinModule();
|
|
670 |
3072
| for (int i = 0; i < list.size(); i++) {
|
|
671 |
5338
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
672 |
5338
| accept(list.getElement(i));
|
|
673 |
| } |
|
674 |
3072
| setLocationWithinModule(context);
|
|
675 |
3072
| visitor.visitLeave(list);
|
|
676 |
| } |
|
677 |
| |
|
678 |
836
| public void accept(final LatexList latexList) throws ModuleDataException {
|
|
679 |
836
| if (latexList == null) {
|
|
680 |
0
| return;
|
|
681 |
| } |
|
682 |
836
| visitor.visitEnter(latexList);
|
|
683 |
836
| final String context = getCurrentContext().getLocationWithinModule();
|
|
684 |
836
| for (int i = 0; i < latexList.size(); i++) {
|
|
685 |
1442
| setLocationWithinModule(context + ".get(" + i + ")");
|
|
686 |
1442
| accept(latexList.get(i));
|
|
687 |
| } |
|
688 |
836
| setLocationWithinModule(context);
|
|
689 |
836
| visitor.visitLeave(latexList);
|
|
690 |
| } |
|
691 |
| |
|
692 |
1452
| public void accept(final Latex latex) throws ModuleDataException {
|
|
693 |
1452
| if (latex == null) {
|
|
694 |
0
| return;
|
|
695 |
| } |
|
696 |
1452
| visitor.visitEnter(latex);
|
|
697 |
1452
| visitor.visitLeave(latex);
|
|
698 |
| } |
|
699 |
| |
|
700 |
| |
|
701 |
| |
|
702 |
| |
|
703 |
| |
|
704 |
| |
|
705 |
25184
| public void setLocationWithinModule(final String locationWithinModule) {
|
|
706 |
25184
| getCurrentContext().setLocationWithinModule(locationWithinModule);
|
|
707 |
| } |
|
708 |
| |
|
709 |
| |
|
710 |
| |
|
711 |
| |
|
712 |
| |
|
713 |
| |
|
714 |
36464
| public final ModuleContext getCurrentContext() {
|
|
715 |
36464
| return currentContext;
|
|
716 |
| } |
|
717 |
| |
|
718 |
| } |
|
719 |
| |