Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Sa Dez 22 2007 01:35:21 CET
file stats: LOC: 786   Methods: 40
NCLOC: 679   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
QedeqNotNullTransverser.java 79,1% 94,2% 97,5% 89,9%
coverage coverage
 1    /* $Id: QedeqNotNullTransverser.java,v 1.4 2007/12/21 23:33:47 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 java.net.URL;
 21   
 22    import org.qedeq.kernel.base.list.Atom;
 23    import org.qedeq.kernel.base.list.Element;
 24    import org.qedeq.kernel.base.list.ElementList;
 25    import org.qedeq.kernel.base.module.Author;
 26    import org.qedeq.kernel.base.module.AuthorList;
 27    import org.qedeq.kernel.base.module.Axiom;
 28    import org.qedeq.kernel.base.module.Chapter;
 29    import org.qedeq.kernel.base.module.ChapterList;
 30    import org.qedeq.kernel.base.module.Formula;
 31    import org.qedeq.kernel.base.module.FunctionDefinition;
 32    import org.qedeq.kernel.base.module.Header;
 33    import org.qedeq.kernel.base.module.Import;
 34    import org.qedeq.kernel.base.module.ImportList;
 35    import org.qedeq.kernel.base.module.Latex;
 36    import org.qedeq.kernel.base.module.LatexList;
 37    import org.qedeq.kernel.base.module.LinkList;
 38    import org.qedeq.kernel.base.module.LiteratureItem;
 39    import org.qedeq.kernel.base.module.LiteratureItemList;
 40    import org.qedeq.kernel.base.module.Location;
 41    import org.qedeq.kernel.base.module.LocationList;
 42    import org.qedeq.kernel.base.module.Node;
 43    import org.qedeq.kernel.base.module.PredicateDefinition;
 44    import org.qedeq.kernel.base.module.Proof;
 45    import org.qedeq.kernel.base.module.ProofList;
 46    import org.qedeq.kernel.base.module.Proposition;
 47    import org.qedeq.kernel.base.module.Qedeq;
 48    import org.qedeq.kernel.base.module.Rule;
 49    import org.qedeq.kernel.base.module.Section;
 50    import org.qedeq.kernel.base.module.SectionList;
 51    import org.qedeq.kernel.base.module.Specification;
 52    import org.qedeq.kernel.base.module.Subsection;
 53    import org.qedeq.kernel.base.module.SubsectionList;
 54    import org.qedeq.kernel.base.module.Term;
 55    import org.qedeq.kernel.base.module.UsedByList;
 56    import org.qedeq.kernel.base.module.VariableList;
 57    import org.qedeq.kernel.bo.module.ModuleContext;
 58    import org.qedeq.kernel.bo.module.ModuleDataException;
 59   
 60   
 61    /**
 62    * Traverse QEDEQ module. Calls visitors of {@link org.qedeq.kernel.bo.visitor.QedeqVisitor}
 63    * for non <code>null</code> arguments.
 64    *
 65    * @version $Revision: 1.4 $
 66    * @author Michael Meyling
 67    */
 68    public class QedeqNotNullTransverser implements QedeqTransverser {
 69   
 70    /** Current context during creation. */
 71    private ModuleContext currentContext;
 72   
 73    /**
 74    * These methods are called if a node is visited. To start the whole process just call
 75    * {@link #accept(Qedeq)}.
 76    */
 77    private QedeqVisitor visitor;
 78   
 79    /** Is sub node traversion currently blocked? */
 80    private boolean blocked;
 81   
 82    /**
 83    * Constructor.
 84    *
 85    * @param globalContext Module location information.
 86    * @param visitor These methods are called if a node is visited.
 87    */
 88  35880 public QedeqNotNullTransverser(final URL globalContext, final QedeqVisitor visitor) {
 89  35880 currentContext = new ModuleContext(globalContext);
 90  35880 this.visitor = visitor;
 91    }
 92   
 93  35878 public void accept(final Qedeq qedeq) throws ModuleDataException {
 94  35878 getCurrentContext().setLocationWithinModule("");
 95  35878 blocked = false;
 96  35878 if (qedeq == null) {
 97  0 throw new NullPointerException("null QEDEQ module");
 98    }
 99  35878 final String context = getCurrentContext().getLocationWithinModule();
 100  35878 visitor.visitEnter(qedeq);
 101  35876 if (qedeq.getHeader() != null) {
 102  35876 getCurrentContext().setLocationWithinModule(context + "getHeader()");
 103  35876 accept(qedeq.getHeader());
 104    }
 105  30699 if (qedeq.getChapterList() != null) {
 106  30699 getCurrentContext().setLocationWithinModule(context + "getChapterList()");
 107  30699 accept(qedeq.getChapterList());
 108    }
 109  715 if (qedeq.getLiteratureItemList() != null) {
 110  217 getCurrentContext().setLocationWithinModule(context + "getLiteratureItemList()");
 111  217 accept(qedeq.getLiteratureItemList());
 112    }
 113  545 setLocationWithinModule(context);
 114  545 visitor.visitLeave(qedeq);
 115  545 setLocationWithinModule(context);
 116    }
 117   
 118  35876 public void accept(final Header header) throws ModuleDataException {
 119  35876 if (blocked || header == null) {
 120  0 return;
 121    }
 122  35876 final String context = getCurrentContext().getLocationWithinModule();
 123  35876 visitor.visitEnter(header);
 124  35852 if (header.getSpecification() != null) {
 125  35852 setLocationWithinModule(context + ".getSpecification()");
 126  35852 accept(header.getSpecification());
 127    }
 128  35745 if (header.getTitle() != null) {
 129  35745 setLocationWithinModule(context + ".getTitle()");
 130  35745 accept(header.getTitle());
 131    }
 132  35699 if (header.getSummary() != null) {
 133  35699 setLocationWithinModule(context + ".getSummary()");
 134  35699 accept(header.getSummary());
 135    }
 136  35653 if (header.getAuthorList() != null) {
 137  35653 setLocationWithinModule(context + ".getAuthorList()");
 138  35653 accept(header.getAuthorList());
 139    }
 140  35581 if (header.getImportList() != null) {
 141  29058 setLocationWithinModule(context + ".getImportList()");
 142  29058 accept(header.getImportList());
 143    }
 144  30754 if (header.getUsedByList() != null) {
 145  6462 setLocationWithinModule(context + ".getUsedByList()");
 146  6462 accept(header.getUsedByList());
 147    }
 148  30699 setLocationWithinModule(context);
 149  30699 visitor.visitLeave(header);
 150  30699 setLocationWithinModule(context);
 151    }
 152   
 153  6462 public void accept(final UsedByList usedByList) throws ModuleDataException {
 154  6462 if (blocked || usedByList == null) {
 155  6323 return;
 156    }
 157  139 final String context = getCurrentContext().getLocationWithinModule();
 158  139 visitor.visitEnter(usedByList);
 159  129 for (int i = 0; i < usedByList.size(); i++) {
 160  129 setLocationWithinModule(context + ".get(" + i + ")");
 161  129 accept(usedByList.get(i));
 162    }
 163  84 setLocationWithinModule(context);
 164  84 visitor.visitLeave(usedByList);
 165  84 setLocationWithinModule(context);
 166    }
 167   
 168  29058 public void accept(final ImportList importList) throws ModuleDataException {
 169  29058 if (blocked || importList == null) {
 170  23781 return;
 171    }
 172  5277 final String context = getCurrentContext().getLocationWithinModule();
 173  5277 visitor.visitEnter(importList);
 174  5265 for (int i = 0; i < importList.size(); i++) {
 175  6195 setLocationWithinModule(context + ".get(" + i + ")");
 176  6195 accept(importList.get(i));
 177    }
 178  450 setLocationWithinModule(context);
 179  450 visitor.visitLeave(importList);
 180  450 setLocationWithinModule(context);
 181    }
 182   
 183  6195 public void accept(final Import imp) throws ModuleDataException {
 184  6195 if (blocked || imp == null) {
 185  66 return;
 186    }
 187  6129 final String context = getCurrentContext().getLocationWithinModule();
 188  6129 visitor.visitEnter(imp);
 189  1392 if (imp.getSpecification() != null) {
 190  1392 setLocationWithinModule(context + ".getSpecification()");
 191  1392 accept(imp.getSpecification());
 192    }
 193  1314 setLocationWithinModule(context);
 194  1314 visitor.visitLeave(imp);
 195  1314 setLocationWithinModule(context);
 196    }
 197   
 198  37373 public void accept(final Specification specification) throws ModuleDataException {
 199  37373 if (blocked || specification == null) {
 200  30705 return;
 201    }
 202  6668 final String context = getCurrentContext().getLocationWithinModule();
 203  6668 visitor.visitEnter(specification);
 204  6568 if (specification.getLocationList() != null) {
 205  6568 setLocationWithinModule(context + ".getLocationList()");
 206  6568 accept(specification.getLocationList());
 207    }
 208  6438 setLocationWithinModule(context);
 209  6438 visitor.visitLeave(specification);
 210  6438 setLocationWithinModule(context);
 211    }
 212   
 213  6568 public void accept(final LocationList locationList) throws ModuleDataException {
 214  6568 if (blocked || locationList == null) {
 215  2678 return;
 216    }
 217  3890 final String context = getCurrentContext().getLocationWithinModule();
 218  3890 visitor.visitEnter(locationList);
 219  3838 for (int i = 0; i < locationList.size(); i++) {
 220  3925 setLocationWithinModule(context + ".get(" + i + ")");
 221  3925 accept(locationList.get(i));
 222    }
 223  3760 setLocationWithinModule(context);
 224  3760 visitor.visitLeave(locationList);
 225  3760 setLocationWithinModule(context);
 226    }
 227   
 228  3925 public void accept(final Location location) throws ModuleDataException {
 229  3925 if (blocked || location == null) {
 230  0 return;
 231    }
 232  3925 final String context = getCurrentContext().getLocationWithinModule();
 233  3925 visitor.visitEnter(location);
 234  3848 setLocationWithinModule(context);
 235  3847 visitor.visitLeave(location);
 236  3847 setLocationWithinModule(context);
 237    }
 238   
 239  35653 public void accept(final AuthorList authorList) throws ModuleDataException {
 240  35653 if (blocked || authorList == null) {
 241  30137 return;
 242    }
 243  5516 final String context = getCurrentContext().getLocationWithinModule();
 244  5516 visitor.visitEnter(authorList);
 245  5492 for (int i = 0; i < authorList.size(); i++) {
 246  5492 setLocationWithinModule(context + ".get(" + i + ")");
 247  5492 accept(authorList.get(i));
 248    }
 249  5444 setLocationWithinModule(context);
 250  5444 visitor.visitLeave(authorList);
 251  5444 setLocationWithinModule(context);
 252    }
 253   
 254  5492 public void accept(final Author author) throws ModuleDataException {
 255  5492 if (blocked || author == null) {
 256  2514 return;
 257    }
 258  2978 final String context = getCurrentContext().getLocationWithinModule();
 259  2978 visitor.visitEnter(author);
 260  2943 if (author.getName() != null) {
 261  2943 setLocationWithinModule(context + ".getName()");
 262  2943 accept(author.getName());
 263    }
 264  2930 setLocationWithinModule(context);
 265  2930 visitor.visitLeave(author);
 266  2930 setLocationWithinModule(context);
 267    }
 268   
 269  30699 public void accept(final ChapterList chapterList) throws ModuleDataException {
 270  30699 if (blocked || chapterList == null) {
 271  27 return;
 272    }
 273  30672 final String context = getCurrentContext().getLocationWithinModule();
 274  30672 visitor.visitEnter(chapterList);
 275  30660 for (int i = 0; i < chapterList.size(); i++) {
 276  131679 setLocationWithinModule(context + ".get(" + i + ")");
 277  131679 accept(chapterList.get(i));
 278    }
 279  688 setLocationWithinModule(context);
 280  688 visitor.visitLeave(chapterList);
 281  688 setLocationWithinModule(context);
 282    }
 283   
 284  131679 public void accept(final Chapter chapter) throws ModuleDataException {
 285  131679 if (blocked || chapter == null) {
 286  1260 return;
 287    }
 288  130419 final String context = getCurrentContext().getLocationWithinModule();
 289  130419 visitor.visitEnter(chapter);
 290  130277 if (chapter.getTitle() != null) {
 291  130277 setLocationWithinModule(context + ".getTitle()");
 292  130277 accept(chapter.getTitle());
 293    }
 294  130031 if (chapter.getIntroduction() != null) {
 295  129644 setLocationWithinModule(context + ".getIntroduction()");
 296  129644 accept(chapter.getIntroduction());
 297    }
 298  129795 if (chapter.getSectionList() != null) {
 299  65989 setLocationWithinModule(context + ".getSectionList()");
 300  65989 accept(chapter.getSectionList());
 301    }
 302  100447 setLocationWithinModule(context);
 303  100447 visitor.visitLeave(chapter);
 304  100447 setLocationWithinModule(context);
 305    }
 306   
 307  217 public void accept(final LiteratureItemList literatureItemList)
 308    throws ModuleDataException {
 309  217 if (blocked || literatureItemList == null) {
 310  1 return;
 311    }
 312  216 final String context = getCurrentContext().getLocationWithinModule();
 313  216 visitor.visitEnter(literatureItemList);
 314  210 for (int i = 0; i < literatureItemList.size(); i++) {
 315  766 setLocationWithinModule(context + ".get(" + i + ")");
 316  766 accept(literatureItemList.get(i));
 317    }
 318  46 setLocationWithinModule(context);
 319  46 visitor.visitLeave(literatureItemList);
 320  46 setLocationWithinModule(context);
 321    }
 322   
 323  766 public void accept(final LiteratureItem item) throws ModuleDataException {
 324  766 if (blocked || item == null) {
 325  0 return;
 326    }
 327  766 final String context = getCurrentContext().getLocationWithinModule();
 328  766 visitor.visitEnter(item);
 329  700 if (item.getItem() != null) {
 330  700 setLocationWithinModule(context + ".getItem()");
 331  700 accept(item.getItem());
 332    }
 333  602 setLocationWithinModule(context);
 334  602 visitor.visitLeave(item);
 335  602 setLocationWithinModule(context);
 336    }
 337   
 338  65989 public void accept(final SectionList sectionList) throws ModuleDataException {
 339  65989 if (blocked || sectionList == null) {
 340  36226 return;
 341    }
 342  29763 final String context = getCurrentContext().getLocationWithinModule();
 343  29763 visitor.visitEnter(sectionList);
 344  29688 for (int i = 0; i < sectionList.size(); i++) {
 345  73639 setLocationWithinModule(context + ".get(" + i + ")");
 346  73639 accept(sectionList.get(i));
 347    }
 348  415 setLocationWithinModule(context);
 349  415 visitor.visitLeave(sectionList);
 350  415 setLocationWithinModule(context);
 351    }
 352   
 353  73639 public void accept(final Section section) throws ModuleDataException {
 354  73639 if (blocked || section == null) {
 355  0 return;
 356    }
 357  73639 final String context = getCurrentContext().getLocationWithinModule();
 358  73639 visitor.visitEnter(section);
 359  73406 if (section.getTitle() != null) {
 360  73406 setLocationWithinModule(context + ".getTitle()");
 361  73406 accept(section.getTitle());
 362    }
 363  72926 if (section.getIntroduction() != null) {
 364  72884 setLocationWithinModule(context + ".getIntroduction()");
 365  72884 accept(section.getIntroduction());
 366    }
 367  72492 if (section.getSubsectionList() != null) {
 368  60887 setLocationWithinModule(context + ".getSubsectionList()");
 369  60887 accept(section.getSubsectionList());
 370    }
 371  44366 setLocationWithinModule(context);
 372  44366 visitor.visitLeave(section);
 373  44366 setLocationWithinModule(context);
 374    }
 375   
 376  60887 public void accept(final SubsectionList subsectionList) throws ModuleDataException {
 377  60887 if (blocked || subsectionList == null) {
 378  32222 return;
 379    }
 380  28665 final String context = getCurrentContext().getLocationWithinModule();
 381  28665 visitor.visitEnter(subsectionList);
 382  28548 for (int i = 0; i < subsectionList.size(); i++) {
 383  142876 setLocationWithinModule(context + ".get(" + i + ")");
 384    // TODO mime 20050608: here the Subsection context is type dependently specified
 385  142876 if (subsectionList.get(i) instanceof Subsection) {
 386  3838 accept((Subsection) subsectionList.get(i));
 387  139038 } else if (subsectionList.get(i) instanceof Node) {
 388  139038 accept((Node) subsectionList.get(i));
 389  0 } else if (subsectionList.get(i) == null) {
 390    // ignore
 391    } else {
 392  0 throw new IllegalArgumentException("unexpected subsection type: "
 393    + subsectionList.get(i).getClass());
 394    }
 395    }
 396  539 setLocationWithinModule(context);
 397  539 visitor.visitLeave(subsectionList);
 398  539 setLocationWithinModule(context);
 399    }
 400   
 401  3838 public void accept(final Subsection subsection) throws ModuleDataException {
 402  3838 if (blocked || subsection == null) {
 403  0 return;
 404    }
 405  3838 final String context = getCurrentContext().getLocationWithinModule();
 406  3838 visitor.visitEnter(subsection);
 407  3744 if (subsection.getTitle() != null) {
 408  1834 setLocationWithinModule(context + ".getTitle()");
 409  1834 accept(subsection.getTitle());
 410    }
 411  3624 if (subsection.getLatex() != null) {
 412  3624 setLocationWithinModule(context + ".getLatex()");
 413  3624 accept(subsection.getLatex());
 414    }
 415  3474 setLocationWithinModule(context);
 416  3474 visitor.visitLeave(subsection);
 417  3474 setLocationWithinModule(context);
 418    }
 419   
 420  139038 public void accept(final Node node) throws ModuleDataException {
 421  139038 if (blocked || node == null) {
 422  0 return;
 423    }
 424  139038 final String context = getCurrentContext().getLocationWithinModule();
 425  139038 visitor.visitEnter(node);
 426  137801 if (node.getName() != null) {
 427  69095 setLocationWithinModule(context + ".getName()");
 428  69095 accept(node.getName());
 429    }
 430  137115 if (node.getTitle() != null) {
 431  68409 setLocationWithinModule(context + ".getTitle()");
 432  68409 accept(node.getTitle());
 433    }
 434  136429 if (node.getPrecedingText() != null) {
 435  135242 setLocationWithinModule(context + ".getPrecedingText()");
 436  135242 accept(node.getPrecedingText());
 437    }
 438  135041 if (node.getNodeType() != null) {
 439  135041 setLocationWithinModule(context + ".getNodeType()");
 440  135041 if (node.getNodeType() instanceof Axiom) {
 441  16150 setLocationWithinModule(context + ".getNodeType().getAxiom()");
 442  16150 accept((Axiom) node.getNodeType());
 443  118891 } else if (node.getNodeType() instanceof PredicateDefinition) {
 444  21684 setLocationWithinModule(context + ".getNodeType().getPredicateDefinition()");
 445  21684 accept((PredicateDefinition) node.getNodeType());
 446  97207 } else if (node.getNodeType() instanceof FunctionDefinition) {
 447  22362 setLocationWithinModule(context + ".getNodeType().getFunctionDefinition()");
 448  22362 accept((FunctionDefinition) node.getNodeType());
 449  74845 } else if (node.getNodeType() instanceof Proposition) {
 450  71698 setLocationWithinModule(context + ".getNodeType().getProposition()");
 451  71698 accept((Proposition) node.getNodeType());
 452  3147 } else if (node.getNodeType() instanceof Rule) {
 453  3147 setLocationWithinModule(context + ".getNodeType().getRule()");
 454  3147 accept((Rule) node.getNodeType());
 455    } else {
 456  0 throw new IllegalArgumentException("unexpected node type: "
 457    + node.getNodeType().getClass());
 458    }
 459    }
 460  111669 if (node.getSucceedingText() != null) {
 461  27494 setLocationWithinModule(context + ".getSucceedingText()");
 462  27494 accept(node.getSucceedingText());
 463    }
 464  111393 setLocationWithinModule(context);
 465  111393 visitor.visitLeave(node);
 466  111393 setLocationWithinModule(context);
 467    }
 468   
 469  16150 public void accept(final Axiom axiom) throws ModuleDataException {
 470  16150 if (blocked || axiom == null) {
 471  13522 return;
 472    }
 473  2628 final String context = getCurrentContext().getLocationWithinModule();
 474  2628 visitor.visitEnter(axiom);
 475  2521 if (axiom.getFormula() != null) {
 476  2521 setLocationWithinModule(context + ".getFormula()");
 477  2521 accept(axiom.getFormula());
 478    }
 479  532 if (axiom.getDescription() != null) {
 480  0 setLocationWithinModule(context + ".getDescription()");
 481  0 accept(axiom.getDescription());
 482    }
 483  532 setLocationWithinModule(context);
 484  532 visitor.visitLeave(axiom);
 485  532 setLocationWithinModule(context);
 486    }
 487   
 488  21684 public void accept(final PredicateDefinition definition)
 489    throws ModuleDataException {
 490  21684 if (blocked || definition == null) {
 491  19921 return;
 492    }
 493  1763 final String context = getCurrentContext().getLocationWithinModule();
 494  1763 visitor.visitEnter(definition);
 495  1599 if (definition.getVariableList() != null) {
 496  1489 setLocationWithinModule(context + ".getVariableList()");
 497  1489 accept(definition.getVariableList());
 498    }
 499  1329 if (definition.getFormula() != null) {
 500  1226 setLocationWithinModule(context + ".getFormula()");
 501  1226 accept(definition.getFormula());
 502    }
 503  467 if (definition.getDescription() != null) {
 504  0 setLocationWithinModule(context + ".getDescription()");
 505  0 accept(definition.getDescription());
 506    }
 507  467 setLocationWithinModule(context);
 508  467 visitor.visitLeave(definition);
 509  467 setLocationWithinModule(context);
 510    }
 511   
 512  22362 public void accept(final FunctionDefinition definition) throws ModuleDataException {
 513  22362 if (blocked || definition == null) {
 514  19980 return;
 515    }
 516  2382 final String context = getCurrentContext().getLocationWithinModule();
 517  2382 visitor.visitEnter(definition);
 518  2190 if (definition.getVariableList() != null) {
 519  1938 setLocationWithinModule(context + ".getVariableList()");
 520  1938 accept(definition.getVariableList());
 521    }
 522  1896 if (definition.getTerm() != null) {
 523  1896 setLocationWithinModule(context + ".getTerm()");
 524  1896 accept(definition.getTerm());
 525    }
 526  362 if (definition.getDescription() != null) {
 527  0 setLocationWithinModule(context + ".getDescription()");
 528  0 accept(definition.getDescription());
 529    }
 530  362 setLocationWithinModule(context);
 531  362 visitor.visitLeave(definition);
 532  362 setLocationWithinModule(context);
 533    }
 534   
 535  71698 public void accept(final Proposition proposition) throws ModuleDataException {
 536  71698 if (blocked || proposition == null) {
 537  52642 return;
 538    }
 539  19056 final String context = getCurrentContext().getLocationWithinModule();
 540  19056 visitor.visitEnter(proposition);
 541  18722 if (proposition.getFormula() != null) {
 542  18722 setLocationWithinModule(context + ".getFormula()");
 543  18722 accept(proposition.getFormula());
 544    }
 545  1395 if (proposition.getDescription() != null) {
 546  80 setLocationWithinModule(context + ".getDescription()");
 547  80 accept(proposition.getDescription());
 548    }
 549  1381 if (proposition.getProofList() != null) {
 550  297 setLocationWithinModule(context + ".getProofList()");
 551  297 accept(proposition.getProofList());
 552    }
 553  1228 setLocationWithinModule(context);
 554  1228 visitor.visitLeave(proposition);
 555  1228 setLocationWithinModule(context);
 556    }
 557   
 558  3147 public void accept(final Rule rule) throws ModuleDataException {
 559  3147 if (blocked || rule == null) {
 560  2776 return;
 561    }
 562  371 final String context = getCurrentContext().getLocationWithinModule();
 563  371 visitor.visitEnter(rule);
 564  321 if (rule.getLinkList() != null) {
 565  56 setLocationWithinModule(context + ".getLinkList()");
 566  56 accept(rule.getLinkList());
 567    }
 568  313 if (rule.getDescription() != null) {
 569  313 setLocationWithinModule(context + ".getDescription()");
 570  313 accept(rule.getDescription());
 571    }
 572  239 if (rule.getProofList() != null) {
 573  0 setLocationWithinModule(context + ".getProofList()");
 574  0 accept(rule.getProofList());
 575    }
 576  239 setLocationWithinModule(context);
 577  239 visitor.visitLeave(rule);
 578  239 setLocationWithinModule(context);
 579    }
 580   
 581  56 public void accept(final LinkList linkList) throws ModuleDataException {
 582  56 if (blocked || linkList == null) {
 583  19 return;
 584    }
 585  37 final String context = getCurrentContext().getLocationWithinModule();
 586  37 visitor.visitEnter(linkList);
 587  29 setLocationWithinModule(context);
 588  29 visitor.visitLeave(linkList);
 589  29 setLocationWithinModule(context);
 590    }
 591   
 592  3427 public void accept(final VariableList variableList) throws ModuleDataException {
 593  3427 if (blocked || variableList == null) {
 594  138 return;
 595    }
 596  3289 final String context = getCurrentContext().getLocationWithinModule();
 597  3289 visitor.visitEnter(variableList);
 598  3145 for (int i = 0; i < variableList.size(); i++) {
 599  4390 final String piece = context + ".get(" + i + ")";
 600  4390 setLocationWithinModule(piece);
 601  4390 if (variableList.get(i) != null) {
 602  4390 if (variableList.get(i).isList()) {
 603  4390 setLocationWithinModule(piece + ".getList()");
 604  4390 accept(variableList.get(i).getList());
 605  0 } else if (variableList.get(i).isAtom()) {
 606  0 setLocationWithinModule(piece + ".getAtom()");
 607  0 accept(variableList.get(i).getAtom());
 608    } else {
 609  0 throw new IllegalArgumentException("unexpected element type: "
 610    + variableList.get(i).toString());
 611    }
 612    }
 613    }
 614  2725 setLocationWithinModule(context);
 615  2725 visitor.visitLeave(variableList);
 616  2725 setLocationWithinModule(context);
 617    }
 618   
 619  297 public void accept(final ProofList proofList) throws ModuleDataException {
 620  297 if (blocked || proofList == null) {
 621  39 return;
 622    }
 623  258 final String context = getCurrentContext().getLocationWithinModule();
 624  258 visitor.visitEnter(proofList);
 625  230 for (int i = 0; i < proofList.size(); i++) {
 626  230 setLocationWithinModule(context + ".get(" + i + ")");
 627  230 accept(proofList.get(i));
 628    }
 629  105 setLocationWithinModule(context);
 630  105 visitor.visitLeave(proofList);
 631  105 setLocationWithinModule(context);
 632    }
 633   
 634  230 public void accept(final Proof proof) throws ModuleDataException {
 635  230 if (blocked || proof == null) {
 636  0 return;
 637    }
 638  230 final String context = getCurrentContext().getLocationWithinModule();
 639  230 visitor.visitEnter(proof);
 640  172 if (proof.getNonFormalProof() != null) {
 641  172 setLocationWithinModule(context + ".getNonFormalProof()");
 642  172 accept(proof.getNonFormalProof());
 643    }
 644  105 setLocationWithinModule(context);
 645  105 visitor.visitLeave(proof);
 646  105 setLocationWithinModule(context);
 647    }
 648   
 649  22469 public void accept(final Formula formula) throws ModuleDataException {
 650  22469 if (blocked || formula == null) {
 651  577 return;
 652    }
 653  21892 final String context = getCurrentContext().getLocationWithinModule();
 654  21892 visitor.visitEnter(formula);
 655  21404 if (formula.getElement() != null) {
 656  21404 setLocationWithinModule(context + ".getElement()");
 657  21404 accept(formula.getElement());
 658    }
 659  1714 setLocationWithinModule(context);
 660  1714 visitor.visitLeave(formula);
 661  1714 setLocationWithinModule(context);
 662    }
 663   
 664  1896 public void accept(final Term term) throws ModuleDataException {
 665  1896 if (blocked || term == null) {
 666  80 return;
 667    }
 668  1816 final String context = getCurrentContext().getLocationWithinModule();
 669  1816 visitor.visitEnter(term);
 670  1720 if (term.getElement() != null) {
 671  1720 setLocationWithinModule(context + ".getElement()");
 672  1720 accept(term.getElement());
 673    }
 674  282 setLocationWithinModule(context);
 675  282 visitor.visitLeave(term);
 676  282 setLocationWithinModule(context);
 677    }
 678   
 679  470584 public void accept(final Element element) throws ModuleDataException {
 680  470584 if (blocked || element == null) {
 681  213522 return;
 682    }
 683  257062 final String context = getCurrentContext().getLocationWithinModule();
 684  257062 if (element.isList()) {
 685  215777 setLocationWithinModule(context + ".getList()");
 686  215777 accept(element.getList());
 687  41285 } else if (element.isAtom()) {
 688  41285 setLocationWithinModule(context + ".getAtom()");
 689  41285 accept(element.getAtom());
 690    } else {
 691  0 throw new IllegalArgumentException("unexpected element type: "
 692    + element.toString());
 693    }
 694  178326 setLocationWithinModule(context);
 695    }
 696   
 697  41285 public void accept(final Atom atom) throws ModuleDataException {
 698  41285 if (blocked || atom == null) {
 699  0 return;
 700    }
 701  41285 final String context = getCurrentContext().getLocationWithinModule();
 702  41285 visitor.visitEnter(atom);
 703  41285 setLocationWithinModule(context);
 704  41285 visitor.visitLeave(atom);
 705  41285 setLocationWithinModule(context);
 706    }
 707   
 708  220167 public void accept(final ElementList list) throws ModuleDataException {
 709  220167 if (blocked || list == null) {
 710  3154 return;
 711    }
 712  217013 final String context = getCurrentContext().getLocationWithinModule();
 713  217013 visitor.visitEnter(list);
 714  195465 for (int i = 0; i < list.size(); i++) {
 715  447457 setLocationWithinModule(context + ".getElement(" + i + ")");
 716  447458 accept(list.getElement(i));
 717    }
 718  137857 setLocationWithinModule(context);
 719  137857 visitor.visitLeave(list);
 720  137856 setLocationWithinModule(context);
 721    }
 722   
 723  784618 public void accept(final LatexList latexList) throws ModuleDataException {
 724  784618 if (blocked || latexList == null) {
 725  597410 return;
 726    }
 727  187208 final String context = getCurrentContext().getLocationWithinModule();
 728  187208 visitor.visitEnter(latexList);
 729  184807 for (int i = 0; i < latexList.size(); i++) {
 730  350559 setLocationWithinModule(context + ".get(" + i + ")");
 731  350559 accept(latexList.get(i));
 732    }
 733  182161 setLocationWithinModule(context);
 734  182161 visitor.visitLeave(latexList);
 735  182161 setLocationWithinModule(context);
 736    }
 737   
 738  353502 public void accept(final Latex latex) throws ModuleDataException {
 739  353502 if (blocked || latex == null) {
 740  333326 return;
 741    }
 742  20176 final String context = getCurrentContext().getLocationWithinModule();
 743  20176 visitor.visitEnter(latex);
 744  17517 setLocationWithinModule(context);
 745  17517 visitor.visitLeave(latex);
 746  17517 setLocationWithinModule(context);
 747    }
 748   
 749    /**
 750    * Set location information where are we within the original module.
 751    *
 752    * @param locationWithinModule Location within module.
 753    */
 754  5417533 public void setLocationWithinModule(final String locationWithinModule) {
 755  5417527 getCurrentContext().setLocationWithinModule(locationWithinModule);
 756    }
 757   
 758    /**
 759    * Get current context within original.
 760    *
 761    * @return Current context.
 762    */
 763  10494915 public final ModuleContext getCurrentContext() {
 764  10494879 return currentContext;
 765    }
 766   
 767    /**
 768    * Is further transversing blocked?
 769    *
 770    * @return Is further transversing blocked?
 771    */
 772  0 public final boolean getBlocked() {
 773  0 return blocked;
 774    }
 775   
 776    /**
 777    * Set if further transversing is blocked.
 778    *
 779    * @param blocked Further transversion?
 780    */
 781  1145109 public final void setBlocked(final boolean blocked) {
 782  1145109 this.blocked = blocked;
 783    }
 784   
 785    }
 786