Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Mai 10 2007 03:16:40 CEST
file stats: LOC: 785   Methods: 40
NCLOC: 678   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
QedeqNotNullTransverser.java 78,2% 93,8% 97,5% 89,4%
coverage coverage
 1    /* $Id: QedeqNotNullTransverser.java,v 1.3 2007/04/12 23:50:12 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.ModuleContext;
 56    import org.qedeq.kernel.bo.module.ModuleDataException;
 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.3 $
 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  29018 public QedeqNotNullTransverser(final String globalContext, final QedeqVisitor visitor) {
 87  29018 currentContext = new ModuleContext(globalContext);
 88  29018 this.visitor = visitor;
 89    }
 90   
 91   
 92  29016 public void accept(final Qedeq qedeq) throws ModuleDataException {
 93  29016 getCurrentContext().setLocationWithinModule("");
 94  29016 blocked = false;
 95  29016 if (qedeq == null) {
 96  0 return;
 97    }
 98  29016 final String context = getCurrentContext().getLocationWithinModule();
 99  29016 visitor.visitEnter(qedeq);
 100  29014 if (qedeq.getHeader() != null) {
 101  29014 getCurrentContext().setLocationWithinModule(context + "getHeader()");
 102  29014 accept(qedeq.getHeader());
 103    }
 104  28550 if (qedeq.getChapterList() != null) {
 105  28550 getCurrentContext().setLocationWithinModule(context + "getChapterList()");
 106  28550 accept(qedeq.getChapterList());
 107    }
 108  224 if (qedeq.getLiteratureItemList() != null) {
 109  195 getCurrentContext().setLocationWithinModule(context + "getLiteratureItemList()");
 110  195 accept(qedeq.getLiteratureItemList());
 111    }
 112  54 setLocationWithinModule(context);
 113  54 visitor.visitLeave(qedeq);
 114  54 setLocationWithinModule(context);
 115    }
 116   
 117  29014 public void accept(final Header header) throws ModuleDataException {
 118  29014 if (blocked || header == null) {
 119  0 return;
 120    }
 121  29014 final String context = getCurrentContext().getLocationWithinModule();
 122  29014 visitor.visitEnter(header);
 123  28990 if (header.getSpecification() != null) {
 124  28990 setLocationWithinModule(context + ".getSpecification()");
 125  28990 accept(header.getSpecification());
 126    }
 127  28885 if (header.getTitle() != null) {
 128  28885 setLocationWithinModule(context + ".getTitle()");
 129  28885 accept(header.getTitle());
 130    }
 131  28839 if (header.getSummary() != null) {
 132  28839 setLocationWithinModule(context + ".getSummary()");
 133  28839 accept(header.getSummary());
 134    }
 135  28793 if (header.getAuthorList() != null) {
 136  28793 setLocationWithinModule(context + ".getAuthorList()");
 137  28793 accept(header.getAuthorList());
 138    }
 139  28721 if (header.getImportList() != null) {
 140  23949 setLocationWithinModule(context + ".getImportList()");
 141  23949 accept(header.getImportList());
 142    }
 143  28605 if (header.getUsedByList() != null) {
 144  4754 setLocationWithinModule(context + ".getUsedByList()");
 145  4754 accept(header.getUsedByList());
 146    }
 147  28550 setLocationWithinModule(context);
 148  28550 visitor.visitLeave(header);
 149  28550 setLocationWithinModule(context);
 150    }
 151   
 152  4754 public void accept(final UsedByList usedByList) throws ModuleDataException {
 153  4754 if (blocked || usedByList == null) {
 154  4677 return;
 155    }
 156  77 final String context = getCurrentContext().getLocationWithinModule();
 157  77 visitor.visitEnter(usedByList);
 158  67 for (int i = 0; i < usedByList.size(); i++) {
 159  67 setLocationWithinModule(context + ".get(" + i + ")");
 160  67 accept(usedByList.get(i));
 161    }
 162  22 setLocationWithinModule(context);
 163  22 visitor.visitLeave(usedByList);
 164  22 setLocationWithinModule(context);
 165    }
 166   
 167  23949 public void accept(final ImportList importList) throws ModuleDataException {
 168  23949 if (blocked || importList == null) {
 169  23769 return;
 170    }
 171  180 final String context = getCurrentContext().getLocationWithinModule();
 172  180 visitor.visitEnter(importList);
 173  168 for (int i = 0; i < importList.size(); i++) {
 174  251 setLocationWithinModule(context + ".get(" + i + ")");
 175  251 accept(importList.get(i));
 176    }
 177  64 setLocationWithinModule(context);
 178  64 visitor.visitLeave(importList);
 179  64 setLocationWithinModule(context);
 180    }
 181   
 182  251 public void accept(final Import imp) throws ModuleDataException {
 183  251 if (blocked || imp == null) {
 184  66 return;
 185    }
 186  185 final String context = getCurrentContext().getLocationWithinModule();
 187  185 visitor.visitEnter(imp);
 188  159 if (imp.getSpecification() != null) {
 189  159 setLocationWithinModule(context + ".getSpecification()");
 190  159 accept(imp.getSpecification());
 191    }
 192  81 setLocationWithinModule(context);
 193  81 visitor.visitLeave(imp);
 194  81 setLocationWithinModule(context);
 195    }
 196   
 197  29216 public void accept(final Specification specification) throws ModuleDataException {
 198  29216 if (blocked || specification == null) {
 199  28525 return;
 200    }
 201  691 final String context = getCurrentContext().getLocationWithinModule();
 202  691 visitor.visitEnter(specification);
 203  591 if (specification.getLocationList() != null) {
 204  591 setLocationWithinModule(context + ".getLocationList()");
 205  591 accept(specification.getLocationList());
 206    }
 207  463 setLocationWithinModule(context);
 208  463 visitor.visitLeave(specification);
 209  463 setLocationWithinModule(context);
 210    }
 211   
 212  591 public void accept(final LocationList locationList) throws ModuleDataException {
 213  591 if (blocked || locationList == null) {
 214  335 return;
 215    }
 216  256 final String context = getCurrentContext().getLocationWithinModule();
 217  256 visitor.visitEnter(locationList);
 218  204 for (int i = 0; i < locationList.size(); i++) {
 219  204 setLocationWithinModule(context + ".get(" + i + ")");
 220  204 accept(locationList.get(i));
 221    }
 222  128 setLocationWithinModule(context);
 223  128 visitor.visitLeave(locationList);
 224  128 setLocationWithinModule(context);
 225    }
 226   
 227  204 public void accept(final Location location) throws ModuleDataException {
 228  204 if (blocked || location == null) {
 229  0 return;
 230    }
 231  204 final String context = getCurrentContext().getLocationWithinModule();
 232  204 visitor.visitEnter(location);
 233  128 setLocationWithinModule(context);
 234  128 visitor.visitLeave(location);
 235  128 setLocationWithinModule(context);
 236    }
 237   
 238  28793 public void accept(final AuthorList authorList) throws ModuleDataException {
 239  28793 if (blocked || authorList == null) {
 240  28489 return;
 241    }
 242  304 final String context = getCurrentContext().getLocationWithinModule();
 243  304 visitor.visitEnter(authorList);
 244  280 for (int i = 0; i < authorList.size(); i++) {
 245  280 setLocationWithinModule(context + ".get(" + i + ")");
 246  280 accept(authorList.get(i));
 247    }
 248  232 setLocationWithinModule(context);
 249  232 visitor.visitLeave(authorList);
 250  232 setLocationWithinModule(context);
 251    }
 252   
 253  280 public void accept(final Author author) throws ModuleDataException {
 254  280 if (blocked || author == null) {
 255  171 return;
 256    }
 257  109 final String context = getCurrentContext().getLocationWithinModule();
 258  109 visitor.visitEnter(author);
 259  74 if (author.getName() != null) {
 260  74 setLocationWithinModule(context + ".getName()");
 261  74 accept(author.getName());
 262    }
 263  61 setLocationWithinModule(context);
 264  61 visitor.visitLeave(author);
 265  61 setLocationWithinModule(context);
 266    }
 267   
 268  28550 public void accept(final ChapterList chapterList) throws ModuleDataException {
 269  28550 if (blocked || chapterList == null) {
 270  0 return;
 271    }
 272  28550 final String context = getCurrentContext().getLocationWithinModule();
 273  28550 visitor.visitEnter(chapterList);
 274  28538 for (int i = 0; i < chapterList.size(); i++) {
 275  121165 setLocationWithinModule(context + ".get(" + i + ")");
 276  121165 accept(chapterList.get(i));
 277    }
 278  224 setLocationWithinModule(context);
 279  224 visitor.visitLeave(chapterList);
 280  224 setLocationWithinModule(context);
 281    }
 282   
 283  121165 public void accept(final Chapter chapter) throws ModuleDataException {
 284  121165 if (blocked || chapter == null) {
 285  1260 return;
 286    }
 287  119905 final String context = getCurrentContext().getLocationWithinModule();
 288  119905 visitor.visitEnter(chapter);
 289  119763 if (chapter.getTitle() != null) {
 290  119763 setLocationWithinModule(context + ".getTitle()");
 291  119763 accept(chapter.getTitle());
 292    }
 293  119517 if (chapter.getIntroduction() != null) {
 294  119514 setLocationWithinModule(context + ".getIntroduction()");
 295  119514 accept(chapter.getIntroduction());
 296    }
 297  119281 if (chapter.getSectionList() != null) {
 298  60840 setLocationWithinModule(context + ".getSectionList()");
 299  60840 accept(chapter.getSectionList());
 300    }
 301  91591 setLocationWithinModule(context);
 302  91591 visitor.visitLeave(chapter);
 303  91591 setLocationWithinModule(context);
 304    }
 305   
 306  195 public void accept(final LiteratureItemList literatureItemList)
 307    throws ModuleDataException {
 308  195 if (blocked || literatureItemList == null) {
 309  0 return;
 310    }
 311  195 final String context = getCurrentContext().getLocationWithinModule();
 312  195 visitor.visitEnter(literatureItemList);
 313  189 for (int i = 0; i < literatureItemList.size(); i++) {
 314  631 setLocationWithinModule(context + ".get(" + i + ")");
 315  631 accept(literatureItemList.get(i));
 316    }
 317  25 setLocationWithinModule(context);
 318  25 visitor.visitLeave(literatureItemList);
 319  25 setLocationWithinModule(context);
 320    }
 321   
 322  631 public void accept(final LiteratureItem item) throws ModuleDataException {
 323  631 if (blocked || item == null) {
 324  0 return;
 325    }
 326  631 final String context = getCurrentContext().getLocationWithinModule();
 327  631 visitor.visitEnter(item);
 328  565 if (item.getItem() != null) {
 329  565 setLocationWithinModule(context + ".getItem()");
 330  565 accept(item.getItem());
 331    }
 332  467 setLocationWithinModule(context);
 333  467 visitor.visitLeave(item);
 334  467 setLocationWithinModule(context);
 335    }
 336   
 337  60840 public void accept(final SectionList sectionList) throws ModuleDataException {
 338  60840 if (blocked || sectionList == null) {
 339  32966 return;
 340    }
 341  27874 final String context = getCurrentContext().getLocationWithinModule();
 342  27874 visitor.visitEnter(sectionList);
 343  27799 for (int i = 0; i < sectionList.size(); i++) {
 344  69885 setLocationWithinModule(context + ".get(" + i + ")");
 345  69885 accept(sectionList.get(i));
 346    }
 347  184 setLocationWithinModule(context);
 348  184 visitor.visitLeave(sectionList);
 349  184 setLocationWithinModule(context);
 350    }
 351   
 352  69885 public void accept(final Section section) throws ModuleDataException {
 353  69885 if (blocked || section == null) {
 354  0 return;
 355    }
 356  69885 final String context = getCurrentContext().getLocationWithinModule();
 357  69885 visitor.visitEnter(section);
 358  69652 if (section.getTitle() != null) {
 359  69652 setLocationWithinModule(context + ".getTitle()");
 360  69652 accept(section.getTitle());
 361    }
 362  69172 if (section.getIntroduction() != null) {
 363  69169 setLocationWithinModule(context + ".getIntroduction()");
 364  69169 accept(section.getIntroduction());
 365    }
 366  68740 if (section.getSubsectionList() != null) {
 367  57346 setLocationWithinModule(context + ".getSubsectionList()");
 368  57346 accept(section.getSubsectionList());
 369    }
 370  42270 setLocationWithinModule(context);
 371  42270 visitor.visitLeave(section);
 372  42270 setLocationWithinModule(context);
 373    }
 374   
 375  57346 public void accept(final SubsectionList subsectionList) throws ModuleDataException {
 376  57346 if (blocked || subsectionList == null) {
 377  30574 return;
 378    }
 379  26772 final String context = getCurrentContext().getLocationWithinModule();
 380  26772 visitor.visitEnter(subsectionList);
 381  26659 for (int i = 0; i < subsectionList.size(); i++) {
 382  140089 setLocationWithinModule(context + ".get(" + i + ")");
 383    // TODO mime 20050608: here the Subsection context is type dependently specified
 384  140089 if (subsectionList.get(i) instanceof Subsection) {
 385  3577 accept((Subsection) subsectionList.get(i));
 386  136512 } else if (subsectionList.get(i) instanceof Node) {
 387  136512 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  302 setLocationWithinModule(context);
 396  302 visitor.visitLeave(subsectionList);
 397  302 setLocationWithinModule(context);
 398    }
 399   
 400  3577 public void accept(final Subsection subsection) throws ModuleDataException {
 401  3577 if (blocked || subsection == null) {
 402  0 return;
 403    }
 404  3577 final String context = getCurrentContext().getLocationWithinModule();
 405  3577 visitor.visitEnter(subsection);
 406  3483 if (subsection.getTitle() != null) {
 407  1614 setLocationWithinModule(context + ".getTitle()");
 408  1614 accept(subsection.getTitle());
 409    }
 410  3363 if (subsection.getLatex() != null) {
 411  3363 setLocationWithinModule(context + ".getLatex()");
 412  3363 accept(subsection.getLatex());
 413    }
 414  3213 setLocationWithinModule(context);
 415  3213 visitor.visitLeave(subsection);
 416  3213 setLocationWithinModule(context);
 417    }
 418   
 419  136512 public void accept(final Node node) throws ModuleDataException {
 420  136512 if (blocked || node == null) {
 421  0 return;
 422    }
 423  136512 final String context = getCurrentContext().getLocationWithinModule();
 424  136512 visitor.visitEnter(node);
 425  135289 if (node.getName() != null) {
 426  66797 setLocationWithinModule(context + ".getName()");
 427  66797 accept(node.getName());
 428    }
 429  134611 if (node.getTitle() != null) {
 430  66119 setLocationWithinModule(context + ".getTitle()");
 431  66119 accept(node.getTitle());
 432    }
 433  133933 if (node.getPrecedingText() != null) {
 434  132908 setLocationWithinModule(context + ".getPrecedingText()");
 435  132908 accept(node.getPrecedingText());
 436    }
 437  132553 if (node.getNodeType() != null) {
 438  132553 setLocationWithinModule(context + ".getNodeType()");
 439  132553 if (node.getNodeType() instanceof Axiom) {
 440  15912 setLocationWithinModule(context + ".getNodeType().getAxiom()");
 441  15912 accept((Axiom) node.getNodeType());
 442  116641 } else if (node.getNodeType() instanceof PredicateDefinition) {
 443  21470 setLocationWithinModule(context + ".getNodeType().getPredicateDefinition()");
 444  21470 accept((PredicateDefinition) node.getNodeType());
 445  95171 } else if (node.getNodeType() instanceof FunctionDefinition) {
 446  22314 setLocationWithinModule(context + ".getNodeType().getFunctionDefinition()");
 447  22314 accept((FunctionDefinition) node.getNodeType());
 448  72857 } else if (node.getNodeType() instanceof Proposition) {
 449  69846 setLocationWithinModule(context + ".getNodeType().getProposition()");
 450  69846 accept((Proposition) node.getNodeType());
 451  3011 } else if (node.getNodeType() instanceof Rule) {
 452  3011 setLocationWithinModule(context + ".getNodeType().getRule()");
 453  3011 accept((Rule) node.getNodeType());
 454    } else {
 455  0 throw new IllegalArgumentException("unexpected node type: "
 456    + node.getNodeType().getClass());
 457    }
 458    }
 459  110795 if (node.getSucceedingText() != null) {
 460  27261 setLocationWithinModule(context + ".getSucceedingText()");
 461  27261 accept(node.getSucceedingText());
 462    }
 463  110519 setLocationWithinModule(context);
 464  110519 visitor.visitLeave(node);
 465  110519 setLocationWithinModule(context);
 466    }
 467   
 468  15912 public void accept(final Axiom axiom) throws ModuleDataException {
 469  15912 if (blocked || axiom == null) {
 470  13515 return;
 471    }
 472  2397 final String context = getCurrentContext().getLocationWithinModule();
 473  2397 visitor.visitEnter(axiom);
 474  2297 if (axiom.getFormula() != null) {
 475  2297 setLocationWithinModule(context + ".getFormula()");
 476  2297 accept(axiom.getFormula());
 477    }
 478  316 if (axiom.getDescription() != null) {
 479  0 setLocationWithinModule(context + ".getDescription()");
 480  0 accept(axiom.getDescription());
 481    }
 482  316 setLocationWithinModule(context);
 483  316 visitor.visitLeave(axiom);
 484  316 setLocationWithinModule(context);
 485    }
 486   
 487  21470 public void accept(final PredicateDefinition definition)
 488    throws ModuleDataException {
 489  21470 if (blocked || definition == null) {
 490  19908 return;
 491    }
 492  1562 final String context = getCurrentContext().getLocationWithinModule();
 493  1562 visitor.visitEnter(definition);
 494  1398 if (definition.getVariableList() != null) {
 495  1326 setLocationWithinModule(context + ".getVariableList()");
 496  1326 accept(definition.getVariableList());
 497    }
 498  1128 if (definition.getFormula() != null) {
 499  1071 setLocationWithinModule(context + ".getFormula()");
 500  1071 accept(definition.getFormula());
 501    }
 502  266 if (definition.getDescription() != null) {
 503  0 setLocationWithinModule(context + ".getDescription()");
 504  0 accept(definition.getDescription());
 505    }
 506  266 setLocationWithinModule(context);
 507  266 visitor.visitLeave(definition);
 508  266 setLocationWithinModule(context);
 509    }
 510   
 511  22314 public void accept(final FunctionDefinition definition) throws ModuleDataException {
 512  22314 if (blocked || definition == null) {
 513  19980 return;
 514    }
 515  2334 final String context = getCurrentContext().getLocationWithinModule();
 516  2334 visitor.visitEnter(definition);
 517  2142 if (definition.getVariableList() != null) {
 518  1899 setLocationWithinModule(context + ".getVariableList()");
 519  1899 accept(definition.getVariableList());
 520    }
 521  1848 if (definition.getTerm() != null) {
 522  1848 setLocationWithinModule(context + ".getTerm()");
 523  1848 accept(definition.getTerm());
 524    }
 525  314 if (definition.getDescription() != null) {
 526  0 setLocationWithinModule(context + ".getDescription()");
 527  0 accept(definition.getDescription());
 528    }
 529  314 setLocationWithinModule(context);
 530  314 visitor.visitLeave(definition);
 531  314 setLocationWithinModule(context);
 532    }
 533   
 534  69846 public void accept(final Proposition proposition) throws ModuleDataException {
 535  69846 if (blocked || proposition == null) {
 536  52642 return;
 537    }
 538  17204 final String context = getCurrentContext().getLocationWithinModule();
 539  17204 visitor.visitEnter(proposition);
 540  16876 if (proposition.getFormula() != null) {
 541  16876 setLocationWithinModule(context + ".getFormula()");
 542  16876 accept(proposition.getFormula());
 543    }
 544  1142 if (proposition.getDescription() != null) {
 545  77 setLocationWithinModule(context + ".getDescription()");
 546  77 accept(proposition.getDescription());
 547    }
 548  1128 if (proposition.getProofList() != null) {
 549  245 setLocationWithinModule(context + ".getProofList()");
 550  245 accept(proposition.getProofList());
 551    }
 552  975 setLocationWithinModule(context);
 553  975 visitor.visitLeave(proposition);
 554  975 setLocationWithinModule(context);
 555    }
 556   
 557  3011 public void accept(final Rule rule) throws ModuleDataException {
 558  3011 if (blocked || rule == null) {
 559  2776 return;
 560    }
 561  235 final String context = getCurrentContext().getLocationWithinModule();
 562  235 visitor.visitEnter(rule);
 563  185 if (rule.getLinkList() != null) {
 564  53 setLocationWithinModule(context + ".getLinkList()");
 565  53 accept(rule.getLinkList());
 566    }
 567  177 if (rule.getDescription() != null) {
 568  177 setLocationWithinModule(context + ".getDescription()");
 569  177 accept(rule.getDescription());
 570    }
 571  103 if (rule.getProofList() != null) {
 572  0 setLocationWithinModule(context + ".getProofList()");
 573  0 accept(rule.getProofList());
 574    }
 575  103 setLocationWithinModule(context);
 576  103 visitor.visitLeave(rule);
 577  103 setLocationWithinModule(context);
 578    }
 579   
 580  53 public void accept(final LinkList linkList) throws ModuleDataException {
 581  53 if (blocked || linkList == null) {
 582  20 return;
 583    }
 584  33 final String context = getCurrentContext().getLocationWithinModule();
 585  33 visitor.visitEnter(linkList);
 586  25 setLocationWithinModule(context);
 587  25 visitor.visitLeave(linkList);
 588  25 setLocationWithinModule(context);
 589    }
 590   
 591  3225 public void accept(final VariableList variableList) throws ModuleDataException {
 592  3225 if (blocked || variableList == null) {
 593  142 return;
 594    }
 595  3083 final String context = getCurrentContext().getLocationWithinModule();
 596  3083 visitor.visitEnter(variableList);
 597  2939 for (int i = 0; i < variableList.size(); i++) {
 598  4065 final String piece = context + ".get(" + i + ")";
 599  4065 setLocationWithinModule(piece);
 600  4065 if (variableList.get(i) != null) {
 601  4065 if (variableList.get(i).isList()) {
 602  4065 setLocationWithinModule(piece + ".getList()");
 603  4065 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  2519 setLocationWithinModule(context);
 614  2519 visitor.visitLeave(variableList);
 615  2519 setLocationWithinModule(context);
 616    }
 617   
 618  245 public void accept(final ProofList proofList) throws ModuleDataException {
 619  245 if (blocked || proofList == null) {
 620  42 return;
 621    }
 622  203 final String context = getCurrentContext().getLocationWithinModule();
 623  203 visitor.visitEnter(proofList);
 624  175 for (int i = 0; i < proofList.size(); i++) {
 625  175 setLocationWithinModule(context + ".get(" + i + ")");
 626  175 accept(proofList.get(i));
 627    }
 628  50 setLocationWithinModule(context);
 629  50 visitor.visitLeave(proofList);
 630  50 setLocationWithinModule(context);
 631    }
 632   
 633  175 public void accept(final Proof proof) throws ModuleDataException {
 634  175 if (blocked || proof == null) {
 635  0 return;
 636    }
 637  175 final String context = getCurrentContext().getLocationWithinModule();
 638  175 visitor.visitEnter(proof);
 639  117 if (proof.getNonFormalProof() != null) {
 640  117 setLocationWithinModule(context + ".getNonFormalProof()");
 641  117 accept(proof.getNonFormalProof());
 642    }
 643  50 setLocationWithinModule(context);
 644  50 visitor.visitLeave(proof);
 645  50 setLocationWithinModule(context);
 646    }
 647   
 648  20244 public void accept(final Formula formula) throws ModuleDataException {
 649  20244 if (blocked || formula == null) {
 650  596 return;
 651    }
 652  19648 final String context = getCurrentContext().getLocationWithinModule();
 653  19648 visitor.visitEnter(formula);
 654  19164 if (formula.getElement() != null) {
 655  19164 setLocationWithinModule(context + ".getElement()");
 656  19164 accept(formula.getElement());
 657    }
 658  1071 setLocationWithinModule(context);
 659  1071 visitor.visitLeave(formula);
 660  1071 setLocationWithinModule(context);
 661    }
 662   
 663  1848 public void accept(final Term term) throws ModuleDataException {
 664  1848 if (blocked || term == null) {
 665  96 return;
 666    }
 667  1752 final String context = getCurrentContext().getLocationWithinModule();
 668  1752 visitor.visitEnter(term);
 669  1656 if (term.getElement() != null) {
 670  1656 setLocationWithinModule(context + ".getElement()");
 671  1656 accept(term.getElement());
 672    }
 673  218 setLocationWithinModule(context);
 674  218 visitor.visitLeave(term);
 675  218 setLocationWithinModule(context);
 676    }
 677   
 678  402758 public void accept(final Element element) throws ModuleDataException {
 679  402758 if (blocked || element == null) {
 680  192652 return;
 681    }
 682  210106 final String context = getCurrentContext().getLocationWithinModule();
 683  210106 if (element.isList()) {
 684  180939 setLocationWithinModule(context + ".getList()");
 685  180939 accept(element.getList());
 686  29167 } else if (element.isAtom()) {
 687  29167 setLocationWithinModule(context + ".getAtom()");
 688  29167 accept(element.getAtom());
 689    } else {
 690  0 throw new IllegalArgumentException("unexpected element type: "
 691    + element.toString());
 692    }
 693  138479 setLocationWithinModule(context);
 694    }
 695   
 696  29167 public void accept(final Atom atom) throws ModuleDataException {
 697  29167 if (blocked || atom == null) {
 698  0 return;
 699    }
 700  29167 final String context = getCurrentContext().getLocationWithinModule();
 701  29167 visitor.visitEnter(atom);
 702  29167 setLocationWithinModule(context);
 703  29167 visitor.visitLeave(atom);
 704  29167 setLocationWithinModule(context);
 705    }
 706   
 707  185004 public void accept(final ElementList list) throws ModuleDataException {
 708  185004 if (blocked || list == null) {
 709  3154 return;
 710    }
 711  181850 final String context = getCurrentContext().getLocationWithinModule();
 712  181850 visitor.visitEnter(list);
 713  161899 for (int i = 0; i < list.size(); i++) {
 714  381936 setLocationWithinModule(context + ".getElement(" + i + ")");
 715  381936 accept(list.getElement(i));
 716    }
 717  109803 setLocationWithinModule(context);
 718  109803 visitor.visitLeave(list);
 719  109803 setLocationWithinModule(context);
 720    }
 721   
 722  734820 public void accept(final LatexList latexList) throws ModuleDataException {
 723  734820 if (blocked || latexList == null) {
 724  574455 return;
 725    }
 726  160365 final String context = getCurrentContext().getLocationWithinModule();
 727  160365 visitor.visitEnter(latexList);
 728  157976 for (int i = 0; i < latexList.size(); i++) {
 729  308788 setLocationWithinModule(context + ".get(" + i + ")");
 730  308788 accept(latexList.get(i));
 731    }
 732  155344 setLocationWithinModule(context);
 733  155344 visitor.visitLeave(latexList);
 734  155344 setLocationWithinModule(context);
 735    }
 736   
 737  308862 public void accept(final Latex latex) throws ModuleDataException {
 738  308862 if (blocked || latex == null) {
 739  297817 return;
 740    }
 741  11045 final String context = getCurrentContext().getLocationWithinModule();
 742  11045 visitor.visitEnter(latex);
 743  8400 setLocationWithinModule(context);
 744  8400 visitor.visitLeave(latex);
 745  8400 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  4796370 public void setLocationWithinModule(final String locationWithinModule) {
 754  4796370 getCurrentContext().setLocationWithinModule(locationWithinModule);
 755    }
 756   
 757    /**
 758    * Get current context within original.
 759    *
 760    * @return Current context.
 761    */
 762  9363777 public final ModuleContext getCurrentContext() {
 763  9363777 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  1047684 public final void setBlocked(final boolean blocked) {
 781  1047684 this.blocked = blocked;
 782    }
 783   
 784    }
 785