Clover coverage report - Maven Clover report
Coverage timestamp: Tue Sep 16 2008 01:16:37 EEST
file stats: LOC: 106   Methods: 9
NCLOC: 57   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
VariableAnalysis.java 0% 0% 0% 0%
coverage
 1    /*
 2    wsmo4j - a WSMO API and Reference Implementation
 3   
 4    Copyright (c) 2005, University of Innsbruck, Austria
 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    package org.deri.wsmo4j.io.parser.wsml;
 19   
 20    import java.util.*;
 21   
 22    import org.omwg.ontology.*;
 23    import org.wsmo.factory.*;
 24    import org.wsmo.wsml.compiler.node.*;
 25   
 26    import com.ontotext.wsmo4j.parser.wsml.*;
 27   
 28    /**
 29    *
 30    * <pre>
 31    * Created on 21.11.2005
 32    * Committed by $Author$
 33    * $Source$,
 34    * </pre>
 35    *
 36    * @author Holger Lausen
 37    * @version $Revision$ $Date$
 38    */
 39    public class VariableAnalysis extends ASTAnalysis {
 40    private LogicalExpressionFactory factory;
 41    private ASTAnalysisContainer container;
 42   
 43    private Stack terms; // handle to terms stack
 44    private Stack varLists; // handle to var lists stack
 45    private Stack myVars = new Stack();
 46  0 public VariableAnalysis(ASTAnalysisContainer container,
 47    LogicalExpressionFactory factory) {
 48   
 49  0 if (container == null || factory == null) {
 50  0 throw new IllegalArgumentException();
 51    }
 52  0 this.factory = factory;
 53  0 this.container = container;
 54   
 55    // register the handled nodes
 56  0 container.registerNodeHandler(AVariableVariables.class, this);
 57  0 container.registerNodeHandler(AVariableVariablelist.class, this);
 58  0 container.registerNodeHandler(AVariableListVariablelist.class, this);
 59  0 container.registerNodeHandler(AVariables.class, this);
 60   
 61  0 varLists = container.getStack(Variable[].class);
 62    }
 63   
 64   
 65  0 public void outAVariableVariablelist(AVariableVariablelist node) {
 66  0 outVarList();
 67    }
 68   
 69  0 public void outAVariableListVariablelist(AVariableListVariablelist node) {
 70  0 outVarList();
 71    }
 72   
 73  0 public void outAVariables(AVariables node) {
 74  0 outVarList();
 75    }
 76   
 77  0 public void outAVariableVariables(AVariableVariables node) {
 78  0 outVarList();
 79    }
 80   
 81  0 public void caseAVariables(AVariables node) {
 82  0 myVars.add(factory.createVariable(
 83    node.getVariable().getText()));
 84    }
 85   
 86   
 87  0 public void caseAVariableVariablelist(AVariableVariablelist node) {
 88  0 myVars.add(factory.createVariable(
 89    node.getVariable().getText()));
 90    }
 91   
 92   
 93  0 public void caseAVariableVariables(AVariableVariables node) {
 94  0 myVars.add(factory.createVariable(
 95    node.getVariable().getText()));
 96    }
 97   
 98  0 private void outVarList(){
 99  0 if (!myVars.isEmpty()){
 100  0 varLists.add((Variable[])
 101    myVars.toArray(new Variable[myVars.size()]));
 102  0 myVars.clear();
 103    }
 104    }
 105   
 106    }