Clover coverage report - Maven Clover report
Coverage timestamp: Tue Sep 16 2008 01:16:37 EEST
file stats: LOC: 112   Methods: 9
NCLOC: 59   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
AxiomAnalysis.java 0% 0% 0% 0%
coverage
 1    /*
 2    wsmo4j - a WSMO API and Reference Implementation
 3   
 4    Copyright (c) 2004-2005, OntoText Lab. / SIRMA
 5   
 6    This library is free software; you can redistribute it and/or modify it under
 7    the terms of the GNU Lesser General Public License as published by the Free
 8    Software Foundation; either version 2.1 of the License, or (at your option)
 9    any later version.
 10    This library is distributed in the hope that it will be useful, but WITHOUT
 11    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 12    FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 13    details.
 14    You should have received a copy of the GNU Lesser General Public License along
 15    with this library; if not, write to the Free Software Foundation, Inc.,
 16    59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 17    */
 18   
 19    /**
 20    * <p>Title: WSMO4J</p>
 21    * <p>Description: WSMO API and a Reference Implementation</p>
 22    * <p>Copyright: Copyright (c) 2004-2005</p>
 23    * <p>Company: OntoText Lab. / SIRMA </p>
 24    */
 25   
 26    package com.ontotext.wsmo4j.parser.wsml;
 27   
 28    import java.util.*;
 29   
 30    import org.omwg.logicalexpression.*;
 31    import org.omwg.ontology.*;
 32    import org.wsmo.common.*;
 33    import org.wsmo.factory.*;
 34    import org.wsmo.wsml.compiler.node.*;
 35   
 36   
 37    public class AxiomAnalysis extends ASTAnalysis {
 38   
 39    private WsmoFactory factory;
 40    private ASTAnalysisContainer container;
 41   
 42  0 public AxiomAnalysis(ASTAnalysisContainer container, WsmoFactory factory) {
 43  0 if (factory == null || container == null) {
 44  0 throw new IllegalArgumentException();
 45    }
 46  0 this.factory = factory;
 47  0 this.container = container;
 48   
 49    // register the handled nodes
 50  0 container.registerNodeHandler(ADefinedAxiomAxiomdefinition.class, this);
 51  0 container.registerNodeHandler(ANfpAxiomAxiomdefinition.class, this);
 52  0 container.registerNodeHandler(AUseAxiomAxiomdefinition.class, this);
 53    }
 54   
 55  0 public void inADefinedAxiomAxiomdefinition(ADefinedAxiomAxiomdefinition node) {
 56  0 _inAxiomdefinition(node.getId());
 57    }
 58   
 59  0 public void inANfpAxiomAxiomdefinition(ANfpAxiomAxiomdefinition node) {
 60  0 _inAxiomdefinition(node.getId());
 61    }
 62   
 63  0 public void inAUseAxiomAxiomdefinition(AUseAxiomAxiomdefinition node) {
 64  0 _inAxiomdefinition(node.getId());
 65    }
 66   
 67  0 public void outADefinedAxiomAxiomdefinition(ADefinedAxiomAxiomdefinition node) {
 68  0 _outAAxiomdefinition();
 69    }
 70   
 71  0 public void outANfpAxiomAxiomdefinition(ANfpAxiomAxiomdefinition node) {
 72  0 _outAAxiomdefinition();
 73    }
 74   
 75  0 public void outAUseAxiomAxiomdefinition(AUseAxiomAxiomdefinition node) {
 76  0 _outAAxiomdefinition();
 77    }
 78   
 79   
 80  0 private void _outAAxiomdefinition() {
 81  0 Axiom a = (Axiom) container.popFromStack(Entity.class, Axiom.class);
 82  0 Stack s = container.getStack(LogicalExpression.class);
 83  0 while (!s.isEmpty()) {
 84  0 a.addDefinition((LogicalExpression) s.remove(0));
 85    }
 86    }
 87   
 88  0 private void _inAxiomdefinition(PId id) {
 89  0 Axiom axiom = null;
 90  0 if (id == null) {
 91  0 axiom = factory.createAxiom(factory.createAnonymousID());
 92    }
 93    else {
 94  0 id.apply(container.getNodeHandler(PId.class));
 95  0 axiom = factory.createAxiom((Identifier) container.popFromStack(Identifier.class,
 96    Identifier.class));
 97    }
 98   
 99  0 container.getStack(Entity.class).push(axiom);
 100  0 container.getStack(Axiom.class).push(axiom);
 101    }
 102    }
 103   
 104    /*
 105    * $Log$
 106    * Revision 1.2 2005/11/29 14:44:24 holgerlausen
 107    * fixed axiom analysis, logexp are now removed from stack
 108    *
 109    * Revision 1.1 2005/11/28 13:55:26 vassil_momtchev
 110    * AST analyses
 111    *
 112    */