Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: So Mrz 11 2007 07:05:19 CET
file stats: LOC: 785   Methods: 40
NCLOC: 678   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
QedeqNotNullTransverser.java 77,7% 93,8% 97,5% 89,2%
coverage coverage
 1    /* $Id: QedeqNotNullTransverser.java,v 1.2 2007/02/25 20:05:36 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2007, Michael Meyling <mime@qedeq.org>.
 6    *
 7    * "Hilbert II" is free software; you can redistribute
 8    * it and/or modify it under the terms of the GNU General Public
 9    * License as published by the Free Software Foundation; either
 10    * version 2 of the License, or (at your option) any later version.
 11    *
 12    * This program is distributed in the hope that it will be useful,
 13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 15    * GNU General Public License for more details.
 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    * Traverse QEDEQ module. Calls visitors of {@link org.qedeq.kernel.bo.visitor.QedeqVisitor}
 61    * for non <code>null</code> arguments.
 62    *
 63    * @version $Revision: 1.2 $
 64    * @author Michael Meyling
 65    */
 66    public class QedeqNotNullTransverser implements QedeqTransverser {
 67   
 68    /** Current context during creation. */
 69    private ModuleContext currentContext;
 70   
 71    /**
 72    * These methods are called if a node is visited. To start the whole process just call
 73    * {@link #accept(Qedeq)}.
 74    */
 75    private QedeqVisitor visitor;
 76   
 77    /** Is sub node traversion currently blocked? */
 78    private boolean blocked;
 79   
 80    /**
 81    * Constructor.
 82    *
 83    * @param globalContext Module location information.
 84    * @param visitor These methods are called if a node is visited.
 85    */
 86  26751 public QedeqNotNullTransverser(final String globalContext, final QedeqVisitor visitor) {
 87  26751 currentContext = new ModuleContext(globalContext);
 88  26751 this.visitor = visitor;
 89    }
 90   
 91   
 92  26749 public void accept(final Qedeq qedeq) throws ModuleDataException {
 93  26749 getCurrentContext().setLocationWithinModule("");
 94  26749 blocked = false;
 95  26749 if (qedeq == null) {
 96  0 return;
 97    }
 98  26749 final String context = getCurrentContext().getLocationWithinModule();
 99  26749 visitor.visitEnter(qedeq);
 100  26747 if (qedeq.getHeader() != null) {
 101  26747 getCurrentContext().setLocationWithinModule(context + "getHeader()");
 102  26747 accept(qedeq.getHeader());
 103    }
 104  26283 if (qedeq.getChapterList() != null) {
 105  26283 getCurrentContext().setLocationWithinModule(context + "getChapterList()");
 106  26283 accept(qedeq.getChapterList());
 107    }
 108  231 if (qedeq.getLiteratureItemList() != null) {
 109  194 getCurrentContext().setLocationWithinModule(context + "getLiteratureItemList()");
 110  194 accept(qedeq.getLiteratureItemList());
 111    }
 112  61 setLocationWithinModule(context);
 113  61 visitor.visitLeave(qedeq);
 114  61 setLocationWithinModule(context);
 115    }
 116   
 117  26747 public void accept(final Header header) throws ModuleDataException {
 118  26747 if (blocked || header == null) {
 119  0 return;
 120    }
 121  26747 final String context = getCurrentContext().getLocationWithinModule();
 122  26747 visitor.visitEnter(header);
 123  26723 if (header.getSpecification() != null) {
 124  26723 setLocationWithinModule(context + ".getSpecification()");
 125  26723 accept(header.getSpecification());
 126    }
 127  26618 if (header.getTitle() != null) {
 128  26618 setLocationWithinModule(context + ".getTitle()");
 129  26618 accept(header.getTitle());
 130    }
 131  26572 if (header.getSummary() != null) {
 132  26572 setLocationWithinModule(context + ".getSummary()");
 133  26572 accept(header.getSummary());
 134    }
 135  26526 if (header.getAuthorList() != null) {
 136  26526 setLocationWithinModule(context + ".getAuthorList()");
 137  26526 accept(header.getAuthorList());
 138    }
 139  26454 if (header.getImportList() != null) {
 140  23950 setLocationWithinModule(context + ".getImportList()");
 141  23950 accept(header.getImportList());
 142    }
 143  26338 if (header.getUsedByList() != null) {
 144  2486 setLocationWithinModule(context + ".getUsedByList()");
 145  2486 accept(header.getUsedByList());
 146    }
 147  26283 setLocationWithinModule(context);
 148  26283 visitor.visitLeave(header);
 149  26283 setLocationWithinModule(context);
 150    }
 151   
 152  2486 public void accept(final UsedByList usedByList) throws ModuleDataException {
 153  2486 if (blocked || usedByList == null) {
 154  2403 return;
 155    }
 156  83 final String context = getCurrentContext().getLocationWithinModule();
 157  83 visitor.visitEnter(usedByList);
 158  73 for (int i = 0; i < usedByList.size(); i++) {
 159  73 setLocationWithinModule(context + ".get(" + i + ")");
 160  73 accept(usedByList.get(i));
 161    }
 162  28 setLocationWithinModule(context);
 163  28 visitor.visitLeave(usedByList);
 164  28 setLocationWithinModule(context);
 165    }
 166   
 167  23950 public void accept(final ImportList importList) throws ModuleDataException {
 168  23950 if (blocked || importList == null) {
 169  23769 return;
 170    }
 171  181 final String context = getCurrentContext().getLocationWithinModule();
 172  181 visitor.visitEnter(importList);
 173  169 for (int i = 0; i < importList.size(); i++) {
 174  256 setLocationWithinModule(context + ".get(" + i + ")");
 175  256 accept(importList.get(i));
 176    }
 177  65 setLocationWithinModule(context);
 178  65 visitor.visitLeave(importList);
 179  65 setLocationWithinModule(context);
 180    }
 181   
 182  256 public void accept(final Import imp) throws ModuleDataException {
 183  256 if (blocked || imp == null) {
 184  66 return;
 185    }
 186  190 final String context = getCurrentContext().getLocationWithinModule();
 187  190 visitor.visitEnter(imp);
 188  164 if (imp.getSpecification() != null) {
 189  164 setLocationWithinModule(context + ".getSpecification()");
 190  164 accept(imp.getSpecification());
 191    }
 192  86 setLocationWithinModule(context);
 193  86 visitor.visitLeave(imp);
 194  86 setLocationWithinModule(context);
 195    }
 196   
 197  26960 public void accept(final Specification specification) throws ModuleDataException {
 198  26960 if (blocked || specification == null) {
 199  26251 return;
 200    }
 201  709 final String context = getCurrentContext().getLocationWithinModule();
 202  709 visitor.visitEnter(specification);
 203  609 if (specification.getLocationList() != null) {
 204  609 setLocationWithinModule(context + ".getLocationList()");
 205  609 accept(specification.getLocationList());
 206    }
 207  481 setLocationWithinModule(context);
 208  481 visitor.visitLeave(specification);
 209  481 setLocationWithinModule(context);
 210    }
 211   
 212  609 public void accept(final LocationList locationList) throws ModuleDataException {
 213  609 if (blocked || locationList == null) {
 214  335 return;
 215    }
 216  274 final String context = getCurrentContext().getLocationWithinModule();
 217  274 visitor.visitEnter(locationList);
 218  222 for (int i = 0; i < locationList.size(); i++) {
 219  222 setLocationWithinModule(context + ".get(" + i + ")");
 220  222 accept(locationList.get(i));
 221    }
 222  146 setLocationWithinModule(context);
 223  146 visitor.visitLeave(locationList);
 224  146 setLocationWithinModule(context);
 225    }
 226   
 227  222 public void accept(final Location location) throws ModuleDataException {
 228  222 if (blocked || location == null) {
 229  0 return;
 230    }
 231  222 final String context = getCurrentContext().getLocationWithinModule();
 232  222 visitor.visitEnter(location);
 233  146 setLocationWithinModule(context);
 234  146 visitor.visitLeave(location);
 235  146 setLocationWithinModule(context);
 236    }
 237   
 238  26526 public void accept(final AuthorList authorList) throws ModuleDataException {
 239  26526 if (blocked || authorList == null) {
 240  26215 return;
 241    }
 242  311 final String context = getCurrentContext().getLocationWithinModule();
 243  311 visitor.visitEnter(authorList);
 244  287 for (int i = 0; i < authorList.size(); i++) {
 245  287 setLocationWithinModule(context + ".get(" + i + ")");
 246  287 accept(authorList.get(i));
 247    }
 248  239 setLocationWithinModule(context);
 249  239 visitor.visitLeave(authorList);
 250  239 setLocationWithinModule(context);
 251    }
 252   
 253  287 public void accept(final Author author) throws ModuleDataException {
 254  287 if (blocked || author == null) {
 255  171 return;
 256    }
 257  116 final String context = getCurrentContext().getLocationWithinModule();
 258  116 visitor.visitEnter(author);
 259  81 if (author.getName() != null) {
 260  81 setLocationWithinModule(context + ".getName()");
 261  81 accept(author.getName());
 262    }
 263  68 setLocationWithinModule(context);
 264  68 visitor.visitLeave(author);
 265  68 setLocationWithinModule(context);
 266    }
 267   
 268  26283 public void accept(final ChapterList chapterList) throws ModuleDataException {
 269  26283 if (blocked || chapterList == null) {
 270  0 return;
 271    }
 272  26283 final String context = getCurrentContext().getLocationWithinModule();
 273  26283 visitor.visitEnter(chapterList);
 274  26271 for (int i = 0; i < chapterList.size(); i++) {
 275  107537 setLocationWithinModule(context + ".get(" + i + ")");
 276  107537 accept(chapterList.get(i));
 277    }
 278  231 setLocationWithinModule(context);
 279  231 visitor.visitLeave(chapterList);
 280  231 setLocationWithinModule(context);
 281    }
 282   
 283  107537 public void accept(final Chapter chapter) throws ModuleDataException {
 284  107537 if (blocked || chapter == null) {
 285  1260 return;
 286    }
 287  106277 final String context = getCurrentContext().getLocationWithinModule();
 288  106277 visitor.visitEnter(chapter);
 289  106135 if (chapter.getTitle() != null) {
 290  106135 setLocationWithinModule(context + ".getTitle()");
 291  106135 accept(chapter.getTitle());
 292    }
 293  105889 if (chapter.getIntroduction() != null) {
 294  105886 setLocationWithinModule(context + ".getIntroduction()");
 295  105886 accept(chapter.getIntroduction());
 296    }
 297  105653 if (chapter.getSectionList() != null) {
 298  54027 setLocationWithinModule(context + ".getSectionList()");
 299  54027 accept(chapter.getSectionList());
 300    }
 301  80237 setLocationWithinModule(context);
 302  80237 visitor.visitLeave(chapter);
 303  80237 setLocationWithinModule(context);
 304    }
 305   
 306  194 public void accept(final LiteratureItemList literatureItemList)
 307    throws ModuleDataException {
 308  194 if (blocked || literatureItemList == null) {
 309  0 return;
 310    }
 311  194 final String context = getCurrentContext().getLocationWithinModule();
 312  194 visitor.visitEnter(literatureItemList);
 313  188 for (int i = 0; i < literatureItemList.size(); i++) {
 314  636 setLocationWithinModule(context + ".get(" + i + ")");
 315  636 accept(literatureItemList.get(i));
 316    }
 317  24 setLocationWithinModule(context);
 318  24 visitor.visitLeave(literatureItemList);
 319  24 setLocationWithinModule(context);
 320    }
 321   
 322  636 public void accept(final LiteratureItem item) throws ModuleDataException {
 323  636 if (blocked || item == null) {
 324  0 return;
 325    }
 326  636 final String context = getCurrentContext().getLocationWithinModule();
 327  636 visitor.visitEnter(item);
 328  570 if (item.getItem() != null) {
 329  570 setLocationWithinModule(context + ".getItem()");
 330  570 accept(item.getItem());
 331    }
 332  472 setLocationWithinModule(context);
 333  472 visitor.visitLeave(item);
 334  472 setLocationWithinModule(context);
 335    }
 336   
 337  54027 public void accept(final SectionList sectionList) throws ModuleDataException {
 338  54027 if (blocked || sectionList == null) {
 339  28418 return;
 340    }
 341  25609 final String context = getCurrentContext().getLocationWithinModule();
 342  25609 visitor.visitEnter(sectionList);
 343  25534 for (int i = 0; i < sectionList.size(); i++) {
 344  67597 setLocationWithinModule(context + ".get(" + i + ")");
 345  67597 accept(sectionList.get(i));
 346    }
 347  193 setLocationWithinModule(context);
 348  193 visitor.visitLeave(sectionList);
 349  193 setLocationWithinModule(context);
 350    }
 351   
 352  67597 public void accept(final Section section) throws ModuleDataException {
 353  67597 if (blocked || section == null) {
 354  0 return;
 355    }
 356  67597 final String context = getCurrentContext().getLocationWithinModule();
 357  67597 visitor.visitEnter(section);
 358  67364 if (section.getTitle() != null) {
 359  67364 setLocationWithinModule(context + ".getTitle()");
 360  67364 accept(section.getTitle());
 361    }
 362  66884 if (section.getIntroduction() != null) {
 363  66881 setLocationWithinModule(context + ".getIntroduction()");
 364  66881 accept(section.getIntroduction());
 365    }
 366  66454 if (section.getSubsectionList() != null) {
 367  55002 setLocationWithinModule(context + ".getSubsectionList()");
 368  55002 accept(section.getSubsectionList());
 369    }
 370  42256 setLocationWithinModule(context);
 371  42256 visitor.visitLeave(section);
 372  42256 setLocationWithinModule(context);
 373    }
 374   
 375  55002 public void accept(final SubsectionList subsectionList) throws ModuleDataException {
 376  55002 if (blocked || subsectionList == null) {
 377  30538 return;
 378    }
 379  24464 final String context = getCurrentContext().getLocationWithinModule();
 380  24464 visitor.visitEnter(subsectionList);
 381  24355 for (int i = 0; i < subsectionList.size(); i++) {
 382  133304 setLocationWithinModule(context + ".get(" + i + ")");
 383    // TODO mime 20050608: here the Subsection context is type dependently specified
 384  133304 if (subsectionList.get(i) instanceof Subsection) {
 385  3618 accept((Subsection) subsectionList.get(i));
 386  129686 } else if (subsectionList.get(i) instanceof Node) {
 387  129686 accept((Node) subsectionList.get(i));
 388  0 } else if (subsectionList.get(i) == null) {
 389    // ignore
 390    } else {
 391  0 throw new IllegalArgumentException("unexpected subsection type: "
 392    + subsectionList.get(i).getClass());
 393    }
 394    }
 395  266 setLocationWithinModule(context);
 396  266 visitor.visitLeave(subsectionList);
 397  266 setLocationWithinModule(context);
 398    }
 399   
 400  3618 public void accept(final Subsection subsection) throws ModuleDataException {
 401  3618 if (blocked || subsection == null) {
 402  0 return;
 403    }
 404  3618 final String context = getCurrentContext().getLocationWithinModule();
 405  3618 visitor.visitEnter(subsection);
 406  3524 if (subsection.getTitle() != null) {
 407  1654 setLocationWithinModule(context + ".getTitle()");
 408  1654 accept(subsection.getTitle());
 409    }
 410  3404 if (subsection.getLatex() != null) {
 411  3404 setLocationWithinModule(context + ".getLatex()");
 412  3404 accept(subsection.getLatex());
 413    }
 414  3254 setLocationWithinModule(context);
 415  3254 visitor.visitLeave(subsection);
 416  3254 setLocationWithinModule(context);
 417    }
 418   
 419  129686 public void accept(final Node node) throws ModuleDataException {
 420  129686 if (blocked || node == null) {
 421  0 return;
 422    }
 423  129686 final String context = getCurrentContext().getLocationWithinModule();
 424  129686 visitor.visitEnter(node);
 425  128487 if (node.getName() != null) {
 426  60150 setLocationWithinModule(context + ".getName()");
 427  60150 accept(node.getName());
 428    }
 429  127833 if (node.getTitle() != null) {
 430  59496 setLocationWithinModule(context + ".getTitle()");
 431  59496 accept(node.getTitle());
 432    }
 433  127179 if (node.getPrecedingText() != null) {
 434  126142 setLocationWithinModule(context + ".getPrecedingText()");
 435  126142 accept(node.getPrecedingText());
 436    }
 437  125823 if (node.getNodeType() != null) {
 438  125823 setLocationWithinModule(context + ".getNodeType()");
 439  125823 if (node.getNodeType() instanceof Axiom) {
 440  15895 setLocationWithinModule(context + ".getNodeType().getAxiom()");
 441  15895 accept((Axiom) node.getNodeType());
 442  109928 } else if (node.getNodeType() instanceof PredicateDefinition) {
 443  17053 setLocationWithinModule(context + ".getNodeType().getPredicateDefinition()");
 444  17053 accept((PredicateDefinition) node.getNodeType());
 445  92875 } else if (node.getNodeType() instanceof FunctionDefinition) {
 446  22266 setLocationWithinModule(context + ".getNodeType().getFunctionDefinition()");
 447  22266 accept((FunctionDefinition) node.getNodeType());
 448  70609 } else if (node.getNodeType() instanceof Proposition) {
 449  67587 setLocationWithinModule(context + ".getNodeType().getProposition()");
 450  67587 accept((Proposition) node.getNodeType());
 451  3022 } else if (node.getNodeType() instanceof Rule) {
 452  3022 setLocationWithinModule(context + ".getNodeType().getRule()");
 453  3022 accept((Rule) node.getNodeType());
 454    } else {
 455  0 throw new IllegalArgumentException("unexpected node type: "
 456    + node.getNodeType().getClass());
 457    }
 458    }
 459  106237 if (node.getSucceedingText() != null) {
 460  27229 setLocationWithinModule(context + ".getSucceedingText()");
 461  27229 accept(node.getSucceedingText());
 462    }
 463  105961 setLocationWithinModule(context);
 464  105961 visitor.visitLeave(node);
 465  105961 setLocationWithinModule(context);
 466    }
 467   
 468  15895 public void accept(final Axiom axiom) throws ModuleDataException {
 469  15895 if (blocked || axiom == null) {
 470  13515 return;
 471    }
 472  2380 final String context = getCurrentContext().getLocationWithinModule();
 473  2380 visitor.visitEnter(axiom);
 474  2280 if (axiom.getFormula() != null) {
 475  2280 setLocationWithinModule(context + ".getFormula()");
 476  2280 accept(axiom.getFormula());
 477    }
 478  299 if (axiom.getDescription() != null) {
 479  0 setLocationWithinModule(context + ".getDescription()");
 480  0 accept(axiom.getDescription());
 481    }
 482  299 setLocationWithinModule(context);
 483  299 visitor.visitLeave(axiom);
 484  299 setLocationWithinModule(context);
 485    }
 486   
 487  17053 public void accept(final PredicateDefinition definition)
 488    throws ModuleDataException {
 489  17053 if (blocked || definition == null) {
 490  15590 return;
 491    }
 492  1463 final String context = getCurrentContext().getLocationWithinModule();
 493  1463 visitor.visitEnter(definition);
 494  1319 if (definition.getVariableList() != null) {
 495  1319 setLocationWithinModule(context + ".getVariableList()");
 496  1319 accept(definition.getVariableList());
 497    }
 498  1049 if (definition.getFormula() != null) {
 499  991 setLocationWithinModule(context + ".getFormula()");
 500  991 accept(definition.getFormula());
 501    }
 502  243 if (definition.getDescription() != null) {
 503  0 setLocationWithinModule(context + ".getDescription()");
 504  0 accept(definition.getDescription());
 505    }
 506  243 setLocationWithinModule(context);
 507  243 visitor.visitLeave(definition);
 508  243 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  67587 public void accept(final Proposition proposition) throws ModuleDataException {
 535  67587 if (blocked || proposition == null) {
 536  52642 return;
 537    }
 538  14945 final String context = getCurrentContext().getLocationWithinModule();
 539  14945 visitor.visitEnter(proposition);
 540  14621 if (proposition.getFormula() != null) {
 541  14621 setLocationWithinModule(context + ".getFormula()");
 542  14621 accept(proposition.getFormula());
 543    }
 544  979 if (proposition.getDescription() != null) {
 545  74 setLocationWithinModule(context + ".getDescription()");
 546  74 accept(proposition.getDescription());
 547    }
 548  965 if (proposition.getProofList() != null) {
 549  237 setLocationWithinModule(context + ".getProofList()");
 550  237 accept(proposition.getProofList());
 551    }
 552  812 setLocationWithinModule(context);
 553  812 visitor.visitLeave(proposition);
 554  812 setLocationWithinModule(context);
 555    }
 556   
 557  3022 public void accept(final Rule rule) throws ModuleDataException {
 558  3022 if (blocked || rule == null) {
 559  2776 return;
 560    }
 561  246 final String context = getCurrentContext().getLocationWithinModule();
 562  246 visitor.visitEnter(rule);
 563  196 if (rule.getLinkList() != null) {
 564  50 setLocationWithinModule(context + ".getLinkList()");
 565  50 accept(rule.getLinkList());
 566    }
 567  188 if (rule.getDescription() != null) {
 568  188 setLocationWithinModule(context + ".getDescription()");
 569  188 accept(rule.getDescription());
 570    }
 571  114 if (rule.getProofList() != null) {
 572  0 setLocationWithinModule(context + ".getProofList()");
 573  0 accept(rule.getProofList());
 574    }
 575  114 setLocationWithinModule(context);
 576  114 visitor.visitLeave(rule);
 577  114 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  3179 public void accept(final VariableList variableList) throws ModuleDataException {
 592  3179 if (blocked || variableList == null) {
 593  129 return;
 594    }
 595  3050 final String context = getCurrentContext().getLocationWithinModule();
 596  3050 visitor.visitEnter(variableList);
 597  2906 for (int i = 0; i < variableList.size(); i++) {
 598  4021 final String piece = context + ".get(" + i + ")";
 599  4021 setLocationWithinModule(piece);
 600  4021 if (variableList.get(i) != null) {
 601  4021 if (variableList.get(i).isList()) {
 602  4021 setLocationWithinModule(piece + ".getList()");
 603  4021 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  2486 setLocationWithinModule(context);
 614  2486 visitor.visitLeave(variableList);
 615  2486 setLocationWithinModule(context);
 616    }
 617   
 618  237 public void accept(final ProofList proofList) throws ModuleDataException {
 619  237 if (blocked || proofList == null) {
 620  40 return;
 621    }
 622  197 final String context = getCurrentContext().getLocationWithinModule();
 623  197 visitor.visitEnter(proofList);
 624  169 for (int i = 0; i < proofList.size(); i++) {
 625  169 setLocationWithinModule(context + ".get(" + i + ")");
 626  169 accept(proofList.get(i));
 627    }
 628  44 setLocationWithinModule(context);
 629  44 visitor.visitLeave(proofList);
 630  44 setLocationWithinModule(context);
 631    }
 632   
 633  169 public void accept(final Proof proof) throws ModuleDataException {
 634  169 if (blocked || proof == null) {
 635  0 return;
 636    }
 637  169 final String context = getCurrentContext().getLocationWithinModule();
 638  169 visitor.visitEnter(proof);
 639  111 if (proof.getNonFormalProof() != null) {
 640  111 setLocationWithinModule(context + ".getNonFormalProof()");
 641  111 accept(proof.getNonFormalProof());
 642    }
 643  44 setLocationWithinModule(context);
 644  44 visitor.visitLeave(proof);
 645  44 setLocationWithinModule(context);
 646    }
 647   
 648  17892 public void accept(final Formula formula) throws ModuleDataException {
 649  17892 if (blocked || formula == null) {
 650  532 return;
 651    }
 652  17360 final String context = getCurrentContext().getLocationWithinModule();
 653  17360 visitor.visitEnter(formula);
 654  16888 if (formula.getElement() != null) {
 655  16888 setLocationWithinModule(context + ".getElement()");
 656  16888 accept(formula.getElement());
 657    }
 658  931 setLocationWithinModule(context);
 659  931 visitor.visitLeave(formula);
 660  931 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  268136 public void accept(final Element element) throws ModuleDataException {
 679  268136 if (blocked || element == null) {
 680  114468 return;
 681    }
 682  153668 final String context = getCurrentContext().getLocationWithinModule();
 683  153668 if (element.isList()) {
 684  127527 setLocationWithinModule(context + ".getList()");
 685  127527 accept(element.getList());
 686  26141 } else if (element.isAtom()) {
 687  26141 setLocationWithinModule(context + ".getAtom()");
 688  26141 accept(element.getAtom());
 689    } else {
 690  0 throw new IllegalArgumentException("unexpected element type: "
 691    + element.toString());
 692    }
 693  89817 setLocationWithinModule(context);
 694    }
 695   
 696  26141 public void accept(final Atom atom) throws ModuleDataException {
 697  26141 if (blocked || atom == null) {
 698  0 return;
 699    }
 700  26141 final String context = getCurrentContext().getLocationWithinModule();
 701  26141 visitor.visitEnter(atom);
 702  26141 setLocationWithinModule(context);
 703  26141 visitor.visitLeave(atom);
 704  26141 setLocationWithinModule(context);
 705    }
 706   
 707  131548 public void accept(final ElementList list) throws ModuleDataException {
 708  131548 if (blocked || list == null) {
 709  3154 return;
 710    }
 711  128394 final String context = getCurrentContext().getLocationWithinModule();
 712  128394 visitor.visitEnter(list);
 713  110579 for (int i = 0; i < list.size(); i++) {
 714  249622 setLocationWithinModule(context + ".getElement(" + i + ")");
 715  249622 accept(list.getElement(i));
 716    }
 717  64123 setLocationWithinModule(context);
 718  64123 visitor.visitLeave(list);
 719  64123 setLocationWithinModule(context);
 720    }
 721   
 722  678474 public void accept(final LatexList latexList) throws ModuleDataException {
 723  678474 if (blocked || latexList == null) {
 724  534218 return;
 725    }
 726  144256 final String context = getCurrentContext().getLocationWithinModule();
 727  144256 visitor.visitEnter(latexList);
 728  141903 for (int i = 0; i < latexList.size(); i++) {
 729  276482 setLocationWithinModule(context + ".get(" + i + ")");
 730  276482 accept(latexList.get(i));
 731    }
 732  139309 setLocationWithinModule(context);
 733  139309 visitor.visitLeave(latexList);
 734  139309 setLocationWithinModule(context);
 735    }
 736   
 737  276563 public void accept(final Latex latex) throws ModuleDataException {
 738  276563 if (blocked || latex == null) {
 739  266274 return;
 740    }
 741  10289 final String context = getCurrentContext().getLocationWithinModule();
 742  10289 visitor.visitEnter(latex);
 743  7682 setLocationWithinModule(context);
 744  7682 visitor.visitLeave(latex);
 745  7682 setLocationWithinModule(context);
 746    }
 747   
 748    /**
 749    * Set location information where are we within the original module.
 750    *
 751    * @param locationWithinModule Location within module.
 752    */
 753  4110033 public void setLocationWithinModule(final String locationWithinModule) {
 754  4110033 getCurrentContext().setLocationWithinModule(locationWithinModule);
 755    }
 756   
 757    /**
 758    * Get current context within original.
 759    *
 760    * @return Current context.
 761    */
 762  8104851 public final ModuleContext getCurrentContext() {
 763  8104851 return currentContext;
 764    }
 765   
 766    /**
 767    * Is further transversing blocked?
 768    *
 769    * @return Is further transversing blocked?
 770    */
 771  0 public final boolean getBlocked() {
 772  0 return blocked;
 773    }
 774   
 775    /**
 776    * Set if further transversing is blocked.
 777    *
 778    * @param blocked Further transversion?
 779    */
 780  896900 public final void setBlocked(final boolean blocked) {
 781  896900 this.blocked = blocked;
 782    }
 783   
 784    }
 785